1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
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;
}
}
}
|