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/DialogAdvertising.cs | |
| parent | 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (diff) | |
| download | gestor-225aa1499e37faf9d38257caabbadc68d78b427e.tar.gz gestor-225aa1499e37faf9d38257caabbadc68d78b427e.zip | |
decompiler.com
Diffstat (limited to 'Decompiler/Gestor.Application.Componentes/DialogAdvertising.cs')
| -rw-r--r-- | Decompiler/Gestor.Application.Componentes/DialogAdvertising.cs | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/Decompiler/Gestor.Application.Componentes/DialogAdvertising.cs b/Decompiler/Gestor.Application.Componentes/DialogAdvertising.cs new file mode 100644 index 0000000..4c2f5f8 --- /dev/null +++ b/Decompiler/Gestor.Application.Componentes/DialogAdvertising.cs @@ -0,0 +1,106 @@ +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.Input; +using System.Windows.Markup; +using Gestor.Application.ViewModels.Generic; +using MaterialDesignThemes.Wpf; +using Newtonsoft.Json.Linq; + +namespace Gestor.Application.Componentes; + +public class DialogAdvertising : UserControl, IComponentConnector +{ + private DialogAdvertisingViewModel ViewModel; + + private readonly bool _isPromocao; + + internal Label Titulo; + + private bool _contentLoaded; + + public DialogAdvertising(JObject jsonAd, bool isPromo = true) + { + ViewModel = new DialogAdvertisingViewModel(jsonAd, isPromo); + ((FrameworkElement)this).DataContext = ViewModel; + InitializeComponent(); + } + + private void LinkImage_MouseDown(object sender, MouseButtonEventArgs e) + { + try + { + if (!_isPromocao) + { + ViewModel.EnviarPesquisa(); + } + Process.Start(ViewModel.Url); + } + catch + { + } + } + + private void Lido_OnClick(object sender, RoutedEventArgs e) + { + ViewModel.SalvaEditarArquivoConfig(visto: true); + DialogHost.CloseDialogCommand.Execute((object)null, (IInputElement)null); + } + + private void CloseOnClick(object sender, RoutedEventArgs e) + { + DialogHost.CloseDialogCommand.Execute((object)null, (IInputElement)null); + } + + [DebuggerNonUserCode] + [GeneratedCode("PresentationBuildTasks", "4.0.0.0")] + public void InitializeComponent() + { + if (!_contentLoaded) + { + _contentLoaded = true; + Uri uri = new Uri("/Gestor.Application;component/componentes/dialogadvertising.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_001c: Unknown result type (might be due to invalid IL or missing references) + //IL_0026: Expected O, but got Unknown + //IL_0028: Unknown result type (might be due to invalid IL or missing references) + //IL_0034: Unknown result type (might be due to invalid IL or missing references) + //IL_003e: Expected O, but got Unknown + //IL_0040: Unknown result type (might be due to invalid IL or missing references) + //IL_004c: Unknown result type (might be due to invalid IL or missing references) + //IL_0056: Expected O, but got Unknown + //IL_0058: 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 + switch (connectionId) + { + case 1: + Titulo = (Label)target; + break; + case 2: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(CloseOnClick); + break; + case 3: + ((UIElement)(Image)target).MouseDown += new MouseButtonEventHandler(LinkImage_MouseDown); + break; + case 4: + ((ButtonBase)(Button)target).Click += new RoutedEventHandler(Lido_OnClick); + break; + default: + _contentLoaded = true; + break; + } + } +} |