Add a lable showing the configured output path.

This commit is contained in:
efrick 2024-08-05 14:43:42 -04:00
parent 072e59bd4a
commit c5f3410b25
2 changed files with 35 additions and 18 deletions

40
MainForm.Designer.cs generated
View File

@ -36,13 +36,14 @@
aboutToolStripMenuItem = new ToolStripMenuItem();
configureToolStripMenuItem = new ToolStripMenuItem();
exitToolStripMenuItem = new ToolStripMenuItem();
pathLable = new Label();
srcPathLable = new Label();
outputLable = new Label();
menuStrip1.SuspendLayout();
SuspendLayout();
//
// mergeButton
//
mergeButton.Location = new Point(107, 193);
mergeButton.Location = new Point(167, 193);
mergeButton.Name = "mergeButton";
mergeButton.Size = new Size(211, 100);
mergeButton.TabIndex = 0;
@ -62,7 +63,7 @@
menuStrip1.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem });
menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(421, 33);
menuStrip1.Size = new Size(539, 33);
menuStrip1.TabIndex = 2;
menuStrip1.Text = "menuStrip1";
//
@ -98,22 +99,32 @@
exitToolStripMenuItem.Text = "Exit";
exitToolStripMenuItem.Click += exitToolStripMenuItem_Click;
//
// pathLable
// srcPathLable
//
pathLable.AutoSize = true;
pathLable.Location = new Point(59, 109);
pathLable.Name = "pathLable";
pathLable.Size = new Size(55, 25);
pathLable.TabIndex = 3;
pathLable.Text = "Path: ";
pathLable.Click += label1_Click;
srcPathLable.AutoSize = true;
srcPathLable.Location = new Point(59, 86);
srcPathLable.Name = "srcPathLable";
srcPathLable.Size = new Size(114, 25);
srcPathLable.TabIndex = 3;
srcPathLable.Text = "Source Path: ";
srcPathLable.Click += label1_Click;
//
// outputLable
//
outputLable.AutoSize = true;
outputLable.Location = new Point(59, 126);
outputLable.Name = "outputLable";
outputLable.Size = new Size(117, 25);
outputLable.TabIndex = 4;
outputLable.Text = "Output Path: ";
//
// MainForm
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(421, 387);
Controls.Add(pathLable);
ClientSize = new Size(539, 387);
Controls.Add(outputLable);
Controls.Add(srcPathLable);
Controls.Add(menuStrip1);
Controls.Add(mergeButton);
MainMenuStrip = menuStrip1;
@ -136,6 +147,7 @@
private ToolStripMenuItem aboutToolStripMenuItem;
private ToolStripMenuItem configureToolStripMenuItem;
private ToolStripMenuItem exitToolStripMenuItem;
private Label pathLable;
private Label srcPathLable;
private Label outputLable;
}
}

View File

@ -13,28 +13,33 @@ namespace PDF_Merge
public void SetPathLable()
{
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"];
string outputPath = ConfigurationManager.AppSettings["PDF-Output"];
string outputFile = ConfigurationManager.AppSettings["PDF-Name"];
string fullOutPath = outputPath + "/" + outputFile;
if (sourcePath != null)
{
if (sourcePath != "")
{
if (Directory.Exists(sourcePath))
{
pathLable.Text = "Path: " + sourcePath;
srcPathLable.Text = "Source Path: " + sourcePath;
}
else
{
pathLable.Text = "The configured path does not exist.";
srcPathLable.Text = "The configured path does not exist.";
}
}
else
{
pathLable.Text = "The configured path is blank.";
srcPathLable.Text = "The configured path is blank.";
}
}
else
{
pathLable.Text = "No path has been configured.";
srcPathLable.Text = "No path has been configured.";
}
outputLable.Text = "Output Path: " + fullOutPath;
}
private void Form1_Load(object sender, EventArgs e)