From c5f3410b25ebff1be1118ea1d175be80069d4313 Mon Sep 17 00:00:00 2001 From: efrick Date: Mon, 5 Aug 2024 14:43:42 -0400 Subject: [PATCH] Add a lable showing the configured output path. --- MainForm.Designer.cs | 40 ++++++++++++++++++++++++++-------------- MainForm.cs | 13 +++++++++---- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index e7ce962..7910f32 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -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; } } diff --git a/MainForm.cs b/MainForm.cs index fbf1b37..a459495 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -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)