Squashed 'FSI.Lib/' content from commit 6aa4846
git-subtree-dir: FSI.Lib git-subtree-split: 6aa48465a834a7bfdd9cbeae8d2e4f769d0c0ff8
This commit is contained in:
71
FSI.Lib/Guis/Pdf.Mgt/FrmMain.xaml.cs
Normal file
71
FSI.Lib/Guis/Pdf.Mgt/FrmMain.xaml.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.Configuration;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
|
||||
namespace FSI.Lib.Guis.Pdf.Mgt
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für FrmMain.xaml
|
||||
/// </summary>
|
||||
public partial class FrmMain : Window
|
||||
{
|
||||
public bool CloseAtLostFocus { get; set; }
|
||||
|
||||
public FrmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new MVVM.ViewModel.CurrentTimeViewModel();
|
||||
Title += " v" + Assembly.GetExecutingAssembly().GetName().Version; // Version in Titel eintragen
|
||||
Deactivated += FrmMain_Deactivated;
|
||||
}
|
||||
|
||||
private void FrmMain_Deactivated(object sender, System.EventArgs e)
|
||||
{
|
||||
if (CloseAtLostFocus)
|
||||
Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
private async void btnCleanUp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BtnMgt(false); // Schaltflächen sperren
|
||||
|
||||
await Cmds.DelDirectoriesAsync(ConfigurationManager.AppSettings["PdfPath"]); // nicht benötigte/zulässige Verzeichnisse löschen
|
||||
await Cmds.DelFilesAsync(ConfigurationManager.AppSettings["PdfPath"]); // nicht benötigte/zulässige Datien löschen
|
||||
BtnMgt(true); // Schaltflächen freigeben
|
||||
}
|
||||
|
||||
private async void btnCreateShortcuts_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BtnMgt(false); // Schaltflächen sperren
|
||||
await Cmds.CreatePdfShortcutsAsync(ConfigurationManager.AppSettings["PdfPath"]); // Verzeichnisstruktur und Verknüpfungen erstellen
|
||||
BtnMgt(true); // Schaltflächen freigeben
|
||||
}
|
||||
|
||||
private async void btnStart_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BtnMgt(false); // Schaltflächen sperren
|
||||
await Cmds.DelDirectoriesAsync(ConfigurationManager.AppSettings["PdfPath"]); // nicht benötigte/zulässige Verzeichnisse löschen
|
||||
await Cmds.DelFilesAsync(ConfigurationManager.AppSettings["PdfPath"]); // nicht benötigte/zulässige Datien lösche
|
||||
await Cmds.CreatePdfShortcutsAsync(ConfigurationManager.AppSettings["PdfPath"]); // Verzeichnisstruktur und Verknüpfungen erstellen
|
||||
BtnMgt(true); // Schaltflächen freigeben
|
||||
}
|
||||
|
||||
private void BtnMgt(bool enable)
|
||||
{
|
||||
btnCleanUp.IsEnabled =
|
||||
btnCreateShortcuts.IsEnabled =
|
||||
btnStart.IsEnabled = enable;
|
||||
pgProgress.IsIndeterminate = !enable;
|
||||
|
||||
// Status anzeige
|
||||
if (enable)
|
||||
{
|
||||
tbStatus.Text = "beendet";
|
||||
}
|
||||
else
|
||||
{
|
||||
tbStatus.Text = "gestartet";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user