From 903bc4880fe2ff357ee6082355041c6f9b5fbb13 Mon Sep 17 00:00:00 2001 From: efrick Date: Mon, 5 Aug 2024 18:19:39 -0400 Subject: [PATCH] Update MainForm --- MainForm.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/MainForm.cs b/MainForm.cs index 02b8008..22879b2 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -4,13 +4,17 @@ namespace PDF_Merge { public partial class MainForm : Form { - string pdfPath = ConfigurationManager.AppSettings["PDF-Output"] + Path.DirectorySeparatorChar + ConfigurationManager.AppSettings["PDF-Name"]; + public MainForm() { InitializeComponent(); SetPathLable(); } - + private static string getOutputPath() + { + string pdfPath = ConfigurationManager.AppSettings["PDF-Output"] + Path.DirectorySeparatorChar + ConfigurationManager.AppSettings["PDF-Name"]; + return pdfPath; + } public void SetPathLable() { string sourcePath = ConfigurationManager.AppSettings["PDF-Path"]; @@ -37,7 +41,7 @@ namespace PDF_Merge { srcPathLable.Text = "No path has been configured."; } - outputLable.Text = "Output Path: " + pdfPath; + outputLable.Text = "Output Path: " + getOutputPath(); } private void Form1_Load(object sender, EventArgs e) @@ -49,7 +53,7 @@ namespace PDF_Merge { string[] pdf_files = MergePDFs.CollectPdfFiles(); - MergePDFs.MergePdfFiles(pdf_files, pdfPath); + MergePDFs.MergePdfFiles(pdf_files, getOutputPath()); } private void exitToolStripMenuItem_Click(object sender, EventArgs e)