113 lines
4.5 KiB
C#
113 lines
4.5 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: WpfApp1.App
|
|
// 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.CodeDom.Compiler;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Drawing.Drawing2D;
|
|
using System.Drawing.Imaging;
|
|
using System.IO;
|
|
using System.Windows;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Threading;
|
|
using WpfApp1.Windows;
|
|
|
|
#nullable disable
|
|
namespace WpfApp1;
|
|
|
|
public class App : System.Windows.Application
|
|
{
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
base.OnStartup(e);
|
|
Port port = new Port();
|
|
DispatcherFrame frame = new DispatcherFrame();
|
|
port.Closed += (EventHandler) ((s, ev) => frame.Continue = false);
|
|
port.Show();
|
|
Dispatcher.PushFrame(frame);
|
|
if (!port.LoginSuccess)
|
|
{
|
|
this.Shutdown();
|
|
}
|
|
else
|
|
{
|
|
WpfApp1.MainWindow mainWindow = new WpfApp1.MainWindow();
|
|
mainWindow.LoginPassword = port.EnteredPassword;
|
|
mainWindow.LoginPort = port.EnteredPort;
|
|
this.MainWindow = (Window) mainWindow;
|
|
Program.form2 = mainWindow;
|
|
mainWindow.Show();
|
|
mainWindow.userName.Text = mainWindow.user;
|
|
mainWindow.StartListening(port.EnteredPort, "@" + mainWindow.user);
|
|
}
|
|
}
|
|
|
|
protected override void OnExit(ExitEventArgs e) => base.OnExit(e);
|
|
|
|
private static ContextMenuStrip BuildTrayMenu()
|
|
{
|
|
ContextMenuStrip contextMenuStrip = new ContextMenuStrip();
|
|
contextMenuStrip.Renderer = (ToolStripRenderer) new DarkMenuRenderer();
|
|
contextMenuStrip.Padding = new Padding(0, 4, 0, 4);
|
|
ToolStripMenuItem toolStripMenuItem1 = new ToolStripMenuItem("Open website");
|
|
toolStripMenuItem1.Font = new Font("Segoe UI", 9f);
|
|
toolStripMenuItem1.Image = (Image) App.MakeGlyph("\uE909", Color.FromArgb(180, 180, 180));
|
|
ToolStripMenuItem toolStripMenuItem2 = toolStripMenuItem1;
|
|
toolStripMenuItem2.Click += (EventHandler) ((s, e) => App.OpenWeb());
|
|
contextMenuStrip.Items.Add((ToolStripItem) toolStripMenuItem2);
|
|
ToolStripMenuItem toolStripMenuItem3 = new ToolStripMenuItem("Your information");
|
|
toolStripMenuItem3.Font = new Font("Segoe UI", 9f);
|
|
toolStripMenuItem3.Image = (Image) App.MakeGlyph("\uE8B7", Color.FromArgb(180, 180, 180));
|
|
ToolStripMenuItem toolStripMenuItem4 = toolStripMenuItem3;
|
|
toolStripMenuItem4.Click += (EventHandler) ((s, e) => App.OpenInformation());
|
|
contextMenuStrip.Items.Add((ToolStripItem) toolStripMenuItem4);
|
|
contextMenuStrip.Items.Add((ToolStripItem) new ToolStripSeparator());
|
|
ToolStripMenuItem toolStripMenuItem5 = new ToolStripMenuItem("Exit");
|
|
toolStripMenuItem5.Font = new Font("Segoe UI", 9f);
|
|
toolStripMenuItem5.Image = (Image) App.MakeGlyph("\uE7E8", Color.FromArgb(239, 83, 80 /*0x50*/));
|
|
ToolStripMenuItem toolStripMenuItem6 = toolStripMenuItem5;
|
|
toolStripMenuItem6.Click += (EventHandler) ((s, e) => App.ExitApp());
|
|
contextMenuStrip.Items.Add((ToolStripItem) toolStripMenuItem6);
|
|
return contextMenuStrip;
|
|
}
|
|
|
|
private static void OpenWeb() => Process.Start("https://raton.onimai.org");
|
|
|
|
private static void OpenInformation()
|
|
{
|
|
if (!Directory.Exists(Program.appData))
|
|
Directory.CreateDirectory(Program.appData);
|
|
Process.Start("explorer.exe", Program.appData);
|
|
}
|
|
|
|
private static void ExitApp() => System.Windows.Application.Current.Shutdown();
|
|
|
|
private static Bitmap MakeGlyph(string glyph, Color color, int size = 16 /*0x10*/)
|
|
{
|
|
Bitmap bitmap = new Bitmap(size, size, PixelFormat.Format32bppArgb);
|
|
using (Graphics graphics = Graphics.FromImage((Image) bitmap))
|
|
{
|
|
graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
|
graphics.Clear(Color.Transparent);
|
|
using (Font font = new Font("Segoe MDL2 Assets", (float) size * 0.72f, System.Drawing.FontStyle.Regular, GraphicsUnit.Pixel))
|
|
{
|
|
using (SolidBrush solidBrush = new SolidBrush(color))
|
|
{
|
|
SizeF sizeF = graphics.MeasureString(glyph, font);
|
|
graphics.DrawString(glyph, font, (Brush) solidBrush, (float) (((double) size - (double) sizeF.Width) / 2.0), (float) (((double) size - (double) sizeF.Height) / 2.0));
|
|
}
|
|
}
|
|
}
|
|
return bitmap;
|
|
}
|
|
|
|
[STAThread]
|
|
[DebuggerNonUserCode]
|
|
[GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
|
|
public static void Main() => new App().Run();
|
|
}
|