summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs
blob: 0c208ade92f7afe7d25acded77ca0a45d3261854 (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
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
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.ViewModels.Ferramentas;
using Gestor.Model.API;

namespace Gestor.Application.Views.Ferramentas;

public class DownloadWindow : Window, IComponentConnector
{
	internal DownloadViewModel ViewModel;

	private bool _buttonClickable;

	internal WindowChrome WindowChrome;

	internal Grid MinimizeButton;

	internal Grid MaximizeButton;

	internal Grid CloseButton;

	private bool _contentLoaded;

	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 MinimizeButton_Click()
	{
		((Window)this).WindowState = (WindowState)1;
	}

	public void CloseButton_Click()
	{
		((Window)this).Close();
	}

	public DownloadWindow(Parameters parameters)
	{
		ViewModel = new DownloadViewModel(parameters);
		((FrameworkElement)this).DataContext = ViewModel;
		InitializeComponent();
		Dispatcher dispatcher = ((DispatcherObject)this).Dispatcher;
		if (dispatcher != null)
		{
			dispatcher.BeginInvoke((DispatcherPriority)7, (Delegate)new Action(ContentLoad));
		}
	}

	private void ContentLoad()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		//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
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Expected O, but got Unknown
		((UIElement)MinimizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
		((UIElement)MinimizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
		((UIElement)MaximizeButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
		((UIElement)MaximizeButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
		((UIElement)CloseButton).MouseEnter += new MouseEventHandler(TopControls_OnMouseEnter);
		((UIElement)CloseButton).MouseLeave += new MouseEventHandler(TopControls_OnMouseLeave);
	}

	private async void DownloadWindow_OnLoaded(object sender, RoutedEventArgs e)
	{
		ViewModel.IsEnabled = false;
		await ViewModel.Atualizar();
	}

	[DebuggerNonUserCode]
	[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
	public void InitializeComponent()
	{
		if (!_contentLoaded)
		{
			_contentLoaded = true;
			Uri uri = new Uri("/Gestor.Application;component/views/ferramentas/downloadwindow.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_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: 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_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Expected O, but got Unknown
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Expected O, but got Unknown
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Expected O, but got Unknown
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Expected O, but got Unknown
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Expected O, but got Unknown
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Expected O, but got Unknown
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: 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_00ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Expected O, but got Unknown
		switch (connectionId)
		{
		case 1:
			((FrameworkElement)(DownloadWindow)target).Loaded += new RoutedEventHandler(DownloadWindow_OnLoaded);
			break;
		case 2:
			WindowChrome = (WindowChrome)target;
			break;
		case 3:
			MinimizeButton = (Grid)target;
			((UIElement)MinimizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
			((UIElement)MinimizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
			break;
		case 4:
			MaximizeButton = (Grid)target;
			((UIElement)MaximizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
			((UIElement)MaximizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
			break;
		case 5:
			CloseButton = (Grid)target;
			((UIElement)CloseButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown);
			((UIElement)CloseButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp);
			break;
		default:
			_contentLoaded = true;
			break;
		}
	}
}