diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
| commit | 225aa1499e37faf9d38257caabbadc68d78b427e (patch) | |
| tree | 102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Views | |
| parent | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff) | |
| download | gestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip | |
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views')
| -rw-r--r-- | Decompiler/Gestor.Application.Views/ConnectionRetryView.cs | 267 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views/ImportView.cs | 72 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views/LoginWindow.cs | 752 | ||||
| -rw-r--r-- | Decompiler/Gestor.Application.Views/TutorialView.cs | 395 |
4 files changed, 1486 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views/ConnectionRetryView.cs b/Decompiler/Gestor.Application.Views/ConnectionRetryView.cs new file mode 100644 index 0000000..b76f86c --- /dev/null +++ b/Decompiler/Gestor.Application.Views/ConnectionRetryView.cs @@ -0,0 +1,267 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Threading.Tasks; +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 Gestor.Application.Helpers; +using Gestor.Infrastructure.UnitOfWork.Generic; +using Gestor.Infrastructure.UnitOfWork.Logic; + +namespace Gestor.Application.Views; + +public class ConnectionRetryView : Window, IComponentConnector +{ + public TaskCompletionSource<object> CloseTask = new TaskCompletionSource<object>(); + + private bool _buttonClickable; + + internal WindowChrome WindowChrome; + + internal Grid MinimizeButton; + + internal Grid CloseButton; + + internal ProgressBar ProgressRing; + + internal ItemsControl Controls; + + private bool _contentLoaded; + + public UnitOfWork UnitOfWOrk { get; set; } + + public ConnectionRetryView() + { + //IL_0024: Unknown result type (might be due to invalid IL or missing references) + //IL_002e: Expected O, but got Unknown + //IL_003b: Unknown result type (might be due to invalid IL or missing references) + //IL_0045: Expected O, but got Unknown + //IL_0052: Unknown result type (might be due to invalid IL or missing references) + //IL_005c: Expected O, but got Unknown + //IL_0069: Unknown result type (might be due to invalid IL or missing references) + //IL_0073: Expected O, but got Unknown + InitializeComponent(); + ((UIElement)MinimizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter); + ((UIElement)MinimizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave); + ((UIElement)CloseButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter); + ((UIElement)CloseButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave); + ((Window)this).Closed += delegate + { + CloseTask.SetResult(null); + }; + } + + private void TopControls_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + //IL_0008: Unknown result type (might be due to invalid IL or missing references) + //IL_0063: Unknown result type (might be due to invalid IL or missing references) + //IL_0068: Unknown result type (might be due to invalid IL or missing references) + //IL_006d: Unknown result type (might be due to invalid IL or missing references) + //IL_0077: Expected O, but got Unknown + //IL_001f: Unknown result type (might be due to invalid IL or missing references) + //IL_002d: Unknown result type (might be due to invalid IL or missing references) + //IL_0032: Unknown result type (might be due to invalid IL or missing references) + //IL_003c: Expected O, but got Unknown + //IL_003d: Unknown result type (might be due to invalid IL or missing references) + //IL_0048: Expected O, but got Unknown + //IL_0052: Unknown result type (might be due to invalid IL or missing references) + //IL_0057: Unknown result type (might be due to invalid IL or missing references) + //IL_0061: Expected O, but got Unknown + _buttonClickable = true; + if (((FrameworkElement)(Grid)sender).Name == "CloseButton") + { + ((Panel)(Grid)sender).Background = (Brush)new SolidColorBrush(Color.FromRgb((byte)241, (byte)112, (byte)123)); + 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.Black); + } + } + else + { + ((Panel)(Grid)sender).Background = (Brush)new SolidColorBrush(Colors.Blue); + } + } + + 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_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_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_0041: Expected O, but got Unknown + //IL_0042: Unknown result type (might be due to invalid IL or missing references) + //IL_004d: Expected O, but got Unknown + //IL_0057: Unknown result type (might be due to invalid IL or missing references) + //IL_005c: Unknown result type (might be due to invalid IL or missing references) + //IL_0066: Expected O, but got Unknown + ((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush(Color.FromRgb((byte)232, (byte)17, (byte)35)) : new SolidColorBrush(Colors.Blue)); + 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 MinimizeButton_Click() + { + ((Window)this).WindowState = (WindowState)1; + } + + public void CloseButton_Click() + { + ((Window)this).Close(); + } + + private void Loading(bool isLoading) + { + ((UIElement)Controls).Visibility = (Visibility)(isLoading ? 2 : 0); + ((UIElement)ProgressRing).Visibility = (Visibility)((!isLoading) ? 2 : 0); + ((UIElement)this).IsEnabled = !isLoading; + } + + private async void btnRetry_Click(object sender, RoutedEventArgs e) + { + Loading(isLoading: true); + UnitOfWork val = await Task.Run((Func<UnitOfWork>)delegate + { + //IL_001a: Unknown result type (might be due to invalid IL or missing references) + //IL_0020: Expected O, but got Unknown + try + { + Instancia.Conexao = Instancia.Conexao ?? Connection.GetConnection(); + return new UnitOfWork(Instancia.Conexao, true); + } + catch (Exception) + { + return (UnitOfWork)null; + } + }); + Loading(isLoading: false); + if (val != null && ((GenericUnitOfWork)val).HasSession) + { + UnitOfWOrk = val; + ((Window)this).Close(); + } + } + + private void btnRestart_OnClick(object sender, RoutedEventArgs e) + { + Instancia.App.Restart(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/connectionretryview.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_002b: Unknown result type (might be due to invalid IL or missing references) + //IL_0035: Expected O, but got Unknown + //IL_0038: Unknown result type (might be due to invalid IL or missing references) + //IL_0042: Expected O, but got Unknown + //IL_004f: Unknown result type (might be due to invalid IL or missing references) + //IL_0059: Expected O, but got Unknown + //IL_0066: Unknown result type (might be due to invalid IL or missing references) + //IL_0070: Expected O, but got Unknown + //IL_0073: Unknown result type (might be due to invalid IL or missing references) + //IL_007d: Expected O, but got Unknown + //IL_008a: Unknown result type (might be due to invalid IL or missing references) + //IL_0094: Expected O, but got Unknown + //IL_00a1: Unknown result type (might be due to invalid IL or missing references) + //IL_00ab: Expected O, but got Unknown + //IL_00ae: Unknown result type (might be due to invalid IL or missing references) + //IL_00b8: Expected O, but got Unknown + //IL_00bb: Unknown result type (might be due to invalid IL or missing references) + //IL_00c5: Expected O, but got Unknown + //IL_00c7: Unknown result type (might be due to invalid IL or missing references) + //IL_00d3: Unknown result type (might be due to invalid IL or missing references) + //IL_00dd: Expected O, but got Unknown + //IL_00df: Unknown result type (might be due to invalid IL or missing references) + //IL_00eb: Unknown result type (might be due to invalid IL or missing references) + //IL_00f5: Expected O, but got Unknown + switch (connectionId) + { + case 1: + WindowChrome = (WindowChrome)target; + break; + case 2: + MinimizeButton = (Grid)target; + ((UIElement)MinimizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown); + ((UIElement)MinimizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp); + break; + case 3: + CloseButton = (Grid)target; + ((UIElement)CloseButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown); + ((UIElement)CloseButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp); + break; + case 4: + ProgressRing = (ProgressBar)target; + break; + case 5: + Controls = (ItemsControl)target; + break; + case 6: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(btnRetry_Click); + break; + case 7: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(btnRestart_OnClick); + break; + default: + _contentLoaded = true; + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views/ImportView.cs b/Decompiler/Gestor.Application.Views/ImportView.cs new file mode 100644 index 0000000..c9d8cf4 --- /dev/null +++ b/Decompiler/Gestor.Application.Views/ImportView.cs @@ -0,0 +1,72 @@ +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.ViewModels; + +namespace Gestor.Application.Views; + +public class ImportView : UserControl, IComponentConnector +{ + private bool _contentLoaded; + + private ImportViewModel ViewModel { get; } + + public ImportView() + { + ViewModel = new ImportViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + } + + private void ButtonBase_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.Importar(); + } + + private void ButtonBase2_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.CarregarArquivos(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/importview.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_000b: Unknown result type (might be due to invalid IL or missing references) + //IL_0017: Unknown result type (might be due to invalid IL or missing references) + //IL_0021: Expected O, but got Unknown + //IL_0023: Unknown result type (might be due to invalid IL or missing references) + //IL_002f: Unknown result type (might be due to invalid IL or missing references) + //IL_0039: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ButtonBase2_OnClick); + break; + case 2: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ButtonBase_OnClick); + break; + default: + _contentLoaded = true; + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views/LoginWindow.cs b/Decompiler/Gestor.Application.Views/LoginWindow.cs new file mode 100644 index 0000000..297c643 --- /dev/null +++ b/Decompiler/Gestor.Application.Views/LoginWindow.cs @@ -0,0 +1,752 @@ +using System; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Sockets; +using System.Threading.Tasks; +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.Threading; +using Agger.Registro; +using Gestor.Application.Componentes; +using Gestor.Application.Helpers; +using Gestor.Application.Servicos.Ajuda; +using Gestor.Application.Servicos.Generic; +using Gestor.Application.ViewModels; +using Gestor.Application.Views.Ferramentas; +using Gestor.Infrastructure.UnitOfWork.Generic; +using Gestor.Infrastructure.UnitOfWork.Logic; +using Gestor.Model.API; +using Gestor.Model.Common; +using Gestor.Model.Domain.Common; +using Gestor.Model.Domain.Generic; +using Gestor.Model.License; +using Newtonsoft.Json.Linq; + +namespace Gestor.Application.Views; + +public class LoginWindow : Window, IComponentConnector +{ + internal LoginViewModel ViewModel; + + private bool _buttonClickable; + + private DispatcherTimer _carouselTimer; + + internal Image ProgressRing; + + internal TextBox UserBox; + + internal CustomSenhaLoginBox PasswordBox; + + internal TextBlock TrocaSenha; + + internal CustomSenhaLoginBox SenhaBox; + + internal CustomSenhaLoginBox ConfirmacaoBox; + + internal TextBox ChaveBox; + + internal Grid MinimizeButton; + + internal Grid CloseButton; + + private bool _contentLoaded; + + public bool Bloquear { get; set; } + + private JArray LoginSettings { get; set; } + + public LoginWindow() + { + //IL_003a: Unknown result type (might be due to invalid IL or missing references) + //IL_0044: 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_007f: Unknown result type (might be due to invalid IL or missing references) + //IL_0089: Expected O, but got Unknown + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + ViewModel = new LoginViewModel(); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + ((UIElement)MinimizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter); + ((UIElement)MinimizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave); + ((UIElement)CloseButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter); + ((UIElement)CloseButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave); + ViewModel.Head = "AGGER GESTOR " + ViewModel.Version + " - AGUARDE ESTAMOS INICIALIZANDO"; + } + + 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.DarkGoldenrod) : 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_003d: Unknown result type (might be due to invalid IL or missing references) + //IL_0042: 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_004c: Expected O, but got Unknown + //IL_004d: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Expected O, but got Unknown + //IL_0062: Unknown result type (might be due to invalid IL or missing references) + //IL_0067: Unknown result type (might be due to invalid IL or missing references) + //IL_0071: Expected O, but got Unknown + ((Panel)(Grid)sender).Background = (Brush)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush((Color)Application.Current.Resources[(object)"AggerYellow100"]) : 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_0033: Unknown result type (might be due to invalid IL or missing references) + //IL_0069: Unknown result type (might be due to invalid IL or missing references) + //IL_006e: Unknown result type (might be due to invalid IL or missing references) + //IL_0049: Unknown result type (might be due to invalid IL or missing references) + //IL_004e: Unknown result type (might be due to invalid IL or missing references) + //IL_0078: 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)((((FrameworkElement)(Grid)sender).Name == "CloseButton") ? new SolidColorBrush((Color)Application.Current.Resources[(object)"AggerYellow100"]) : new SolidColorBrush(Colors.DimGray)); + } + } + + public void MinimizeButton_Click() + { + ((Window)this).WindowState = (WindowState)1; + } + + public void CloseButton_Click() + { + ((Window)this).Close(); + } + + private void Loading(bool isLoading) + { + ViewModel.EnableFields = !isLoading; + ViewModel.LoadingVisibility = isLoading; + ViewModel.FieldsVisibility = !isLoading; + ((UIElement)this).IsEnabled = !isLoading; + } + + private async void LoginWindow_OnLoaded(object sender, RoutedEventArgs e) + { + Loading(isLoading: true); + await ViewModel.GetCfgJson(); + await SearchImage(); + ViewModel.EnableButtons = false; + LicenseHelper license = new LicenseHelper(); + bool registro = await license.VerificarRegistro(); + if (!registro) + { + string key = await license.FindKey(); + bool flag = false; + if (key != null) + { + await license.Registrar(key); + flag = true; + } + if (key == null && !string.IsNullOrWhiteSpace(Recursos.Registrar)) + { + await license.Registrar(Recursos.Registrar); + flag = true; + } + if (flag) + { + registro = await license.VerificarRegistro(); + } + } + if (registro) + { + Tuple<bool, string> tuple = await license.VerificarAcesso(); + if (!tuple.Item1) + { + Loading(isLoading: false); + ViewModel.AcessoNegado(tuple.Item2); + return; + } + ConnectionHelper connectionHelper = new ConnectionHelper(); + Tuple<bool, bool> tuple2 = await connectionHelper.PrimeiroAcesso(); + if (Connection.ConnectionAddress == null || Connection.ConnectionAddress.Type == 4) + { + Loading(isLoading: false); + ViewModel.AcessoNegado("Erro de conexão com Banco Gestor.\nEntre em contato com Suporte!"); + } + else if (tuple2.Item1 && tuple2.Item2) + { + Tuple<bool, string> tuple3 = await license.VerificarVersao(); + if (!tuple3.Item1) + { + Loading(isLoading: false); + ViewModel.AcessoNegado(tuple3.Item2); + return; + } + Task.Run(delegate + { + try + { + if (!connectionHelper.BDConvertido()) + { + new BaseServico().BuscarEmpresa(1L); + } + } + catch + { + } + }); + Loading(isLoading: false); + if (string.IsNullOrWhiteSpace(UserBox.Text)) + { + ((UIElement)UserBox).Focus(); + } + else + { + ((UIElement)PasswordBox.PasswordBox).Focus(); + } + ViewModel.EnableButtons = true; + string result = Connection.Get<string>("Customer/Name/" + ApplicationHelper.NumeroSerial).Result; + ViewModel.Head = result; + } + else + { + ((Window)new TutorialView(tuple2)).Show(); + ((Window)this).Close(); + } + } + else + { + Loading(isLoading: false); + ViewModel.AbrirRegistro(); + ViewModel.EnableButtons = true; + } + } + + private async Task SearchImage() + { + try + { + HttpClient client = new HttpClient(); + try + { + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; + client.Timeout = TimeSpan.FromSeconds(30.0); + LoginSettings = JArray.Parse(await client.GetStringAsync(Address.LoginJsonV2)); + DateTime now = DateTime.Now; + foreach (JToken item in ((IEnumerable<JToken>)LoginSettings).Where(delegate(JToken x) + { + JToken obj2 = x[(object)"Ativo"]; + if (obj2 == null || !Extensions.Value<bool>((IEnumerable<JToken>)obj2)) + { + return false; + } + JToken obj3 = x[(object)"Produto"]; + List<int> list = ((obj3 != null) ? obj3.Values<int>().ToList() : null); + if (list == null || !list.Any((int p) => p == 0 || p == 3)) + { + return false; + } + DateTime result; + bool flag = DateTime.TryParse(((object)x[(object)"Inicio"])?.ToString(), out result); + DateTime result2; + bool flag2 = DateTime.TryParse(((object)x[(object)"Fim"])?.ToString(), out result2); + if (flag && flag2) + { + if (now >= result) + { + return now <= result2; + } + return false; + } + if (flag) + { + return now >= result; + } + return !flag2 || now <= result2; + })) + { + ViewModel.LoginImages.Add(new LoginImageModel + { + Imagem = ((object)item[(object)"Imagem"])?.ToString(), + UrlFixa = ((object)item[(object)"UrlFixa"])?.ToString() + }); + } + ViewModel.SelectedImage = ViewModel.LoginImages.FirstOrDefault(); + ((DispatcherObject)this).Dispatcher.Invoke((Action)StartCarousel); + } + finally + { + ((IDisposable)client)?.Dispose(); + } + } + catch + { + } + } + + private void StartCarousel() + { + //IL_0015: Unknown result type (might be due to invalid IL or missing references) + //IL_001a: Unknown result type (might be due to invalid IL or missing references) + //IL_0033: Expected O, but got Unknown + if (ViewModel.LoginImages.Count > 1) + { + _carouselTimer = new DispatcherTimer + { + Interval = TimeSpan.FromSeconds(10.0) + }; + _carouselTimer.Tick += delegate + { + int index = (ViewModel.LoginImages.IndexOf(ViewModel.SelectedImage) + 1) % ViewModel.LoginImages.Count; + ViewModel.SelectedImage = ViewModel.LoginImages[index]; + }; + _carouselTimer.Start(); + } + } + + private async Task<bool> VerificarAcesso() + { + LicenseHelper license = new LicenseHelper(); + Tuple<bool, string> tuple = await license.VerificarAcesso(); + if (!tuple.Item1) + { + Loading(isLoading: false); + ViewModel.AcessoNegado(tuple.Item2); + return true; + } + if (!ViewModel.Login.Contains("AGGER@")) + { + bool registrar = false; + if (!(await license.VerificarMaquina())) + { + Loading(isLoading: false); + while (!registrar) + { + List<Instalacao> licencas = await license.GetInstalacoes(); + if (licencas.Count == 0) + { + ViewModel.AcessoNegado("ACESSO NEGADO, NÃO EXISTEM LICENÇAS VÁLIDAS."); + return true; + } + Instalacao instalacaoUsuario = ((IEnumerable<Instalacao>)licencas.OrderByDescending((Instalacao x) => x.UltimoAcesso)).FirstOrDefault((Func<Instalacao, bool>)((Instalacao x) => x.UsuarioId == ((DomainBase)Recursos.Usuario).Id)); + bool flag = instalacaoUsuario != null; + if (flag) + { + flag = await ViewModel.ShowMessage("SEU ULTIMO ACESSO FOI NA MAQUINA " + instalacaoUsuario.NomeMaquina + ". DESEJA SUBSTITUIR A LICENÇA PARA ESSA MAQUINA?", "SIM", "NÃO"); + } + Instalacao val = ((!flag) ? (await ViewModel.ShowInstalacoes(licencas)) : instalacaoUsuario); + Instalacao val2 = val; + if (val2 == null) + { + ViewModel.AcessoNegado("MÁQUINA NÃO REGISTRADA"); + return true; + } + Loading(isLoading: true); + await new AjudaServico().ExcluirInstalacao(((DomainBase)val2).Id); + await Task.Delay(15000); + registrar = await license.VerificarMaquina(); + Loading(isLoading: false); + } + } + } + Tuple<bool, string> tuple2 = await license.VerificarVersao(); + if (!tuple2.Item1) + { + Loading(isLoading: false); + ViewModel.AcessoNegado(tuple2.Item2); + return true; + } + string text = await new ConnectionHelper().AtualizarBanco(); + if (text != null) + { + await ViewModel.ShowMessage(text); + return false; + } + if (!(await ViewModel.Load())) + { + ((Window)this).Close(); + } + return false; + } + + private async void Acessar_Click(object sender, RoutedEventArgs e) + { + ((ButtonBase)(RepeatButton)sender).Click -= new RoutedEventHandler(Acessar_Click); + await Access(); + ((ButtonBase)(RepeatButton)sender).Click += new RoutedEventHandler(Acessar_Click); + } + + private async void PasswordBox_OnKeyDown(object sender, KeyEventArgs e) + { + if ((int)e.Key == 6) + { + await Access(); + } + } + + private async Task Access(bool error = true) + { + if (string.IsNullOrEmpty(ViewModel.Login) || string.IsNullOrEmpty(ViewModel.Senha)) + { + if (error) + { + ViewModel.ErrorLoginVisibility = (Visibility)0; + } + ((UIElement)UserBox).Focus(); + return; + } + Loading(isLoading: true); + if (!(await ViewModel.Validate(ViewModel.Login, ViewModel.Senha))) + { + Loading(isLoading: false); + ((UIElement)UserBox).Focus(); + return; + } + bool flag = Bloquear; + if (!flag) + { + flag = await VerificarAcesso(); + } + Bloquear = flag; + if (Bloquear) + { + return; + } + DateTime networkTime = Funcoes.GetNetworkTime(); + if (((DomainBase)Recursos.Usuario).Id > 0) + { + RegistroLog keyValues = new RegistroLog + { + Acao = (TipoAcao)0, + Usuario = Recursos.Usuario, + DataHora = networkTime, + Descricao = $"O USUÁRIO {Recursos.Usuario.Nome} LOGOU NO SISTEMA, EM {networkTime}.", + EntidadeId = ((DomainBase)Recursos.Usuario).Id, + Tela = (TipoTela)49, + Versao = LoginViewModel.VersaoAtual, + NomeMaquina = Environment.MachineName, + UsuarioMaquina = Environment.UserName, + Ip = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault((IPAddress ip) => ip.AddressFamily == AddressFamily.InterNetwork)?.ToString() + }; + UnitOfWork commited = Instancia.Commited; + try + { + new BaseServico().SaveLog(keyValues, commited); + ((GenericUnitOfWork)commited).Commit(); + } + finally + { + ((IDisposable)commited)?.Dispose(); + } + } + ((Window)new DownloadWindow(new Parameters + { + Beta = ApplicationHelper.Beta, + Type = 7, + Application = "Agger.Gestor.exe", + Directory = "", + Run = false + })).Show(); + ((Window)new MainWindow()).Show(); + ((Window)this).Close(); + } + + private async void Registrar_OnClick(object sender, RoutedEventArgs e) + { + Loading(isLoading: true); + LicenseHelper license = new LicenseHelper(); + string text = await license.Registrar(ViewModel.Chave); + if (text == "false") + { + await ViewModel.ShowMessage("CHAVE INVÁLIDA"); + Loading(isLoading: false); + ViewModel.AbrirRegistro(); + return; + } + if (text == "root") + { + await ViewModel.ShowMessage("CHAVE JÁ REGISTRADA ANTERIORMENTE."); + } + ViewModel.FecharRegistro(); + string result = Connection.Get<string>("Customer/Name/" + ApplicationHelper.NumeroSerial).Result; + ViewModel.Head = result; + Tuple<bool, string> tuple = await license.VerificarAcesso(); + if (!tuple.Item1) + { + Loading(isLoading: false); + ViewModel.AcessoNegado(tuple.Item2); + return; + } + Tuple<bool, bool> tuple2 = await new ConnectionHelper().PrimeiroAcesso(); + if (!tuple2.Item1 || !tuple2.Item2) + { + ((Window)new TutorialView(tuple2)).Show(); + ((Window)this).Close(); + } + else + { + Loading(isLoading: false); + await Access(error: false); + } + } + + private async void TrocarSenha_OnPreviewMouseDown(object sender, MouseButtonEventArgs e) + { + Loading(isLoading: true); + await ViewModel.AbrirTrocaSenha(); + Loading(isLoading: false); + } + + private async void TrocarSenha_OnClick(object sender, RoutedEventArgs e) + { + Loading(isLoading: true); + bool num = await ViewModel.TrocaSenha(); + Loading(isLoading: false); + if (num) + { + await Access(); + } + } + + private void CancelarTrocaSenha_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.TrocaSenhaVisibility = (Visibility)2; + ViewModel.LoginVisibility = (Visibility)0; + } + + private void NovoPerfil_OnPreviewMouseDown(object sender, MouseButtonEventArgs e) + { + ViewModel.AbrirRegistro(); + ViewModel.EnableButtons = true; + } + + private void CancelarRegistro(object sender, RoutedEventArgs e) + { + ViewModel.FecharRegistro(); + } + + private void LinkImage_MouseDown(object sender, MouseButtonEventArgs e) + { + Process.Start(new ProcessStartInfo + { + FileName = ViewModel.ImagemLink, + UseShellExecute = true + }); + } + + private void CentralAtendimento_OnPreviewMouseDown(object sender, MouseButtonEventArgs e) + { + Process.Start(new ProcessStartInfo + { + FileName = ViewModel.CentralAtendimento, + UseShellExecute = true + }); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/loginwindow.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_005e: Unknown result type (might be due to invalid IL or missing references) + //IL_0068: Expected O, but got Unknown + //IL_006b: Unknown result type (might be due to invalid IL or missing references) + //IL_0075: Expected O, but got Unknown + //IL_0078: Unknown result type (might be due to invalid IL or missing references) + //IL_0082: Expected O, but got Unknown + //IL_0092: Unknown result type (might be due to invalid IL or missing references) + //IL_009c: Expected O, but got Unknown + //IL_00a9: Unknown result type (might be due to invalid IL or missing references) + //IL_00b3: Expected O, but got Unknown + //IL_00b5: Unknown result type (might be due to invalid IL or missing references) + //IL_00c1: Unknown result type (might be due to invalid IL or missing references) + //IL_00cb: Expected O, but got Unknown + //IL_00cd: Unknown result type (might be due to invalid IL or missing references) + //IL_00d9: Unknown result type (might be due to invalid IL or missing references) + //IL_00e3: Expected O, but got Unknown + //IL_00ff: Unknown result type (might be due to invalid IL or missing references) + //IL_010b: Unknown result type (might be due to invalid IL or missing references) + //IL_0115: Expected O, but got Unknown + //IL_0117: Unknown result type (might be due to invalid IL or missing references) + //IL_0123: Unknown result type (might be due to invalid IL or missing references) + //IL_012d: Expected O, but got Unknown + //IL_012f: Unknown result type (might be due to invalid IL or missing references) + //IL_013b: Unknown result type (might be due to invalid IL or missing references) + //IL_0145: Expected O, but got Unknown + //IL_0148: Unknown result type (might be due to invalid IL or missing references) + //IL_0152: Expected O, but got Unknown + //IL_0154: Unknown result type (might be due to invalid IL or missing references) + //IL_0160: Unknown result type (might be due to invalid IL or missing references) + //IL_016a: Expected O, but got Unknown + //IL_016c: Unknown result type (might be due to invalid IL or missing references) + //IL_0178: Unknown result type (might be due to invalid IL or missing references) + //IL_0182: Expected O, but got Unknown + //IL_0185: Unknown result type (might be due to invalid IL or missing references) + //IL_018f: Expected O, but got Unknown + //IL_019c: Unknown result type (might be due to invalid IL or missing references) + //IL_01a6: Expected O, but got Unknown + //IL_01b3: Unknown result type (might be due to invalid IL or missing references) + //IL_01bd: Expected O, but got Unknown + //IL_01c0: Unknown result type (might be due to invalid IL or missing references) + //IL_01ca: Expected O, but got Unknown + //IL_01d7: Unknown result type (might be due to invalid IL or missing references) + //IL_01e1: Expected O, but got Unknown + //IL_01ee: Unknown result type (might be due to invalid IL or missing references) + //IL_01f8: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ((FrameworkElement)(LoginWindow)target).Loaded += new RoutedEventHandler(LoginWindow_OnLoaded); + break; + case 2: + ProgressRing = (Image)target; + break; + case 3: + UserBox = (TextBox)target; + break; + case 4: + PasswordBox = (CustomSenhaLoginBox)target; + break; + case 5: + TrocaSenha = (TextBlock)target; + ((UIElement)TrocaSenha).PreviewMouseDown += new MouseButtonEventHandler(TrocarSenha_OnPreviewMouseDown); + break; + case 6: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(Acessar_Click); + break; + case 7: + ((UIElement)(TextBlock)target).PreviewMouseDown += new MouseButtonEventHandler(NovoPerfil_OnPreviewMouseDown); + break; + case 8: + SenhaBox = (CustomSenhaLoginBox)target; + break; + case 9: + ConfirmacaoBox = (CustomSenhaLoginBox)target; + break; + case 10: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(CancelarTrocaSenha_OnClick); + break; + case 11: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(TrocarSenha_OnClick); + break; + case 12: + ((UIElement)(TextBlock)target).PreviewMouseDown += new MouseButtonEventHandler(CentralAtendimento_OnPreviewMouseDown); + break; + case 13: + ChaveBox = (TextBox)target; + break; + case 14: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(CancelarRegistro); + break; + case 15: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(Registrar_OnClick); + break; + case 16: + MinimizeButton = (Grid)target; + ((UIElement)MinimizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown); + ((UIElement)MinimizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp); + break; + case 17: + CloseButton = (Grid)target; + ((UIElement)CloseButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown); + ((UIElement)CloseButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp); + break; + default: + _contentLoaded = true; + break; + } + } +} 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; + } + } +} |