Files
2026-08-27 11:23:13 -06:00

231 lines
9.4 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Raton.Forms.ClientForms.Monitor.ratonServices
// 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 Raton.Classes;
using Raton.Properties;
using RatonAccessTool.Controls;
using Server.Connection;
using Stuff;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
#nullable disable
namespace Raton.Forms.ClientForms.Monitor;
public class ratonServices : Form
{
private IContainer components;
private Timer timer1;
private ColumnHeader columnHeader1;
private ColumnHeader columnHeader2;
private ColumnHeader columnHeader3;
private ColumnHeader columnHeader4;
public AeroListView aeroListView1;
public Label label1;
private ContextMenuStrip contextMenuStrip1;
private ToolStripMenuItem startToolStripMenuItem;
private ToolStripMenuItem stopToolStripMenuItem;
private ToolStripMenuItem restartToolStripMenuItem;
private ToolStripMenuItem refreshToolStripMenuItem;
private ImageList imageList1;
public SillyClient SillyClient { get; set; }
public ratonServices()
{
this.InitializeComponent();
DarkMode.Start((Form) this);
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.SillyClient != null && this.SillyClient.isConnected())
return;
this.Close();
}
private void ratonServices_Load(object sender, EventArgs e)
{
this.timer1.Start();
this.SendList();
}
private string GetSelectedService()
{
if (this.aeroListView1.SelectedItems.Count == 0)
return (string) null;
return this.aeroListView1.SelectedItems[0].Tag?.ToString();
}
private void SendList()
{
if (this.SillyClient == null)
return;
Pack pack = new Pack();
pack.SetString("Packet", "Services");
pack.SetString("Command", "List");
this.SillyClient.Send(pack.Pacc());
}
private void SendAction(string command, string serviceName)
{
if (this.SillyClient == null || string.IsNullOrEmpty(serviceName))
return;
Pack pack = new Pack();
pack.SetString("Packet", "Services");
pack.SetString("Command", command);
pack.SetString("Name", serviceName);
this.SillyClient.Send(pack.Pacc());
}
private void startToolStripMenuItem_Click(object sender, EventArgs e)
{
string selectedService = this.GetSelectedService();
if (selectedService == null)
return;
this.SendAction("Start", selectedService);
}
private void stopToolStripMenuItem_Click(object sender, EventArgs e)
{
string selectedService = this.GetSelectedService();
if (selectedService == null)
return;
this.SendAction("Stop", selectedService);
}
private void restartToolStripMenuItem_Click(object sender, EventArgs e)
{
string selectedService = this.GetSelectedService();
if (selectedService == null)
return;
this.SendAction("Restart", selectedService);
}
private void refreshToolStripMenuItem_Click(object sender, EventArgs e) => this.SendList();
protected override void Dispose(bool disposing)
{
if (disposing && this.components != null)
this.components.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.components = (IContainer) new System.ComponentModel.Container();
AeroListView.ListViewColumnSorter viewColumnSorter = new AeroListView.ListViewColumnSorter();
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (ratonServices));
this.timer1 = new Timer(this.components);
this.aeroListView1 = new AeroListView();
this.columnHeader1 = new ColumnHeader();
this.columnHeader2 = new ColumnHeader();
this.columnHeader3 = new ColumnHeader();
this.columnHeader4 = new ColumnHeader();
this.contextMenuStrip1 = new ContextMenuStrip(this.components);
this.startToolStripMenuItem = new ToolStripMenuItem();
this.stopToolStripMenuItem = new ToolStripMenuItem();
this.restartToolStripMenuItem = new ToolStripMenuItem();
this.refreshToolStripMenuItem = new ToolStripMenuItem();
this.imageList1 = new ImageList(this.components);
this.label1 = new Label();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
this.timer1.Tick += new EventHandler(this.timer1_Tick);
this.aeroListView1.Columns.AddRange(new ColumnHeader[4]
{
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4
});
this.aeroListView1.ContextMenuStrip = this.contextMenuStrip1;
this.aeroListView1.Dock = DockStyle.Fill;
this.aeroListView1.Font = new Font("Microsoft JhengHei", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.aeroListView1.FullRowSelect = true;
this.aeroListView1.HideSelection = false;
this.aeroListView1.Location = new Point(0, 0);
viewColumnSorter.Order = SortOrder.None;
viewColumnSorter.SortColumn = 0;
this.aeroListView1.BorderStyle = BorderStyle.None;
this.aeroListView1.LvwColumnSorter = viewColumnSorter;
this.aeroListView1.Name = "aeroListView1";
this.aeroListView1.Size = new Size(561, 591);
this.aeroListView1.SmallImageList = this.imageList1;
this.aeroListView1.TabIndex = 0;
this.aeroListView1.UseCompatibleStateImageBehavior = false;
this.aeroListView1.View = View.Details;
this.columnHeader1.Text = "Service";
this.columnHeader1.Width = 155;
this.columnHeader2.Text = "Name";
this.columnHeader2.Width = 145;
this.columnHeader3.Text = "Status";
this.columnHeader3.Width = 118;
this.columnHeader4.Text = "Type";
this.columnHeader4.Width = 139;
this.contextMenuStrip1.Items.AddRange(new ToolStripItem[4]
{
(ToolStripItem) this.startToolStripMenuItem,
(ToolStripItem) this.stopToolStripMenuItem,
(ToolStripItem) this.restartToolStripMenuItem,
(ToolStripItem) this.refreshToolStripMenuItem
});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new Size(118, 92);
this.startToolStripMenuItem.Font = new Font("Microsoft JhengHei", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.startToolStripMenuItem.Image = (Image) componentResourceManager.GetObject("startToolStripMenuItem.Image");
this.startToolStripMenuItem.Name = "startToolStripMenuItem";
this.startToolStripMenuItem.Size = new Size(117, 22);
this.startToolStripMenuItem.Text = "Start";
this.startToolStripMenuItem.Click += new EventHandler(this.startToolStripMenuItem_Click);
this.stopToolStripMenuItem.Font = new Font("Microsoft JhengHei", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.stopToolStripMenuItem.Image = (Image) Resources.Stop_16x;
this.stopToolStripMenuItem.Name = "stopToolStripMenuItem";
this.stopToolStripMenuItem.Size = new Size(117, 22);
this.stopToolStripMenuItem.Text = "Stop";
this.stopToolStripMenuItem.Click += new EventHandler(this.stopToolStripMenuItem_Click);
this.restartToolStripMenuItem.Font = new Font("Microsoft JhengHei", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.restartToolStripMenuItem.Image = (Image) Resources.Refresh_greyThin_16x;
this.restartToolStripMenuItem.Name = "restartToolStripMenuItem";
this.restartToolStripMenuItem.Size = new Size(117, 22);
this.restartToolStripMenuItem.Text = "Restart";
this.restartToolStripMenuItem.Click += new EventHandler(this.restartToolStripMenuItem_Click);
this.refreshToolStripMenuItem.Font = new Font("Microsoft JhengHei", 9f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.refreshToolStripMenuItem.Image = (Image) Resources.Refresh_greyThin_16x;
this.refreshToolStripMenuItem.Name = "refreshToolStripMenuItem";
this.refreshToolStripMenuItem.Size = new Size(117, 22);
this.refreshToolStripMenuItem.Text = "Refresh";
this.refreshToolStripMenuItem.Click += new EventHandler(this.refreshToolStripMenuItem_Click);
this.imageList1.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("imageList1.ImageStream");
this.imageList1.TransparentColor = Color.Transparent;
this.imageList1.Images.SetKeyName(0, "SettingsOutline_16x.png");
this.label1.Dock = DockStyle.Fill;
this.label1.Font = new Font("Microsoft JhengHei", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.label1.Location = new Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new Size(561, 591);
this.label1.TabIndex = 2;
this.label1.Text = "Loading...";
this.label1.TextAlign = ContentAlignment.MiddleCenter;
this.AutoScaleDimensions = new SizeF(6f, 13f);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(561, 591);
this.Controls.Add((Control) this.label1);
this.Controls.Add((Control) this.aeroListView1);
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
this.MaximizeBox = false;
this.Name = nameof (ratonServices);
this.StartPosition = FormStartPosition.CenterScreen;
this.Text = nameof (ratonServices);
this.Load += new EventHandler(this.ratonServices_Load);
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
}
}