Update the PathLable in the main form when configuration changes.
This commit is contained in:
+16
-4
@@ -7,6 +7,11 @@ namespace PDF_Merge
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetPathLable();
|
||||
}
|
||||
|
||||
public void SetPathLable()
|
||||
{
|
||||
string sourcePath = ConfigurationManager.AppSettings["PDF-Path"];
|
||||
if (sourcePath != null)
|
||||
{
|
||||
@@ -14,16 +19,19 @@ namespace PDF_Merge
|
||||
{
|
||||
if (Directory.Exists(sourcePath))
|
||||
{
|
||||
pathLable.Text = pathLable.Text + sourcePath;
|
||||
} else
|
||||
pathLable.Text = "Path: " + sourcePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
pathLable.Text = "The configured path does not exist.";
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
pathLable.Text = "The configured path is blank.";
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
pathLable.Text = "No path has been configured.";
|
||||
}
|
||||
@@ -61,5 +69,9 @@ namespace PDF_Merge
|
||||
ConfForm ConfForm = new ConfForm();
|
||||
ConfForm.Show();
|
||||
}
|
||||
private void MainForm_Activated(object sender, EventArgs e)
|
||||
{
|
||||
SetPathLable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user