summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Componentes/DialogInstalacoes.cs
blob: 2fc14031716ae2d899fe113d8bed09f3e6d37fe9 (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
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Markup;
using Gestor.Model.License;
using MaterialDesignThemes.Wpf;

namespace Gestor.Application.Componentes;

public class DialogInstalacoes : UserControl, IComponentConnector
{
	internal DataGrid InstalacoesView;

	internal Button ValidarButton;

	internal Button FecharButton;

	internal Snackbar Snackbar;

	private bool _contentLoaded;

	public DialogInstalacoes(List<Instalacao> instalacoes)
	{
		InitializeComponent();
		((ItemsControl)InstalacoesView).ItemsSource = instalacoes.Where((Instalacao i) => !string.IsNullOrEmpty(i.Gerenciador))?.ToList();
		((Selector)InstalacoesView).SelectedIndex = -1;
	}

	private void ValidarButton_OnClick(object sender, RoutedEventArgs e)
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Expected O, but got Unknown
		object selectedItem = ((Selector)InstalacoesView).SelectedItem;
		if (selectedItem == null)
		{
			((ContentControl)Snackbar.Message).Content = "SELECIONE A INSTALAÇÃO A SER SUBSTITUÍDA";
			Snackbar.IsActive = true;
		}
		else
		{
			DialogHost.CloseDialogCommand.Execute((object)(Instalacao)selectedItem, (IInputElement)(object)ValidarButton);
		}
	}

	private void FecharButton_OnClick(object sender, RoutedEventArgs e)
	{
		DialogHost.CloseDialogCommand.Execute((object)null, (IInputElement)(object)FecharButton);
	}

	private void SnackbarMessage_ActionClick(object sender, RoutedEventArgs e)
	{
		((ContentControl)Snackbar.Message).Content = "";
		Snackbar.IsActive = false;
	}

	[DebuggerNonUserCode]
	[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
	public void InitializeComponent()
	{
		if (!_contentLoaded)
		{
			_contentLoaded = true;
			Uri uri = new Uri("/Gestor.Application;component/componentes/dialoginstalacoes.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_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: 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_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Expected O, but got Unknown
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Expected O, but got Unknown
		switch (connectionId)
		{
		case 1:
			InstalacoesView = (DataGrid)target;
			break;
		case 2:
			ValidarButton = (Button)target;
			((ButtonBase)ValidarButton).Click += new RoutedEventHandler(ValidarButton_OnClick);
			break;
		case 3:
			FecharButton = (Button)target;
			((ButtonBase)FecharButton).Click += new RoutedEventHandler(FecharButton_OnClick);
			break;
		case 4:
			Snackbar = (Snackbar)target;
			break;
		case 5:
			((SnackbarMessage)target).ActionClick += new RoutedEventHandler(SnackbarMessage_ActionClick);
			break;
		default:
			_contentLoaded = true;
			break;
		}
	}
}