From b6a6f92605dcafd9d4aff8ffa3d04843ad6f4923 Mon Sep 17 00:00:00 2001 From: "PAL\\cbo" Date: Tue, 7 Feb 2023 11:52:25 +0100 Subject: [PATCH] Refactory --- .../{MainWindow.xaml => AppMainWindow.xaml} | 123 ++++++++++-------- wpf_ax_utility/AppMainWindow.xaml.cs | 44 +++++++ .../{UserWindow.xaml => AppUserWindow.xaml} | 8 +- wpf_ax_utility/AppUserWindow.xaml.cs | 32 +++++ wpf_ax_utility/MainWindow.xaml.cs | 86 ------------ wpf_ax_utility/UserWindow.xaml.cs | 56 -------- wpf_ax_utility/Utility.cs | 45 +++++++ .../{ => res}/axc/PAL_DEVELOP_USR.axc | Bin .../{ => res}/axc/PAL_LIVE_02_USR.axc | Bin wpf_ax_utility/{ => res}/axc/PAL_LIVE_USR.axc | Bin .../{ => res}/axc/PAL_STAGING_USR.axc | Bin wpf_ax_utility/{ => res}/axc/PAL_TEST_USR.axc | Bin wpf_ax_utility/{ => res}/axlogo.ico | Bin wpf_ax_utility/res/pallogo.png | Bin 0 -> 178393 bytes wpf_ax_utility/wpf_ax_utility.csproj | 25 ++-- 15 files changed, 206 insertions(+), 213 deletions(-) rename wpf_ax_utility/{MainWindow.xaml => AppMainWindow.xaml} (59%) create mode 100644 wpf_ax_utility/AppMainWindow.xaml.cs rename wpf_ax_utility/{UserWindow.xaml => AppUserWindow.xaml} (94%) create mode 100644 wpf_ax_utility/AppUserWindow.xaml.cs delete mode 100644 wpf_ax_utility/MainWindow.xaml.cs delete mode 100644 wpf_ax_utility/UserWindow.xaml.cs rename wpf_ax_utility/{ => res}/axc/PAL_DEVELOP_USR.axc (100%) rename wpf_ax_utility/{ => res}/axc/PAL_LIVE_02_USR.axc (100%) rename wpf_ax_utility/{ => res}/axc/PAL_LIVE_USR.axc (100%) rename wpf_ax_utility/{ => res}/axc/PAL_STAGING_USR.axc (100%) rename wpf_ax_utility/{ => res}/axc/PAL_TEST_USR.axc (100%) rename wpf_ax_utility/{ => res}/axlogo.ico (100%) create mode 100644 wpf_ax_utility/res/pallogo.png diff --git a/wpf_ax_utility/MainWindow.xaml b/wpf_ax_utility/AppMainWindow.xaml similarity index 59% rename from wpf_ax_utility/MainWindow.xaml rename to wpf_ax_utility/AppMainWindow.xaml index 1c424d2..657f71d 100644 --- a/wpf_ax_utility/MainWindow.xaml +++ b/wpf_ax_utility/AppMainWindow.xaml @@ -1,9 +1,10 @@ - + Icon="res/axlogo.ico"> - - - @@ -41,23 +39,31 @@ + - + - + + + + + @@ -79,56 +86,60 @@ diff --git a/wpf_ax_utility/AppMainWindow.xaml.cs b/wpf_ax_utility/AppMainWindow.xaml.cs new file mode 100644 index 0000000..3eb9752 --- /dev/null +++ b/wpf_ax_utility/AppMainWindow.xaml.cs @@ -0,0 +1,44 @@ +using System.Windows; +using System.Windows.Input; + +namespace wpf_ax_utility +{ + public partial class AppMainWindow : Window + { + public AppMainWindow() + { + InitializeComponent(); + } + + private void MouseLeftDrag(object sender, MouseButtonEventArgs e) + { + DragMove(); + } + + private void CloseButton(object sender, RoutedEventArgs e) + { + Close(); + } + + private void AucCleanerButton(object sender, RoutedEventArgs e) + { + Utility.AucCleaner(); + + const string message = "I file .auc sono stati cancellati!"; + const string caption = "Informazioni"; + MessageBox.Show(message, caption, MessageBoxButton.OK, MessageBoxImage.Information); + } + + private void InfoButtonButton(object sender, RoutedEventArgs e) + { + const string message = "Durante il normale utilizzo del software Microsoft Dynamics Ax 2012, potrebbero generarsi dei conflitti nelle impostazioni utente, che bloccano l'apertura del programma.\r\n\r\nÈ possibile tentare di sbloccare la situazione eliminando i file AUC dalla cache locale dell'utente."; + const string caption = "Informazioni"; + MessageBox.Show(message, caption, MessageBoxButton.OK, MessageBoxImage.Information); + } + + private void ButtonClicked(object sender, RoutedEventArgs e) + { + Utility.AxEnvironmentSelection(sender, e); + } + } +} diff --git a/wpf_ax_utility/UserWindow.xaml b/wpf_ax_utility/AppUserWindow.xaml similarity index 94% rename from wpf_ax_utility/UserWindow.xaml rename to wpf_ax_utility/AppUserWindow.xaml index 874051f..0083ec4 100644 --- a/wpf_ax_utility/UserWindow.xaml +++ b/wpf_ax_utility/AppUserWindow.xaml @@ -1,8 +1,10 @@ - + Icon="res/axlogo.ico">