From 225aa1499e37faf9d38257caabbadc68d78b427e Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 12:29:41 -0300 Subject: decompiler.com --- .../ErrorWindow.cs | 110 +++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs (limited to 'Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs') diff --git a/Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs b/Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs new file mode 100644 index 0000000..180c775 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs @@ -0,0 +1,110 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Markup; +using Gestor.Application.Helpers; +using Gestor.Common.Validation; +using Gestor.Model.API; + +namespace Gestor.Application.Views.Generic; + +public class ErrorWindow : Window, IComponentConnector +{ + internal TextBlock DescricaoErro; + + internal RepeatButton ContinuarButton; + + private bool _contentLoaded; + + public ErrorWindow(TipoErro tipo, bool fecharSistema = false) + { + //IL_000d: Unknown result type (might be due to invalid IL or missing references) + InitializeComponent(); + HanddleErro(tipo); + if (fecharSistema) + { + ((UIElement)ContinuarButton).Visibility = (Visibility)2; + } + } + + private void HanddleErro(TipoErro tipo) + { + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + //IL_0018: Invalid comparison between Unknown and I4 + DescricaoErro.Text = ValidationHelper.GetCategory((Enum)(object)tipo); + if ((int)tipo != 3) + { + ((UIElement)ContinuarButton).Visibility = (Visibility)0; + } + else + { + ((UIElement)ContinuarButton).Visibility = (Visibility)2; + } + } + + private void ContinuarButton_OnClick(object sender, RoutedEventArgs e) + { + ((Window)this).Close(); + } + + private void Reiniciar_OnClick(object sender, RoutedEventArgs e) + { + Shutdown(); + } + + private void Shutdown() + { + Instancia.ExcluirCfg(); + Process.Start(Application.ResourceAssembly.Location, ApplicationHelper.Conectado ? "INICIAR CONECTADO" : "INICIAR"); + Application.Current.Shutdown(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/generic/errorwindow.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_0018: Unknown result type (might be due to invalid IL or missing references) + //IL_0022: Expected O, but got Unknown + //IL_0025: Unknown result type (might be due to invalid IL or missing references) + //IL_002f: Expected O, but got Unknown + //IL_003c: Unknown result type (might be due to invalid IL or missing references) + //IL_0046: Expected O, but got Unknown + //IL_0048: Unknown result type (might be due to invalid IL or missing references) + //IL_0054: Unknown result type (might be due to invalid IL or missing references) + //IL_005e: Expected O, but got Unknown + switch (connectionId) + { + case 1: + DescricaoErro = (TextBlock)target; + break; + case 2: + ContinuarButton = (RepeatButton)target; + ((ButtonBase)ContinuarButton).Click += new RoutedEventHandler(ContinuarButton_OnClick); + break; + case 3: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(Reiniciar_OnClick); + break; + default: + _contentLoaded = true; + break; + } + } +} -- cgit v1.2.3