Files
raton4.0-source/Raton RAT/WpfApp1/SearchDialog.cs
T

106 lines
3.9 KiB
C#
Raw Normal View History

2026-08-27 11:23:13 -06:00
// Decompiled with JetBrains decompiler
// Type: WpfApp1.SearchDialog
// Assembly: Raton, Version=0.4.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 36C4E416-7F8D-4D23-930F-B5CCB0D810E7
// Assembly location: C:\Users\user\Desktop\v3.8.0 Deluxe Plugins (v4.0.0) cracked\Raton.exe
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
#nullable disable
namespace WpfApp1;
public class SearchDialog : Window
{
private readonly TextBox _tb;
public string SearchText { get; private set; }
public SearchDialog()
{
this.Title = "Search logs";
this.Width = 400.0;
this.Height = 148.0;
this.ResizeMode = ResizeMode.NoResize;
this.WindowStartupLocation = WindowStartupLocation.CenterOwner;
this.Background = (Brush) new SolidColorBrush(Color.FromRgb((byte) 36, (byte) 36, (byte) 36));
Grid grid1 = new Grid();
grid1.Margin = new Thickness(16.0);
Grid grid2 = grid1;
grid2.RowDefinitions.Add(new RowDefinition()
{
Height = GridLength.Auto
});
grid2.RowDefinitions.Add(new RowDefinition()
{
Height = GridLength.Auto
});
grid2.RowDefinitions.Add(new RowDefinition()
{
Height = GridLength.Auto
});
TextBlock textBlock = new TextBlock();
textBlock.Text = "Search in logs:";
textBlock.Foreground = (Brush) Brushes.Gray;
textBlock.FontSize = 12.0;
textBlock.Margin = new Thickness(0.0, 0.0, 0.0, 6.0);
TextBlock element1 = textBlock;
Grid.SetRow((UIElement) element1, 0);
TextBox textBox = new TextBox();
textBox.Background = (Brush) new SolidColorBrush(Color.FromRgb((byte) 28, (byte) 28, (byte) 28));
textBox.Foreground = (Brush) Brushes.White;
textBox.CaretBrush = (Brush) Brushes.White;
textBox.BorderBrush = (Brush) new SolidColorBrush(Color.FromRgb((byte) 58, (byte) 58, (byte) 58));
textBox.BorderThickness = new Thickness(1.0);
textBox.Padding = new Thickness(6.0, 4.0, 6.0, 4.0);
textBox.FontSize = 13.0;
textBox.Margin = new Thickness(0.0, 0.0, 0.0, 10.0);
this._tb = textBox;
this._tb.KeyDown += (KeyEventHandler) ((s, e) =>
{
if (e.Key == Key.Return)
this.Confirm();
if (e.Key != Key.Escape)
return;
this.DialogResult = new bool?(false);
});
Grid.SetRow((UIElement) this._tb, 1);
StackPanel stackPanel = new StackPanel();
stackPanel.Orientation = Orientation.Horizontal;
stackPanel.HorizontalAlignment = HorizontalAlignment.Right;
StackPanel element2 = stackPanel;
Grid.SetRow((UIElement) element2, 2);
element2.Children.Add((UIElement) SearchDialog.MakeButton("Cancel", (Action) (() => this.DialogResult = new bool?(false)), "#383838"));
element2.Children.Add((UIElement) SearchDialog.MakeButton("Search", new Action(this.Confirm), "#4C4C8A"));
grid2.Children.Add((UIElement) element1);
grid2.Children.Add((UIElement) this._tb);
grid2.Children.Add((UIElement) element2);
this.Content = (object) grid2;
this.Loaded += (RoutedEventHandler) ((s, e) => this._tb.Focus());
}
private void Confirm()
{
this.SearchText = this._tb.Text;
this.DialogResult = new bool?(true);
}
private static Button MakeButton(string text, Action onClick, string hexBg)
{
Button button1 = new Button();
button1.Content = (object) text;
button1.Padding = new Thickness(16.0, 6.0, 16.0, 6.0);
button1.Margin = new Thickness(6.0, 0.0, 0.0, 0.0);
button1.Background = (Brush) new SolidColorBrush((Color) ColorConverter.ConvertFromString(hexBg));
button1.Foreground = (Brush) Brushes.White;
button1.BorderThickness = new Thickness(0.0);
button1.Cursor = Cursors.Hand;
Button button2 = button1;
button2.Click += (RoutedEventHandler) ((s, e) => onClick());
return button2;
}
}