diff options
| author | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
|---|---|---|
| committer | Lucas Faria Mendes <lucas.fariamo08@gmail.com> | 2026-03-30 15:29:41 +0000 |
| commit | 225aa1499e37faf9d38257caabbadc68d78b427e (patch) | |
| tree | 102bb7a40c58595348ae9d3c7076201759fe0720 /Decompiler/Gestor.Application.Views.Generic | |
| parent | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff) | |
| download | gestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip | |
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Views.Generic')
4 files changed, 797 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Views.Generic/BaseUserControl.cs b/Decompiler/Gestor.Application.Views.Generic/BaseUserControl.cs new file mode 100644 index 0000000..db2278d --- /dev/null +++ b/Decompiler/Gestor.Application.Views.Generic/BaseUserControl.cs @@ -0,0 +1,102 @@ +using System; +using System.Text.RegularExpressions; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; +using Gestor.Application.Helpers; +using Gestor.Common.Validation; +using Gestor.Model.Common; + +namespace Gestor.Application.Views.Generic; + +public class BaseUserControl : UserControl +{ + public virtual TipoTela Tela { get; set; } + + public virtual void SomenteNumeros(object sender, TextCompositionEventArgs e) + { + Regex regex = new Regex("[^0-9]+"); + ((RoutedEventArgs)e).Handled = regex.IsMatch(e.Text); + } + + public virtual void LetrasHabilitacao(object sender, TextCompositionEventArgs e) + { + Regex regex = new Regex("[^a-eA-E]+"); + ((RoutedEventArgs)e).Handled = regex.IsMatch(e.Text); + } + + public virtual void Placa(object sender, TextCompositionEventArgs e) + { + Regex regex = new Regex("[^a-zA-Z0-9]+"); + ((RoutedEventArgs)e).Handled = regex.IsMatch(e.Text); + } + + public virtual void FormatarTelefone(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 (!string.IsNullOrWhiteSpace(val.Text)) + { + val.Text = ValidationHelper.FormatarTelefone(val.Text); + } + } + + public virtual void FormatarDocumento(object sender, RoutedEventArgs 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) + TextBox val = (TextBox)sender; + val.Text = ValidationHelper.FormatDocument(val.Text); + } + + public void DatePicker_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0007: Expected O, but got Unknown + DatePicker val = (DatePicker)sender; + val.Text = ValidationHelper.FormatDate(val.Text); + if (string.IsNullOrEmpty(val.Text)) + { + val.DisplayDate = DateTime.Today; + } + } + + public void DataAtual_OnDoubleClick(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + ((DatePicker)sender).SelectedDate = Funcoes.GetNetworkTime().Date; + } + + public void DatePicker_PreviewKeyDown(object sender, KeyEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_0007: Invalid comparison between Unknown and I4 + //IL_000b: Unknown result type (might be due to invalid IL or missing references) + if ((int)e.Key == 6) + { + ((DatePicker)sender).Text = Funcoes.GetNetworkTime().Date.ToString("dd/MM/yyyy"); + } + } + + 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; + } + + public void SomenteCaracteres(object sender, TextCompositionEventArgs e) + { + Regex regex = new Regex("[^a-zA-Z]+$"); + ((RoutedEventArgs)e).Handled = regex.IsMatch(e.Text); + } + + public void SomenteData(object sender, TextCompositionEventArgs e) + { + Regex regex = new Regex("[^0-9/-]+"); + ((RoutedEventArgs)e).Handled = regex.IsMatch(e.Text); + } +} diff --git a/Decompiler/Gestor.Application.Views.Generic/DragOverPopup.cs b/Decompiler/Gestor.Application.Views.Generic/DragOverPopup.cs new file mode 100644 index 0000000..22d7b65 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.Generic/DragOverPopup.cs @@ -0,0 +1,61 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Markup; +using Gestor.Model.Domain.Ferramentas; + +namespace Gestor.Application.Views.Generic; + +public class DragOverPopup : UserControl, IComponentConnector +{ + internal TextBlock Titulo; + + internal TextBlock Descricao; + + private bool _contentLoaded; + + public DragOverPopup(Tarefa tarefa) + { + InitializeComponent(); + Titulo.Text = tarefa.Titulo; + Descricao.Text = tarefa.Descricao; + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/generic/dragoverpopup.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_000c: Unknown result type (might be due to invalid IL or missing references) + //IL_0016: Expected O, but got Unknown + //IL_0019: Unknown result type (might be due to invalid IL or missing references) + //IL_0023: Expected O, but got Unknown + switch (connectionId) + { + case 1: + Titulo = (TextBlock)target; + break; + case 2: + Descricao = (TextBlock)target; + break; + default: + _contentLoaded = true; + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs b/Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs new file mode 100644 index 0000000..180c775 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.Generic/ErrorWindow.cs @@ -0,0 +1,110 @@ +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.Markup; +using Gestor.Application.Helpers; +using Gestor.Common.Validation; +using Gestor.Model.API; + +namespace Gestor.Application.Views.Generic; + +public class ErrorWindow : Window, IComponentConnector +{ + internal TextBlock DescricaoErro; + + internal RepeatButton ContinuarButton; + + private bool _contentLoaded; + + public ErrorWindow(TipoErro tipo, bool fecharSistema = false) + { + //IL_000d: Unknown result type (might be due to invalid IL or missing references) + InitializeComponent(); + HanddleErro(tipo); + if (fecharSistema) + { + ((UIElement)ContinuarButton).Visibility = (Visibility)2; + } + } + + private void HanddleErro(TipoErro tipo) + { + //IL_0006: Unknown result type (might be due to invalid IL or missing references) + //IL_0016: Unknown result type (might be due to invalid IL or missing references) + //IL_0018: Invalid comparison between Unknown and I4 + DescricaoErro.Text = ValidationHelper.GetCategory((Enum)(object)tipo); + if ((int)tipo != 3) + { + ((UIElement)ContinuarButton).Visibility = (Visibility)0; + } + else + { + ((UIElement)ContinuarButton).Visibility = (Visibility)2; + } + } + + private void ContinuarButton_OnClick(object sender, RoutedEventArgs e) + { + ((Window)this).Close(); + } + + private void Reiniciar_OnClick(object sender, RoutedEventArgs e) + { + Shutdown(); + } + + private void Shutdown() + { + Instancia.ExcluirCfg(); + Process.Start(Application.ResourceAssembly.Location, ApplicationHelper.Conectado ? "INICIAR CONECTADO" : "INICIAR"); + Application.Current.Shutdown(); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/generic/errorwindow.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_0018: Unknown result type (might be due to invalid IL or missing references) + //IL_0022: Expected O, but got Unknown + //IL_0025: Unknown result type (might be due to invalid IL or missing references) + //IL_002f: Expected O, but got Unknown + //IL_003c: Unknown result type (might be due to invalid IL or missing references) + //IL_0046: Expected O, but got Unknown + //IL_0048: Unknown result type (might be due to invalid IL or missing references) + //IL_0054: Unknown result type (might be due to invalid IL or missing references) + //IL_005e: Expected O, but got Unknown + switch (connectionId) + { + case 1: + DescricaoErro = (TextBlock)target; + break; + case 2: + ContinuarButton = (RepeatButton)target; + ((ButtonBase)ContinuarButton).Click += new RoutedEventHandler(ContinuarButton_OnClick); + break; + case 3: + ((ButtonBase)(RepeatButton)target).Click += new RoutedEventHandler(Reiniciar_OnClick); + break; + default: + _contentLoaded = true; + break; + } + } +} diff --git a/Decompiler/Gestor.Application.Views.Generic/HosterWindow.cs b/Decompiler/Gestor.Application.Views.Generic/HosterWindow.cs new file mode 100644 index 0000000..322b115 --- /dev/null +++ b/Decompiler/Gestor.Application.Views.Generic/HosterWindow.cs @@ -0,0 +1,524 @@ +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Forms; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Shapes; +using System.Windows.Shell; +using System.Windows.Threading; +using Gestor.Application.Actions; +using MaterialDesignThemes.Wpf; + +namespace Gestor.Application.Views.Generic; + +public class HosterWindow : Window, IComponentConnector +{ + private enum MonitorOptions : uint + { + MonitorDefaulttoprimary = 1u, + MonitorDefaulttonearest + } + + public struct Point + { + public int X; + + public int Y; + + public Point(int x, int y) + { + X = x; + Y = y; + } + } + + private struct Minmaxinfo + { + private readonly Point ptReserved; + + public Point ptMaxSize; + + public Point ptMaxPosition; + + private readonly Point ptMinTrackSize; + + private readonly Point ptMaxTrackSize; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + private class Monitorinfo + { + private readonly int cbSize = Marshal.SizeOf(typeof(Monitorinfo)); + + public readonly Rect rcMonitor; + + public readonly Rect rcWork; + + private readonly int dwFlags; + } + + public struct Rect + { + public int Left; + + public int Top; + + public int Right; + + public int Bottom; + } + + private bool _buttonClickable; + + internal WindowChrome WindowChrome; + + internal Grid Menu; + + internal Grid MinimizeButton; + + internal Path MinimizeButtonPath; + + internal Grid MaximizeButton; + + internal Path MaximizeButtonPath; + + internal Grid CloseButton; + + internal ContentControl ContentControl; + + internal DialogHost HosterDialog; + + internal DrawerHost DrawerHost; + + internal Snackbar Snackbar; + + private bool _contentLoaded; + + public string Tela { get; set; } + + private IntPtr WindowProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + if (msg == 36) + { + WmGetMinMaxInfo(lParam); + } + return IntPtr.Zero; + } + + private void WmGetMinMaxInfo(IntPtr lParam) + { + //IL_0002: Unknown result type (might be due to invalid IL or missing references) + ((FrameworkElement)this).MaxHeight = Screen.FromHandle(new WindowInteropHelper((Window)(object)this).Handle).WorkingArea.Height; + GetCursorPos(out var lpPoint); + IntPtr hMonitor = MonitorFromPoint(new Point(0, 0), MonitorOptions.MonitorDefaulttoprimary); + Monitorinfo monitorinfo = new Monitorinfo(); + if (GetMonitorInfo(hMonitor, monitorinfo)) + { + IntPtr intPtr = MonitorFromPoint(lpPoint, MonitorOptions.MonitorDefaulttonearest); + Minmaxinfo structure = (Minmaxinfo)Marshal.PtrToStructure(lParam, typeof(Minmaxinfo)); + if (hMonitor.Equals((object?)(nint)intPtr)) + { + structure.ptMaxPosition.X = monitorinfo.rcWork.Left; + structure.ptMaxPosition.Y = monitorinfo.rcWork.Top; + structure.ptMaxSize.X = monitorinfo.rcWork.Right - monitorinfo.rcWork.Left; + structure.ptMaxSize.Y = monitorinfo.rcWork.Bottom - monitorinfo.rcWork.Top; + } + else + { + structure.ptMaxPosition.X = monitorinfo.rcMonitor.Left; + structure.ptMaxPosition.Y = monitorinfo.rcMonitor.Top; + structure.ptMaxSize.X = monitorinfo.rcMonitor.Right - monitorinfo.rcMonitor.Left; + structure.ptMaxSize.Y = monitorinfo.rcMonitor.Bottom - monitorinfo.rcMonitor.Top; + } + Marshal.StructureToPtr(structure, lParam, fDeleteOld: true); + } + } + + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + private static extern bool GetCursorPos(out Point lpPoint); + + [DllImport("user32.dll", SetLastError = true)] + private static extern IntPtr MonitorFromPoint(Point pt, MonitorOptions dwFlags); + + [DllImport("user32.dll")] + private static extern bool GetMonitorInfo(IntPtr hMonitor, Monitorinfo lpmi); + + private void TopControls_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + //IL_0008: 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_005f: Unknown result type (might be due to invalid IL or missing references) + //IL_0064: Unknown result type (might be due to invalid IL or missing references) + //IL_006e: Expected O, but got Unknown + //IL_001f: 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_0033: Expected O, but got Unknown + //IL_0034: Unknown result type (might be due to invalid IL or missing references) + //IL_003f: Expected O, but got Unknown + //IL_0049: Unknown result type (might be due to invalid IL or missing references) + //IL_004e: Unknown result type (might be due to invalid IL or missing references) + //IL_0058: Expected O, but got Unknown + _buttonClickable = true; + if (((FrameworkElement)(Grid)sender).Name == "CloseButton") + { + ((Panel)(Grid)sender).Background = (Brush)new SolidColorBrush(Colors.Red); + 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.Black); + } + } + else + { + ((Panel)(Grid)sender).Background = (Brush)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 MaximizeButton_Click() + { + //IL_0002: Unknown result type (might be due to invalid IL or missing references) + ((Window)this).WindowState = (WindowState)(((int)((Window)this).WindowState == 0) ? 2 : 0); + } + + public void CloseButton_Click() + { + ((Window)this).Close(); + } + + protected sealed override void OnStateChanged(EventArgs e) + { + //IL_0002: Unknown result type (might be due to invalid IL or missing references) + //IL_0008: Invalid comparison between Unknown and I4 + //IL_000e: Unknown result type (might be due to invalid IL or missing references) + //IL_001f: Unknown result type (might be due to invalid IL or missing references) + //IL_0025: Invalid comparison between Unknown and I4 + //IL_002c: Unknown result type (might be due to invalid IL or missing references) + //IL_003d: Unknown result type (might be due to invalid IL or missing references) + //IL_0043: Invalid comparison between Unknown and I4 + //IL_0058: Unknown result type (might be due to invalid IL or missing references) + //IL_005e: Invalid comparison between Unknown and I4 + ((Control)this).BorderThickness = new Thickness((double)(((int)((Window)this).WindowState != 2) ? 1 : 0)); + WindowChrome.ResizeBorderThickness = new Thickness((double)(((int)((Window)this).WindowState != 2) ? 4 : 0)); + WindowChrome.CaptionHeight = (((int)((Window)this).WindowState == 2) ? 32 : 29); + MaximizeButtonPath.Data = (((int)((Window)this).WindowState == 2) ? Geometry.Parse((string)Application.Current.Resources[(object)"Restore"]) : Geometry.Parse((string)Application.Current.Resources[(object)"Maximize"])); + ((Window)this).OnStateChanged(e); + } + + private void Window_OnInitialized(object sender, EventArgs 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) + //IL_0023: Unknown result type (might be due to invalid IL or missing references) + //IL_002d: Expected O, but got Unknown + WindowInteropHelper val = new WindowInteropHelper((Window)(object)this); + val.EnsureHandle(); + HwndSource obj = HwndSource.FromHwnd(val.Handle); + if (obj != null) + { + obj.AddHook(new HwndSourceHook(WindowProc)); + } + } + + public HosterWindow(ContentControl control, string titulo, double? x = null, double? y = null, bool canMaximize = false) + { + //IL_0059: Unknown result type (might be due to invalid IL or missing references) + //IL_0063: Expected O, but got Unknown + //IL_0070: Unknown result type (might be due to invalid IL or missing references) + //IL_007a: Expected O, but got Unknown + //IL_0087: Unknown result type (might be due to invalid IL or missing references) + //IL_0091: Expected O, but got Unknown + //IL_009e: Unknown result type (might be due to invalid IL or missing references) + //IL_00a8: Expected O, but got Unknown + //IL_00b5: Unknown result type (might be due to invalid IL or missing references) + //IL_00bf: Expected O, but got Unknown + //IL_00cc: Unknown result type (might be due to invalid IL or missing references) + //IL_00d6: Expected O, but got Unknown + //IL_0154: Unknown result type (might be due to invalid IL or missing references) + //IL_016d: Unknown result type (might be due to invalid IL or missing references) + //IL_02c8: Unknown result type (might be due to invalid IL or missing references) + //IL_02cd: Unknown result type (might be due to invalid IL or missing references) + //IL_02d7: Expected O, but got Unknown + //IL_02dd: Unknown result type (might be due to invalid IL or missing references) + //IL_02e2: Unknown result type (might be due to invalid IL or missing references) + //IL_02ec: Expected O, but got Unknown + InitializeComponent(); + Gestor.Application.Actions.Actions.EnableMainMenu = (Action<bool>)Delegate.Combine(Gestor.Application.Actions.Actions.EnableMainMenu, new Action<bool>(HabilitarMenu)); + Gestor.Application.Actions.Actions.CloseHoster = (Action)Delegate.Combine(Gestor.Application.Actions.Actions.CloseHoster, new Action(base.Close)); + ((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); + ContentControl.Content = control.Content; + ((FrameworkElement)ContentControl).DataContext = ((FrameworkElement)control).DataContext; + ((FrameworkElement)ContentControl).Tag = titulo; + MaximizeButtonPath.Data = Geometry.Parse((string)Application.Current.Resources[(object)"Restore"]); + if ((x.HasValue || y.HasValue) && !canMaximize) + { + ((Window)this).WindowState = (WindowState)0; + ((Control)this).BorderThickness = new Thickness(1.0); + WindowChrome.ResizeBorderThickness = new Thickness(4.0); + WindowChrome.CaptionHeight = 30.0; + MaximizeButtonPath.Data = Geometry.Parse((string)Application.Current.Resources[(object)"Maximize"]); + } + if (x.HasValue) + { + if (x.Value < ((FrameworkElement)this).Width) + { + ((FrameworkElement)this).MinWidth = x.Value; + if (!canMaximize) + { + ((FrameworkElement)this).Width = x.Value; + ((FrameworkElement)this).MaxWidth = x.Value; + } + } + else + { + if (!canMaximize) + { + ((FrameworkElement)this).MaxWidth = x.Value; + ((FrameworkElement)this).Width = x.Value; + } + ((FrameworkElement)this).MinWidth = x.Value; + } + } + if (y.HasValue) + { + if (y.Value < ((FrameworkElement)this).Height) + { + ((FrameworkElement)this).MinHeight = y.Value; + if (!canMaximize) + { + ((FrameworkElement)this).Height = y.Value; + ((FrameworkElement)this).MaxHeight = y.Value; + } + } + else + { + if (!canMaximize) + { + ((FrameworkElement)this).MaxHeight = y.Value; + ((FrameworkElement)this).Height = y.Value; + } + ((FrameworkElement)this).MinHeight = y.Value; + } + } + if (x.HasValue && y.HasValue && !canMaximize) + { + ((UIElement)MaximizeButton).IsEnabled = false; + ((UIElement)MinimizeButton).IsEnabled = false; + ((Shape)MaximizeButtonPath).Stroke = (Brush)new SolidColorBrush(Colors.Gray); + ((Shape)MinimizeButtonPath).Stroke = (Brush)new SolidColorBrush(Colors.Gray); + } + else + { + ((Window)this).ResizeMode = (ResizeMode)2; + } + ((Window)this).Title = titulo; + Tela = ((object)control).GetType().Name; + HosterDialog.Identifier = $"Dialog{Tela}{Guid.NewGuid()}"; + } + + private void HabilitarMenu(bool enable) + { + ((UIElement)Menu).IsEnabled = enable; + } + + private void SnackbarMessage_ActionClick(object sender, RoutedEventArgs e) + { + Snackbar.IsActive = false; + } + + private void HosterWindow_OnLoaded(object sender, RoutedEventArgs e) + { + Task.Run(delegate + { + Thread.Sleep(500); + ((DispatcherObject)Application.Current).Dispatcher.Invoke((Action)delegate + { + ((Window)this).Topmost = false; + }); + }); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/views/generic/hosterwindow.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_0065: Unknown result type (might be due to invalid IL or missing references) + //IL_006f: Expected O, but got Unknown + //IL_0072: Unknown result type (might be due to invalid IL or missing references) + //IL_007c: Expected O, but got Unknown + //IL_007f: Unknown result type (might be due to invalid IL or missing references) + //IL_0089: Expected O, but got Unknown + //IL_008c: Unknown result type (might be due to invalid IL or missing references) + //IL_0096: Expected O, but got Unknown + //IL_00a3: Unknown result type (might be due to invalid IL or missing references) + //IL_00ad: 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_00c7: Unknown result type (might be due to invalid IL or missing references) + //IL_00d1: Expected O, but got Unknown + //IL_00d4: Unknown result type (might be due to invalid IL or missing references) + //IL_00de: Expected O, but got Unknown + //IL_00eb: Unknown result type (might be due to invalid IL or missing references) + //IL_00f5: Expected O, but got Unknown + //IL_0102: Unknown result type (might be due to invalid IL or missing references) + //IL_010c: Expected O, but got Unknown + //IL_010f: Unknown result type (might be due to invalid IL or missing references) + //IL_0119: Expected O, but got Unknown + //IL_011c: Unknown result type (might be due to invalid IL or missing references) + //IL_0126: Expected O, but got Unknown + //IL_0133: Unknown result type (might be due to invalid IL or missing references) + //IL_013d: Expected O, but got Unknown + //IL_014a: Unknown result type (might be due to invalid IL or missing references) + //IL_0154: Expected O, but got Unknown + //IL_0157: Unknown result type (might be due to invalid IL or missing references) + //IL_0161: Expected O, but got Unknown + //IL_0164: Unknown result type (might be due to invalid IL or missing references) + //IL_016e: Expected O, but got Unknown + //IL_0171: Unknown result type (might be due to invalid IL or missing references) + //IL_017b: Expected O, but got Unknown + //IL_017e: Unknown result type (might be due to invalid IL or missing references) + //IL_0188: Expected O, but got Unknown + //IL_018a: Unknown result type (might be due to invalid IL or missing references) + //IL_0196: Unknown result type (might be due to invalid IL or missing references) + //IL_01a0: Expected O, but got Unknown + switch (connectionId) + { + case 1: + ((FrameworkElement)(HosterWindow)target).Initialized += Window_OnInitialized; + ((FrameworkElement)(HosterWindow)target).Loaded += new RoutedEventHandler(HosterWindow_OnLoaded); + break; + case 2: + WindowChrome = (WindowChrome)target; + break; + case 3: + Menu = (Grid)target; + break; + case 4: + MinimizeButton = (Grid)target; + ((UIElement)MinimizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown); + ((UIElement)MinimizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp); + break; + case 5: + MinimizeButtonPath = (Path)target; + break; + case 6: + MaximizeButton = (Grid)target; + ((UIElement)MaximizeButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown); + ((UIElement)MaximizeButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp); + break; + case 7: + MaximizeButtonPath = (Path)target; + break; + case 8: + CloseButton = (Grid)target; + ((UIElement)CloseButton).MouseLeftButtonDown += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonDown); + ((UIElement)CloseButton).MouseLeftButtonUp += new MouseButtonEventHandler(TopControls_OnMouseLeftButtonUp); + break; + case 9: + ContentControl = (ContentControl)target; + break; + case 10: + HosterDialog = (DialogHost)target; + break; + case 11: + DrawerHost = (DrawerHost)target; + break; + case 12: + Snackbar = (Snackbar)target; + break; + case 13: + ((SnackbarMessage)target).ActionClick += new RoutedEventHandler(SnackbarMessage_ActionClick); + break; + default: + _contentLoaded = true; + break; + } + } +} |