summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Drawers/ArquivoDigitalDrawer.cs
blob: c745586a235b814ebd78885197932c4176c8897f (plain)
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Threading;
using Gestor.Application.Helpers;
using Gestor.Application.ViewModels.Drawer;
using Gestor.Application.Views.Ferramentas;
using Gestor.Application.Views.Generic;
using Gestor.Common.Security;
using Gestor.Common.Validation;
using Gestor.Model.API;
using Gestor.Model.Common;
using Gestor.Model.Domain.Common;
using Gestor.Model.Domain.Generic;
using Gestor.Model.Domain.MalaDireta;
using Gestor.Model.Domain.Seguros;
using Gestor.Model.License;
using MaterialDesignThemes.Wpf;
using Xceed.Wpf.AvalonDock.Controls;

namespace Gestor.Application.Drawers;

public class ArquivoDigitalDrawer : UserControl, IComponentConnector, IStyleConnector
{
	internal ProgressBar ProgressBar;

	internal TextBlock TitleBox;

	internal DataGrid ArquivoGrid;

	internal TextBox DocumentoBox;

	internal Snackbar SnackbarArquivoDigital;

	private bool _contentLoaded;

	public ArquivoDigitalViewModel ViewModel { get; set; }

	private FiltroArquivoDigital Filtro { get; }

	public ArquivoDigitalDrawer(FiltroArquivoDigital filtro)
	{
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		ViewModel = new ArquivoDigitalViewModel(filtro);
		Filtro = filtro;
		((FrameworkElement)this).DataContext = ViewModel;
		InitializeComponent();
		Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
		if (dispatcher != null)
		{
			dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
		}
		ViewModel.RegistrarAcao("ACESSOU ARQUIVO DIGITAL DE " + ((filtro != null) ? ValidationHelper.GetDescription((Enum)(object)filtro.Tipo) : null) + ((filtro == null || filtro.Id != 0) ? $" DO DOCUMENTO DE ID \"{((filtro != null) ? new long?(filtro.Id) : null)}\"" : ""), (filtro != null) ? filtro.Id : 0, (TipoTela)6, "TIPO: " + ((filtro != null) ? ValidationHelper.GetDescription((Enum)(object)filtro.Tipo) : null) + ((filtro == null || filtro.Id != 0) ? $"\nID APÓLICE: {((filtro != null) ? new long?(filtro.Id) : null)}" : ""));
	}

	private void ContentLoad()
	{
		//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
		ArquivoGrid.CellEditEnding += ArquivoGrid_CellEditEnding;
		((UIElement)DocumentoBox).LostFocus += new RoutedEventHandler(DocumentBox_OnLostFocus);
		((UIElement)DocumentoBox).PreviewTextInput += new TextCompositionEventHandler(SomenteNumeros);
	}

	private static void SomenteNumeros(object sender, TextCompositionEventArgs e)
	{
		Regex regex = new Regex("[^0-9]+");
		((RoutedEventArgs)e).Handled = regex.IsMatch(e.Text);
	}

