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.Componentes/DialogTrilha.cs | |
| parent | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff) | |
| download | gestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip | |
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Componentes/DialogTrilha.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.Componentes/DialogTrilha.cs | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Componentes/DialogTrilha.cs b/Decompiler/Gestor.Application.Componentes/DialogTrilha.cs new file mode 100644 index 0000000..cb766eb --- /dev/null +++ b/Decompiler/Gestor.Application.Componentes/DialogTrilha.cs @@ -0,0 +1,143 @@ +using System; +using System.CodeDom.Compiler; +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 System.Windows.Media; +using Gestor.Application.Helpers; +using Gestor.Application.ViewModels.Generic; +using Gestor.Model.Domain.Ferramentas; + +namespace Gestor.Application.Componentes; + +public class DialogTrilha : UserControl, IComponentConnector, IStyleConnector +{ + private bool _contentLoaded; + + public DialogTrilhaViewModel ViewModel { get; set; } + + public DialogTrilha(DialogTrilhaViewModel viewModel) + { + ViewModel = viewModel; + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + } + + private void UIElement_OnGotFocus(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_000b: Expected O, but got Unknown + //IL_0021: Unknown result type (might be due to invalid IL or missing references) + //IL_0027: Expected O, but got Unknown + DependencyObject parent = VisualTreeHelper.GetParent((DependencyObject)(UIElement)sender); + while (!(parent is ListBoxItem)) + { + if (parent != null) + { + parent = VisualTreeHelper.GetParent(parent); + } + } + ListBoxItem val = (ListBoxItem)parent; + if (!val.IsSelected) + { + val.IsSelected = true; + } + } + + private void AdicionarFase_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.AdicionarFase(); + } + + private void ExcluirFase_OnClick(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + object dataContext = ((FrameworkElement)(Button)sender).DataContext; + Fase val = (Fase)((dataContext is Fase) ? dataContext : null); + if (val != null) + { + ViewModel.ExcluirFase(val); + } + } + + private void UIElement_OnLostFocus(object sender, RoutedEventArgs e) + { + //IL_0001: Unknown result type (might be due to invalid IL or missing references) + //IL_000b: Expected O, but got Unknown + ListBox val = ((DependencyObject)(TextBox)sender).FindAncestor<ListBox>().FirstOrDefault(); + if (val != null) + { + ViewModel.UpdateFase(((Selector)val).SelectedIndex); + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/componentes/dialogtrilha.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_0005: Unknown result type (might be due to invalid IL or missing references) + //IL_0011: Unknown result type (might be due to invalid IL or missing references) + //IL_001b: Expected O, but got Unknown + if (connectionId == 1) + { + ((MenuItem)target).Click += new RoutedEventHandler(AdicionarFase_OnClick); + } + else + { + _contentLoaded = true; + } + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + [EditorBrowsable(EditorBrowsableState.Never)] + void IStyleConnector.Connect(int connectionId, object target) + { + //IL_0016: 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_002c: Expected O, but got Unknown + //IL_002d: Unknown result type (might be due to invalid IL or missing references) + //IL_0039: Unknown result type (might be due to invalid IL or missing references) + //IL_0043: Expected O, but got Unknown + //IL_0045: Unknown result type (might be due to invalid IL or missing references) + //IL_0051: Unknown result type (might be due to invalid IL or missing references) + //IL_005b: Expected O, but got Unknown + //IL_005c: Unknown result type (might be due to invalid IL or missing references) + //IL_0068: Unknown result type (might be due to invalid IL or missing references) + //IL_0072: Expected O, but got Unknown + //IL_0074: Unknown result type (might be due to invalid IL or missing references) + //IL_0080: Unknown result type (might be due to invalid IL or missing references) + //IL_008a: Expected O, but got Unknown + switch (connectionId) + { + case 2: + ((UIElement)(TextBox)target).GotFocus += new RoutedEventHandler(UIElement_OnGotFocus); + ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus); + break; + case 3: + ((UIElement)(TextBox)target).GotFocus += new RoutedEventHandler(UIElement_OnGotFocus); + ((UIElement)(TextBox)target).LostFocus += new RoutedEventHandler(UIElement_OnLostFocus); + break; + case 4: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(ExcluirFase_OnClick); + break; + } + } +} |