summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 15:29:41 +0000
commit225aa1499e37faf9d38257caabbadc68d78b427e (patch)
tree102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs')
-rw-r--r--Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs110
1 files changed, 110 insertions, 0 deletions
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;
+ }
+ }
+}