Update the PathLable in the main form when configuration changes.
This commit is contained in:
parent
6d06fa90e5
commit
b1368e3c53
1
MainForm.Designer.cs
generated
1
MainForm.Designer.cs
generated
@ -119,6 +119,7 @@
|
||||
MainMenuStrip = menuStrip1;
|
||||
Name = "MainForm";
|
||||
Text = "PDF-Merge";
|
||||
Activated += MainForm_Activated;
|
||||
Load += Form1_Load;
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
|
20
MainForm.cs
20
MainForm.cs
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user