summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs')
-rw-r--r--Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs217
1 files changed, 217 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs b/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs
new file mode 100644
index 0000000..0c208ad
--- /dev/null
+++ b/Decompiler/Gestor.Application.Views.Ferramentas/DownloadWindow.cs
@@ -0,0 +1,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;
+ }
+ }
+}