107 lines
4.0 KiB
C#
107 lines
4.0 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: WpfApp1.ShareLinkDialog
|
|
// 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 ShareLinkDialog : Window
|
|
{
|
|
private readonly TextBox _tb;
|
|
|
|
public string LinkText { get; private set; }
|
|
|
|
public ShareLinkDialog()
|
|
{
|
|
this.Title = "Set share link";
|
|
this.Width = 440.0;
|
|
this.Height = 160.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 = "Set your share link — must be a direct .exe URL (e.g. raw.github.com/…/file.exe)";
|
|
textBlock.Foreground = (Brush) Brushes.Gray;
|
|
textBlock.FontSize = 11.0;
|
|
textBlock.TextWrapping = TextWrapping.Wrap;
|
|
textBlock.Margin = new Thickness(0.0, 0.0, 0.0, 8.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(8.0, 4.0, 8.0, 4.0);
|
|
textBox.FontSize = 12.0;
|
|
textBox.Margin = new Thickness(0.0, 0.0, 0.0, 10.0);
|
|
this._tb = textBox;
|
|
this._tb.KeyDown += (KeyEventHandler) ((s, ev) =>
|
|
{
|
|
if (ev.Key == Key.Return)
|
|
this.Confirm();
|
|
if (ev.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) ShareLinkDialog.MakeBtn("Cancel", (Action) (() => this.DialogResult = new bool?(false)), "#383838"));
|
|
element2.Children.Add((UIElement) ShareLinkDialog.MakeBtn("Save", new Action(this.Confirm), "#7B5EA7"));
|
|
grid2.Children.Add((UIElement) element1);
|
|
grid2.Children.Add((UIElement) this._tb);
|
|
grid2.Children.Add((UIElement) element2);
|
|
this.Content = (object) grid2;
|
|
this.Loaded += (RoutedEventHandler) ((s, ev) => this._tb.Focus());
|
|
}
|
|
|
|
private void Confirm()
|
|
{
|
|
this.LinkText = this._tb.Text;
|
|
this.DialogResult = new bool?(true);
|
|
}
|
|
|
|
private static Button MakeBtn(string text, Action onClick, string bg)
|
|
{
|
|
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(bg));
|
|
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;
|
|
}
|
|
}
|