Complete the configuration menue elements.

This commit is contained in:
efrick 2024-08-01 23:28:42 -04:00
parent ea1de129ed
commit 0a132d75ec
3 changed files with 29 additions and 15 deletions

28
ConfForm.Designer.cs generated
View File

@ -37,7 +37,7 @@ namespace PDF_Merge
folderBrowserDialog1 = new FolderBrowserDialog(); folderBrowserDialog1 = new FolderBrowserDialog();
sourceLabel = new Label(); sourceLabel = new Label();
outputLabel = new Label(); outputLabel = new Label();
checkBox1 = new CheckBox(); overrideCBox = new CheckBox();
sourceDirBtn = new Button(); sourceDirBtn = new Button();
outPathBtn = new Button(); outPathBtn = new Button();
SuspendLayout(); SuspendLayout();
@ -59,7 +59,7 @@ namespace PDF_Merge
cancelBtn.TabIndex = 1; cancelBtn.TabIndex = 1;
cancelBtn.Text = "Cancel"; cancelBtn.Text = "Cancel";
cancelBtn.UseVisualStyleBackColor = true; cancelBtn.UseVisualStyleBackColor = true;
cancelBtn.Click += this.cancelBtn_Click; cancelBtn.Click += cancelBtn_Click;
// //
// sourceBox // sourceBox
// //
@ -93,17 +93,17 @@ namespace PDF_Merge
outputLabel.TabIndex = 5; outputLabel.TabIndex = 5;
outputLabel.Text = "Output Path"; outputLabel.Text = "Output Path";
// //
// checkBox1 // overrideCBox
// //
checkBox1.AutoSize = true; overrideCBox.AutoSize = true;
checkBox1.Checked = true; overrideCBox.Checked = true;
checkBox1.CheckState = CheckState.Checked; overrideCBox.CheckState = CheckState.Checked;
checkBox1.Location = new Point(171, 105); overrideCBox.Location = new Point(171, 105);
checkBox1.Name = "checkBox1"; overrideCBox.Name = "overrideCBox";
checkBox1.Size = new Size(179, 29); overrideCBox.Size = new Size(179, 29);
checkBox1.TabIndex = 6; overrideCBox.TabIndex = 6;
checkBox1.Text = "Overwrite Existing"; overrideCBox.Text = "Overwrite Existing";
checkBox1.UseVisualStyleBackColor = true; overrideCBox.UseVisualStyleBackColor = true;
// //
// sourceDirBtn // sourceDirBtn
// //
@ -130,7 +130,7 @@ namespace PDF_Merge
ClientSize = new Size(500, 282); ClientSize = new Size(500, 282);
Controls.Add(outPathBtn); Controls.Add(outPathBtn);
Controls.Add(sourceDirBtn); Controls.Add(sourceDirBtn);
Controls.Add(checkBox1); Controls.Add(overrideCBox);
Controls.Add(outputLabel); Controls.Add(outputLabel);
Controls.Add(sourceLabel); Controls.Add(sourceLabel);
Controls.Add(outputBox); Controls.Add(outputBox);
@ -152,7 +152,7 @@ namespace PDF_Merge
private FolderBrowserDialog folderBrowserDialog1; private FolderBrowserDialog folderBrowserDialog1;
private Label sourceLabel; private Label sourceLabel;
private Label outputLabel; private Label outputLabel;
private CheckBox checkBox1; private CheckBox overrideCBox;
private Button sourceDirBtn; private Button sourceDirBtn;
private Button outPathBtn; private Button outPathBtn;
} }

View File

@ -18,10 +18,18 @@ namespace PDF_Merge
InitializeComponent(); InitializeComponent();
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"]; string sourcePath = ConfigurationManager.AppSettings["PDF-Path"];
string outputPath = ConfigurationManager.AppSettings["PDF-output"]; string outputPath = ConfigurationManager.AppSettings["PDF-Output"];
sourceBox.Text = sourcePath; sourceBox.Text = sourcePath;
outputBox.Text = outputPath; outputBox.Text = outputPath;
if (ConfigurationManager.AppSettings["overwrite"] == "true")
{
overrideCBox.Checked = true;
}
else
{
overrideCBox.Checked = false;
}
} }
private void cancelBtn_Click(object sender, EventArgs e) private void cancelBtn_Click(object sender, EventArgs e)

View File

@ -1,3 +1,5 @@
using System.Configuration;
namespace PDF_Merge namespace PDF_Merge
{ {
internal static class Program internal static class Program
@ -13,6 +15,10 @@ namespace PDF_Merge
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new MainForm()); Application.Run(new MainForm());
if (ConfigurationManager.AppSettings["PDF-Path"] == "" || ConfigurationManager.AppSettings["PDF-Path"] == null || ConfigurationManager.AppSettings["PDF-Output"] == "" || ConfigurationManager.AppSettings["PDF-Output"] == null)
{
Application.Run(new ConfForm());
}
} }
} }
} }