summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Componentes/DialogInstalacoes.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Componentes/DialogInstalacoes.cs')
-rw-r--r--Decompiler/Gestor.Application.Componentes/DialogInstalacoes.cs118
1 files changed, 118 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Componentes/DialogInstalacoes.cs b/Decompiler/Gestor.Application.Componentes/DialogInstalacoes.cs
new file mode 100644
index 0000000..2fc1403
--- /dev/null
+++ b/Decompiler/Gestor.Application.Componentes/DialogInstalacoes.cs
@@ -0,0 +1,118 @@
+using System;
+using System.CodeDom.Compiler;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Markup;
+using Gestor.Model.License;
+using MaterialDesignThemes.Wpf;
+
+namespace Gestor.Application.Componentes;
+
+public class DialogInstalacoes : UserControl, IComponentConnector
+{
+ internal DataGrid InstalacoesView;
+
+ internal Button ValidarButton;
+
+ internal Button FecharButton;
+
+ internal Snackbar Snackbar;
+
+ private bool _contentLoaded;
+
+ public DialogInstalacoes(List<Instalacao> instalacoes)
+ {
+ InitializeComponent();
+ ((ItemsControl)InstalacoesView).ItemsSource = instalacoes.Where((Instalacao i) => !string.IsNullOrEmpty(i.Gerenciador))?.ToList();
+ ((Selector)InstalacoesView).SelectedIndex = -1;
+ }
+
+ private void ValidarButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ //IL_0037: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0047: Expected O, but got Unknown
+ object selectedItem = ((Selector)InstalacoesView).SelectedItem;
+ if (selectedItem == null)
+ {
+ ((ContentControl)Snackbar.Message).Content = "SELECIONE A INSTALAÇÃO A SER SUBSTITUÍDA";
+ Snackbar.IsActive = true;
+ }
+ else
+ {
+ DialogHost.CloseDialogCommand.Execute((object)(Instalacao)selectedItem, (IInputElement)(object)ValidarButton);
+ }
+ }
+
+ private void FecharButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ DialogHost.CloseDialogCommand.Execute((object)null, (IInputElement)(object)FecharButton);
+ }
+
+ private void SnackbarMessage_ActionClick(object sender, RoutedEventArgs e)
+ {
+ ((ContentControl)Snackbar.Message).Content = "";
+ Snackbar.IsActive = false;
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/componentes/dialoginstalacoes.xaml", UriKind.Relative);
+ Application.LoadComponent((object)this, uri);
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IComponentConnector.Connect(int connectionId, object target)
+ {
+ //IL_0020: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002a: Expected O, but got Unknown
+ //IL_002d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0037: Expected O, but got Unknown
+ //IL_0044: Unknown result type (might be due to invalid IL or missing references)
+ //IL_004e: Expected O, but got Unknown
+ //IL_0051: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005b: Expected O, but got Unknown
+ //IL_0068: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0072: Expected O, but got Unknown
+ //IL_0075: Unknown result type (might be due to invalid IL or missing references)
+ //IL_007f: Expected O, but got Unknown
+ //IL_0081: Unknown result type (might be due to invalid IL or missing references)
+ //IL_008d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0097: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ InstalacoesView = (DataGrid)target;
+ break;
+ case 2:
+ ValidarButton = (Button)target;
+ ((ButtonBase)ValidarButton).Click += new RoutedEventHandler(ValidarButton_OnClick);
+ break;
+ case 3:
+ FecharButton = (Button)target;
+ ((ButtonBase)FecharButton).Click += new RoutedEventHandler(FecharButton_OnClick);
+ break;
+ case 4:
+ Snackbar = (Snackbar)target;
+ break;
+ case 5:
+ ((SnackbarMessage)target).ActionClick += new RoutedEventHandler(SnackbarMessage_ActionClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}