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

View File

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

View File

@ -1,3 +1,5 @@
using System.Configuration;
namespace PDF_Merge
{
internal static class Program
@ -13,6 +15,10 @@ namespace PDF_Merge
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
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());
}
}
}
}