summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views/TutorialView.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/TutorialView.cs
parent1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff)
downloadgestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz
gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views/TutorialView.cs')
-rw-r--r--Decompiler/Gestor.Application.Views/TutorialView.cs395
1 files changed, 395 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views/TutorialView.cs b/Decompiler/Gestor.Application.Views/TutorialView.cs
new file mode 100644
index 0000000..a09e452
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views/TutorialView.cs
@@ -0,0 +1,395 @@
+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.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Shapes;
+using System.Windows.Shell;
+using System.Windows.Threading;
+using Gestor.Application.Componentes;
+using Gestor.Application.ViewModels;
+
+namespace Gestor.Application.Views;
+
+public class TutorialView : Window, IComponentConnector
+{
+ public TutorialViewModel ViewModel;
+
+ private bool _buttonClickable;
+
+ internal WindowChrome WindowChrome;
+
+ internal Grid CloseButton;
+
+ internal Grid ProgressRing;
+
+ internal Image ProgressBar;
+
+ internal TextBox NomeBox;
+
+ internal TextBox UserBox;
+
+ internal CustomSenhaLoginBox PasswordBox;
+
+ internal CustomSenhaLoginBox ConfirmacaoBox;
+
+ private bool _contentLoaded;
+
+ private Tuple<bool, bool> PrimeiroAcesso { get; set; }
+
+ public TutorialView(Tuple<bool, bool> primeiroacesso)
+ {
+ //IL_0056: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0060: Expected O, but got Unknown
+ //IL_006d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0077: Expected O, but got Unknown
+ PrimeiroAcesso = primeiroacesso;
+ ViewModel = new TutorialViewModel();
+ ((FrameworkElement)this).DataContext = ViewModel;
+ InitializeComponent();
+ Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
+ if (dispatcher != null)
+ {
+ dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
+ }
+ ((UIElement)CloseButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
+ ((UIElement)CloseButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
+ }
+
+ private async void ContentLoad()
+ {
+ string erro2 = null;
+ Loading(loading: true);
+ if (PrimeiroAcesso.Item1)
+ {
+ await ViewModel.VerificarUsuario();
+ }
+ else
+ {
+ erro2 = await ViewModel.CriarBanco();
+ }
+ Loading(loading: false);
+ if (erro2 != null)
+ {
+ await ViewModel.ShowMessage(erro2);
+ return;
+ }
+ erro2 = await ViewModel.VerificaEmpresa();
+ if (erro2 != null)
+ {
+ await ViewModel.ShowMessage(erro2);
+ return;
+ }
+ ViewModel.Fase1 = true;
+ await ViewModel.IniciarConfiguracoes();
+ }
+
+ protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
+ {
+ //IL_0017: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0025: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002a: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0053: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0058: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0061: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0066: Unknown result type (might be due to invalid IL or missing references)
+ ((FrameworkElement)this).OnRenderSizeChanged(sizeInfo);
+ Size val;
+ if (sizeInfo.HeightChanged)
+ {
+ double top = ((Window)this).Top;
+ val = sizeInfo.PreviousSize;
+ double height = ((Size)(ref val)).Height;
+ val = sizeInfo.NewSize;
+ ((Window)this).Top = top + (height - ((Size)(ref val)).Height) / 2.0;
+ }
+ if (sizeInfo.WidthChanged)
+ {
+ double left = ((Window)this).Left;
+ val = sizeInfo.PreviousSize;
+ double width = ((Size)(ref val)).Width;
+ val = sizeInfo.NewSize;
+ ((Window)this).Left = left + (width - ((Size)(ref val)).Width) / 2.0;
+ }
+ }
+
+ private void TopControls_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ //IL_0008: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0030: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0035: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0024: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0029: Unknown result type (might be due to invalid IL or missing references)
+ //IL_003f: Expected O, but got Unknown
+ _buttonClickable = true;
+ ((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush(Colors.Red) : new SolidColorBrush(Colors.DimGray));
+ }
+
+ private void TopControls_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ //IL_000f: Unknown result type (might be due to invalid IL or missing references)
+ if (_buttonClickable)
+ {
+ ((object)this).GetType().GetMethod(((FrameworkElement)(Grid)sender).Name + "_Click")?.Invoke(this, null);
+ }
+ }
+
+ private static void TopControls_OnMouseEnter(object sender, MouseEventArgs e)
+ {
+ //IL_0001: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0007: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0029: Unknown result type (might be due to invalid IL or missing references)
+ //IL_002e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0022: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0038: Expected O, but got Unknown
+ //IL_0039: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0044: Expected O, but got Unknown
+ //IL_004e: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0053: Unknown result type (might be due to invalid IL or missing references)
+ //IL_005d: Expected O, but got Unknown
+ ((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush(Colors.IndianRed) : new SolidColorBrush(Colors.Gray));
+ DependencyObject child = VisualTreeHelper.GetChild((DependencyObject)(Grid)sender, 0);
+ Path val = (Path)(object)((child is Path) ? child : null);
+ if (val != null)
+ {
+ ((Shape)val).Stroke = (Brush)new SolidColorBrush(Colors.White);
+ }
+ }
+
+ private void TopControls_OnMouseLeave(object sender, MouseEventArgs e)
+ {
+ //IL_0008: Unknown result type (might be due to invalid IL or missing references)
+ //IL_000d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0012: Unknown result type (might be due to invalid IL or missing references)
+ //IL_001c: Expected O, but got Unknown
+ //IL_001d: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0028: Expected O, but got Unknown
+ //IL_0032: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0037: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0041: Expected O, but got Unknown
+ _buttonClickable = false;
+ ((Panel)(Grid)sender).Background = (Brush)new SolidColorBrush(Colors.Transparent);
+ DependencyObject child = VisualTreeHelper.GetChild((DependencyObject)(Grid)sender, 0);
+ Path val = (Path)(object)((child is Path) ? child : null);
+ if (val != null)
+ {
+ ((Shape)val).Stroke = (Brush)new SolidColorBrush(Colors.White);
+ }
+ }
+
+ public void CloseButton_Click()
+ {
+ ((Window)this).Close();
+ }
+
+ private async void ProsseguirFase1_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.EnableFields = false;
+ Loading(loading: true);
+ if (!(await ViewModel.ValidarLogin()))
+ {
+ ((Window)this).Close();
+ }
+ Loading(loading: false);
+ ViewModel.EnableFields = true;
+ }
+
+ private void VoltarFase2_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Fase1 = true;
+ ViewModel.Fase2 = false;
+ }
+
+ private async void ProsseguirFase2_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.EnableFields = false;
+ Loading(loading: true);
+ await ViewModel.ValidarSeguradoras();
+ Loading(loading: false);
+ ViewModel.EnableFields = true;
+ }
+
+ private void VoltarFase3_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Fase2 = true;
+ ViewModel.Fase3 = false;
+ }
+
+ private void DestativarTodosOsRamos_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.DesativarRamos();
+ }
+
+ private void DestativarTodasAsSeguradoras_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.DesativarSeguradoras();
+ }
+
+ private async void Concluir_OnClick(object sender, RoutedEventArgs e)
+ {
+ ViewModel.EnableFields = false;
+ Loading(loading: true);
+ bool num = await ViewModel.Concluir();
+ Loading(loading: false);
+ ViewModel.EnableFields = true;
+ if (!num)
+ {
+ ((Window)this).Close();
+ return;
+ }
+ if (!(await ViewModel.VerificaAcesso()))
+ {
+ ((Window)this).Close();
+ return;
+ }
+ ((Window)new MainWindow()).Show();
+ ((Window)this).Close();
+ }
+
+ private void ConfirmacaoBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ ViewModel.ConfirmacaoSenha = ConfirmacaoBox.Text;
+ }
+
+ private void PasswordBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ ViewModel.Senha = PasswordBox.Text;
+ }
+
+ private void Loading(bool loading)
+ {
+ if (loading)
+ {
+ TutorialViewModel viewModel = ViewModel;
+ TutorialViewModel viewModel2 = ViewModel;
+ bool flag2 = (ViewModel.Fase3 = false);
+ bool fase = (viewModel2.Fase2 = flag2);
+ viewModel.Fase1 = fase;
+ }
+ ViewModel.LoadingVisibility = loading;
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ public void InitializeComponent()
+ {
+ if (!_contentLoaded)
+ {
+ _contentLoaded = true;
+ Uri uri = new Uri("/Gestor.Application;component/views/tutorialview.xaml", UriKind.Relative);
+ Application.LoadComponent((object)this, uri);
+ }
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ internal Delegate _CreateDelegate(Type delegateType, string handler)
+ {
+ return Delegate.CreateDelegate(delegateType, this, handler);
+ }
+
+ [DebuggerNonUserCode]
+ [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ void IComponentConnector.Connect(int connectionId, object target)
+ {
+ //IL_004b: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0055: Expected O, but got Unknown
+ //IL_0058: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0062: Expected O, but got Unknown
+ //IL_006f: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0079: Expected O, but got Unknown
+ //IL_0086: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0090: Expected O, but got Unknown
+ //IL_0093: Unknown result type (might be due to invalid IL or missing references)
+ //IL_009d: Expected O, but got Unknown
+ //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00aa: Expected O, but got Unknown
+ //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00b7: Expected O, but got Unknown
+ //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00c4: Expected O, but got Unknown
+ //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
+ //IL_00f6: Expected O, but got Unknown
+ //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0104: Unknown result type (might be due to invalid IL or missing references)
+ //IL_010e: Expected O, but got Unknown
+ //IL_0110: Unknown result type (might be due to invalid IL or missing references)
+ //IL_011c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0126: Expected O, but got Unknown
+ //IL_0128: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0134: Unknown result type (might be due to invalid IL or missing references)
+ //IL_013e: Expected O, but got Unknown
+ //IL_0140: Unknown result type (might be due to invalid IL or missing references)
+ //IL_014c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0156: Expected O, but got Unknown
+ //IL_0158: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0164: Unknown result type (might be due to invalid IL or missing references)
+ //IL_016e: Expected O, but got Unknown
+ //IL_0170: Unknown result type (might be due to invalid IL or missing references)
+ //IL_017c: Unknown result type (might be due to invalid IL or missing references)
+ //IL_0186: Expected O, but got Unknown
+ switch (connectionId)
+ {
+ case 1:
+ WindowChrome = (WindowChrome)target;
+ break;
+ case 2:
+ CloseButton = (Grid)target;
+ ((UIElement)CloseButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
+ ((UIElement)CloseButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
+ break;
+ case 3:
+ ProgressRing = (Grid)target;
+ break;
+ case 4:
+ ProgressBar = (Image)target;
+ break;
+ case 5:
+ NomeBox = (TextBox)target;
+ break;
+ case 6:
+ UserBox = (TextBox)target;
+ break;
+ case 7:
+ PasswordBox = (CustomSenhaLoginBox)target;
+ break;
+ case 8:
+ ConfirmacaoBox = (CustomSenhaLoginBox)target;
+ break;
+ case 9:
+ ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(ProsseguirFase1_OnClick);
+ break;
+ case 10:
+ ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(DestativarTodasAsSeguradoras_OnClick);
+ break;
+ case 11:
+ ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(VoltarFase2_OnClick);
+ break;
+ case 12:
+ ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(ProsseguirFase2_OnClick);
+ break;
+ case 13:
+ ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(DestativarTodosOsRamos_OnClick);
+ break;
+ case 14:
+ ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(VoltarFase3_OnClick);
+ break;
+ case 15:
+ ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(Concluir_OnClick);
+ break;
+ default:
+ _contentLoaded = true;
+ break;
+ }
+ }
+}