	private static void DocumentBox_OnLostFocus(object sender, RoutedEventArgs e)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		TextBox val = (TextBox)sender;
		if (!(val.Text == string.Empty))
		{
			val.Text = ValidationHelper.FormatDocument(val.Text);
		}
	}

	private void ArquivoGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Invalid comparison between Unknown and I4
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0087: Expected O, but got Unknown
		if ((int)e.EditAction != 1)
		{
			return;
		}
		DataGridColumn column = e.Column;
		DataGridBoundColumn val = (DataGridBoundColumn)(object)((column is DataGridBoundColumn) ? column : null);
		if (val == null)
		{
			return;
		}
		BindingBase binding = val.Binding;
		BindingBase obj = ((binding is Binding) ? binding : null);
		if (((obj != null) ? ((Binding)obj).Path.Path : null) != "Descricao")
		{
			return;
		}
		int index = e.Row.GetIndex();
		FrameworkElement editingElement = e.EditingElement;
		TextBox val2 = (TextBox)(object)((editingElement is TextBox) ? editingElement : null);
		if (val2 != null)
		{
			val2.Text = val2.Text.ToUpper();
			IndiceArquivoDigital val3 = (IndiceArquivoDigital)((ItemsControl)ArquivoGrid).Items[index];
			if (!(val3.Descricao == val2.Text))
			{
				((DomainBase)val3).Initialize();
				val3.Descricao = val2.Text;
				ViewModel.Editar(val3);
			}
		}
	}

	private void Baixar_OnClick(object sender, RoutedEventArgs e)
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Expected O, but got Unknown
		Button val = (Button)((sender is Button) ? sender : null);
		if (val != null)
		{
			DataGrid val2 = Extentions.FindVisualAncestor<DataGrid>((DependencyObject)(object)val);
			IndiceArquivoDigital arquivo = (IndiceArquivoDigital)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
			ViewModel.Baixar(arquivo);
		}
	}

	private async void BaixarTodos_OnClick(object sender, RoutedEventArgs e)
	{
		ViewModel.Activated = false;
		if (await ViewModel.BaixarTodos())
		{
			await ViewModel.ShowMessage("ARQUIVOS BAIXADOS COM SUCESSO!");
		}
		ViewModel.Activated = true;
	}

	private void Abrir_OnClick(object sender, RoutedEventArgs e)
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Expected O, but got Unknown
		Button val = (Button)((sender is Button) ? sender : null);
		if (val != null)
		{
			ViewModel.Activated = false;
			DataGrid val2 = Extentions.FindVisualAncestor<DataGrid>((DependencyObject)(object)val);
			IndiceArquivoDigital arquivo = (IndiceArquivoDigital)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
			ViewModel.Baixar(arquivo, abrir: true);
			ViewModel.Activated = true;
		}
	}

	private async void Excluir_OnClick(object sender, RoutedEventArgs e)
	{
		Button val = (Button)((sender is Button) ? sender : null);
		if (val == null)
		{
			return;
		}
		DataGrid val2 = Extentions.FindVisualAncestor<DataGrid>((DependencyObject)(object)val);
		IndiceArquivoDigital arquivo = (IndiceArquivoDigital)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
		if (arquivo != null)
		{
			ViewModel.VerificarEnables(((DomainBase)arquivo).Id);
			if (!ViewModel.EnableExcluir)
			{
				await ViewModel.ShowMessage("VOCÊ NÃO TEM PERMISSÃO PARA EXCLUIR ARQUIVO DIGITAL DO TIPO " + ValidationHelper.GetDescription((Enum)(object)Filtro.Tipo) + "!");
			}
			else if (arquivo.NaoExcluir)
			{
				await ViewModel.ShowMessage("O ARQUIVO " + arquivo.Descricao + " NÃO PODE SER EXCLUÍDO!");
			}
			else if (await ViewModel.ShowMessage("DESEJA REALMENTE EXCLUIR O ARQUIVO " + arquivo.Descricao, "SIM", "NÃO"))
			{
				await ViewModel.Excluir(arquivo);
			}
		}
	}

	private void CopyTelefoneToClipBoard_Click(object sender, RoutedEventArgs e)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Expected O, but got Unknown
		Button val = (Button)sender;
		ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
		ClienteTelefone val3 = (ClienteTelefone)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
		(((TelefoneBase)val3).Prefixo + ((TelefoneBase)val3).Numero).CopyToClipboard();
		Toggle("COPIADO - " + ((TelefoneBase)val3).Prefixo + ValidationHelper.OnlyNumber(((TelefoneBase)val3).Numero));
	}

	private async void WhatsAppMessage_Click(object sender, RoutedEventArgs e)
	{
		if (ViewModel.Restricao((TipoRestricao)32))
		{
			await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ESSE MENU.");
			return;
		}
		Button val = (Button)sender;
		ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
		ClienteTelefone val3 = (ClienteTelefone)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
		if (!((((TelefoneBase)val3).Tipo.HasValue && (int)((TelefoneBase)val3).Tipo.GetValueOrDefault() == 8) ? (((TelefoneBase)val3).Prefixo + ((TelefoneBase)val3).Numero).Clear() : ("55" + ((TelefoneBase)val3).Prefixo + ((TelefoneBase)val3).Numero.Clear())).EnviarWhatsapp())
		{
			await ViewModel.ShowMessage("HOUVE UM PROBLEMA AO ABRIR LINK DO WHATSAPP, O LINK FOI COPIADO EM SUA MAQUINA, BASTA ABRIR O NAVEGADOR DE INTERNET E COLAR NA BARRA DE ENDEREÇOS");
		}
	}

	private void DeleteArquivo_OnDeleteClick(object sender, RoutedEventArgs e)
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Expected O, but got Unknown
		Chip val = (Chip)((sender is Chip) ? sender : null);
		if (val != null)
		{
			ListBox val2 = Extentions.FindVisualAncestor<ListBox>((DependencyObject)(object)val);
			ArquivoDigital val3 = (ArquivoDigital)((ItemsControl)val2).Items[((CollectionView)((ItemsControl)val2).Items).IndexOf(((FrameworkElement)val).DataContext)];
			if (val3 != null)
			{
				ViewModel.Delete(val3);
			}
		}
	}

	private void AnexarArquivos_OnClick(object sender, RoutedEventArgs e)
	{
		ViewModel.Anexar();
	}

	private async void SalvarAnexos_OnClick(object sender, RoutedEventArgs e)
	{
		await ViewModel.SalvarAnexos();
	}

	private async void EnviarPorWhatsApp_OnClick(object sender, RoutedEventArgs e)
	{
		if (ViewModel.Restricao((TipoRestricao)32))
		{
			await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ACESSAR O WHATSAPP");
			return;
		}
		Button val = (Button)sender;
		if (((FrameworkElement)val).DataContext != null)
		{
			object dataContext = ((FrameworkElement)val).DataContext;
			ClienteTelefone val2 = (ClienteTelefone)((dataContext is ClienteTelefone) ? dataContext : null);
			if (val2 != null && !((((TelefoneBase)val2).Tipo.HasValue && (int)((TelefoneBase)val2).Tipo.GetValueOrDefault() == 8) ? (((TelefoneBase)val2).Prefixo + ((TelefoneBase)val2).Numero).Clear() : ("55" + ((TelefoneBase)val2).Prefixo + ((TelefoneBase)val2).Numero.Clear())).EnviarWhatsapp(ViewModel.Anotacoes))
			{
				await ViewModel.ShowMessage("HOUVE UM PROBLEMA AO ABRIR LINK DO WHATSAPP, O LINK FOI COPIADO EM SUA MAQUINA, BASTA ABRIR O NAVEGADOR DE INTERNET E COLAR NA BARRA DE ENDEREÇOS");
			}
		}
	}

	private void LimparLista_OnClick(object sender, RoutedEventArgs e)
	{
		ViewModel.LimparAnexos();
	}

	private void AlteraEventoEnviarOnClick(MenuItem enviarMenu, bool adiciona = true)
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Expected O, but got Unknown
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Expected O, but got Unknown
		if (adiciona)
		{
			enviarMenu.Click += new RoutedEventHandler(Enviar_OnClick);
		}
		else
		{
			enviarMenu.Click -= new RoutedEventHandler(Enviar_OnClick);
		}
	}

	private async void Enviar_OnClick(object sender, RoutedEventArgs e)
	{
		MenuItem enviarMenu = (MenuItem)sender;
		AlteraEventoEnviarOnClick(enviarMenu, adiciona: false);
		if (ViewModel.Restricao((TipoRestricao)60))
		{
			await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ASSINATURA.\nCONTINUANDO COM O ENVIO APENAS.");
		}
		else if (ViewModel.ArquivosTela.Any((IndiceArquivoDigital x) => x.Assinar))
		{
			if (LicenseHelper.Produtos.All((Licenca x) => (int)x.Produto != 86))
			{
				string arguments = new Token().Encrypt(string.Format("{0}:{1}:{2}:{3}", ApplicationHelper.NumeroSerial, ApplicationHelper.IdFornecedor, ((DomainBase)Recursos.Usuario).Id, ApplicationHelper.Beta ? "1" : "0"));
				((Window)new DownloadWindow(new Parameters
				{
					Beta = ApplicationHelper.Beta,
					Type = 8,
					Application = "Assinador.Application.exe",
					Directory = "Assinador.Application",
					Arguments = arguments,
					Run = true
				})).Show();
				AlteraEventoEnviarOnClick(enviarMenu);
				return;
			}
			if (!(await ViewModel.EnviarParaAssinatura()))
			{
				AlteraEventoEnviarOnClick(enviarMenu);
				return;
			}
		}
		MalaDireta val = await ViewModel.PrepararEnvio();
		if (val == null)
		{
			AlteraEventoEnviarOnClick(enviarMenu);
			return;
		}
		if (Funcoes.IsWindowOpen<HosterWindow>("ENVIO DE E-MAIL"))
		{
			Funcoes.Destroy<HosterWindow>("ENVIO DE E-MAIL");
		}
		((Window)new HosterWindow((ContentControl)(object)new MalaDiretaView(new List<MalaDireta> { val }, ViewModel.Assunto, ViewModel.Corpo, Filtro), "ENVIO DE E-MAIL", 1200.0, 600.0, canMaximize: true)).Show();
		AlteraEventoEnviarOnClick(enviarMenu);
	}

	private void Fechar_OnClick(object sender, RoutedEventArgs e)
	{
		ViewModel.CloseDrawer();
	}

	private void AlteraEventoAssinarOnClick(Button assinarButton, bool adiciona = true)
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Expected O, but got Unknown
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Expected O, but got Unknown
		if (adiciona)
		{
			((ButtonBase)assinarButton).Click += new RoutedEventHandler(Assinar_OnClick);
		}
		else
		{
			((ButtonBase)assinarButton).Click -= new RoutedEventHandler(Assinar_OnClick);
		}
	}

	private async void Assinar_OnClick(object sender, RoutedEventArgs e)
	{
		Button assinarButton = (Button)sender;
		AlteraEventoAssinarOnClick(assinarButton, adiciona: false);
		if (ViewModel.Restricao((TipoRestricao)60))
		{
			await ViewModel.ShowMessage("VOCÊ NÃO POSSUI PERMISSÃO PARA ASSINATURA.");
			AlteraEventoAssinarOnClick(assinarButton);
		}
		else if (LicenseHelper.Produtos.All((Licenca x) => (int)x.Produto != 86))
		{
			string arguments = new Token().Encrypt(string.Format("{0}:{1}:{2}:{3}", ApplicationHelper.NumeroSerial, ApplicationHelper.IdFornecedor, ((DomainBase)Recursos.Usuario).Id, ApplicationHelper.Beta ? "1" : "0"));
			((Window)new DownloadWindow(new Parameters
			{
				Beta = ApplicationHelper.Beta,
				Type = 8,
				Application = "Assinador.Application.exe",
				Directory = "Assinador.Application",
				Arguments = arguments,
				Run = true
			})).Show();
			AlteraEventoAssinarOnClick(assinarButton);
		}
		else
		{
			await ViewModel.EnviarParaAssinatura();
			AlteraEventoAssinarOnClick(assinarButton);
		}
	}

	private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		string text = ((TextBox)sender).Text;
		if (text.Length < 3)
		{
			ViewModel.ArquivosTela = ViewModel.Arquivos;
			return;
		}
		List<IndiceArquivoDigital> list = ViewModel.Arquivos.Where((IndiceArquivoDigital x) => x.Descricao.Contains(text)).ToList();
		if (list.Count > 0)
		{
			ViewModel.ArquivosTela = new ObservableCollection<IndiceArquivoDigital>();
			list.ForEach(delegate(IndiceArquivoDigital x)
			{
				ViewModel.ArquivosTela.Add(x);
			});
		}
		else
		{
			ViewModel.ArquivosTela = new ObservableCollection<IndiceArquivoDigital>();
		}
	}

	private async void PopupBox_OnOpened(object sender, RoutedEventArgs e)
	{
		if (ViewModel.Telefones.Count == 0)
		{
			ViewModel.Telefones.Add(new ClienteTelefone
			{
				Prefixo = Recursos.Empresa.PrimeiroPrefixo,
				Numero = Recursos.Empresa.PrimeiroTelefone
			});
		}
		IndiceArquivoDigital indice = (IndiceArquivoDigital)((FrameworkElement)(PopupBox)sender).DataContext;
		ArquivoDigitalViewModel viewModel = ViewModel;
		viewModel.Anotacoes = await CreateWhatsappMessage(indice);
	}

	private async Task<string> CreateWhatsappMessage(IndiceArquivoDigital indice)
	{
		StringBuilder links = new StringBuilder((await ViewModel.CreateLink(indice)).ToString());
		StringBuilder assinaturas = new StringBuilder(indice.Assinado ? "" : (indice.EnviadoAssinatura ? ("LINK PARA ASSINATURA" + Environment.NewLine + indice.UrlAssinatura + Environment.NewLine + Environment.NewLine) : ""));
		foreach (IndiceArquivoDigital indiceArquivoDigital in ViewModel.Arquivos)
		{
			if (indiceArquivoDigital.Selecionado && indiceArquivoDigital.IdArquivoDigital != indice.IdArquivoDigital)
			{
				if (links.Length > 0)
				{
					links.AppendLine("\r\n");
					assinaturas.AppendLine();
				}
				StringBuilder stringBuilder = links;
				stringBuilder.AppendLine((await ViewModel.CreateLink(indiceArquivoDigital)).ToString());
				assinaturas.AppendLine(indiceArquivoDigital.Assinado ? "" : (indiceArquivoDigital.EnviadoAssinatura ? ("LINK PARA ASSINATURA" + Environment.NewLine + indiceArquivoDigital.UrlAssinatura + Environment.NewLine + Environment.NewLine) : ""));
			}
		}
		return ViewModel.CarregarMensagem().Replace("[*LINK*]", $"LINK(S) PARA BAIXAR O(S) DOCUMENTO(S) (VÁLIDO(S) POR 7 DIAS){Environment.NewLine}{links}").Replace("<|LINKASSINATURA|>", assinaturas.ToString());
	}

	private void CopiarLinkAssinatura_OnClick(object sender, RoutedEventArgs e)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		IndiceArquivoDigital val = (IndiceArquivoDigital)((FrameworkElement)(Button)sender).DataContext;
		if (val != null && !string.IsNullOrWhiteSpace(val.UrlAssinatura))
		{
			val.UrlAssinatura.CopyToClipboard();
			Toggle("LINK COPIADO - " + val.UrlAssinatura);
		}
	}

	private void SnackbarMessage_ActionClick(object sender, RoutedEventArgs e)
	{
		SnackbarArquivoDigital.IsActive = false;
	}

	public void Toggle(string message, bool active = true)
	{
		((ContentControl)SnackbarArquivoDigital.Message).Content = message;
		SnackbarArquivoDigital.IsActive = active;
		if (active)
		{
			Task.Factory.StartNew(CloseSlackBar);
		}
	}

	private void CloseSlackBar()
	{
		Thread.Sleep(5000);
		Dispatcher dispatcher = ((DispatcherObject)App.ProgressRing).Dispatcher;
		if (dispatcher != null)
		{
			dispatcher.BeginInvoke((DispatcherPriority)4, (Delegate)(Action)delegate
			{
				Toggle("", active: false);
			});
		}
	}

	public void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		ScrollViewer val = (ScrollViewer)sender;
		val.ScrollToVerticalOffset(val.VerticalOffset - (double)e.Delta);
		((RoutedEventArgs)e).Handled = true;
	}

	private void Log_OnClick(object sender, RoutedEventArgs e)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		Button val = (Button)((sender is Button) ? sender : null);
		if (val != null)
		{
			IndiceArquivoDigital val2 = (IndiceArquivoDigital)((FrameworkElement)val).DataContext;
			if (val2 != null && ((DomainBase)val2).Id != 0L)
			{
				ViewModel.AbrirLog((TipoTela)6, ((DomainBase)val2).Id);
			}
		}
	}

	[DebuggerNonUserCode]
	[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
	public void InitializeComponent()
	{
		if (!_contentLoaded)
		{
			_contentLoaded = true;
			Uri uri = new Uri("/Gestor.Application;component/drawers/arquivodigitaldrawer.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_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Expected O, but got Unknown
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Expected O, but got Unknown
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Expected O, but got Unknown
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Expected O, but got Unknown
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Expected O, but got Unknown
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Expected O, but got Unknown
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f7: Expected O, but got Unknown
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Expected O, but got Unknown
		//IL_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Expected O, but got Unknown
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_0142: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Expected O, but got Unknown
		//IL_014e: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Expected O, but got Unknown
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Expected O, but got Unknown
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Expected O, but got Unknown
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a1: Expected O, but got Unknown
		switch (connectionId)
		{
		case 1:
			((UIElement)(ScrollViewer)target).PreviewMouseWheel += new MouseWheelEventHandler(ScrollViewer_PreviewMouseWheel);
			break;
		case 2:
			ProgressBar = (ProgressBar)target;
			break;
		case 3:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(Fechar_OnClick);
			break;
		case 4:
			TitleBox = (TextBlock)target;
			break;
		case 7:
			((TextBoxBase)(TextBox)target).TextChanged += new TextChangedEventHandler(TextBoxBase_OnTextChanged);
			break;
		case 8:
			ArquivoGrid = (DataGrid)target;
			break;
		case 16:
			((MenuItem)target).Click += new RoutedEventHandler(AnexarArquivos_OnClick);
			break;
		case 17:
			((MenuItem)target).Click += new RoutedEventHandler(BaixarTodos_OnClick);
			break;
		case 18:
			((MenuItem)target).Click += new RoutedEventHandler(Enviar_OnClick);
			break;
		case 19:
			DocumentoBox = (TextBox)target;
			break;
		case 20:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(Assinar_OnClick);
			break;
		case 22:
			((MenuItem)target).Click += new RoutedEventHandler(SalvarAnexos_OnClick);
			break;
		case 23:
			((MenuItem)target).Click += new RoutedEventHandler(LimparLista_OnClick);
			break;
		case 24:
			SnackbarArquivoDigital = (Snackbar)target;
			break;
		case 25:
			((SnackbarMessage)target).ActionClick += new RoutedEventHandler(SnackbarMessage_ActionClick);
			break;
		default:
			_contentLoaded = true;
			break;
		}
	}

	[DebuggerNonUserCode]
	[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
	[EditorBrowsable(EditorBrowsableState.Never)]
	void IStyleConnector.Connect(int connectionId, object target)
	{
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Expected O, but got Unknown
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Expected O, but got Unknown
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Expected O, but got Unknown
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Expected O, but got Unknown
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Expected O, but got Unknown
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Expected O, but got Unknown
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Expected O, but got Unknown
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Expected O, but got Unknown
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Expected O, but got Unknown
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Expected O, but got Unknown
		switch (connectionId)
		{
		case 5:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(CopyTelefoneToClipBoard_Click);
			break;
		case 6:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(WhatsAppMessage_Click);
			break;
		case 9:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(CopiarLinkAssinatura_OnClick);
			break;
		case 10:
			((PopupBox)target).Opened += new RoutedEventHandler(PopupBox_OnOpened);
			break;
		case 11:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(EnviarPorWhatsApp_OnClick);
			break;
		case 12:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(Abrir_OnClick);
			break;
		case 13:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(Baixar_OnClick);
			break;
		case 14:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(Log_OnClick);
			break;
		case 15:
			((ButtonBase)(Button)target).Click += new RoutedEventHandler(Excluir_OnClick);
			break;
		case 21:
			((Chip)target).DeleteClick += new RoutedEventHandler(DeleteArquivo_OnDeleteClick);
			break;
		case 7:
		case 8:
		case 16:
		case 17:
		case 18:
		case 19:
		case 20:
			break;
		}
	}
}