Files
raton4.0-source/Raton RAT/Raton/Forms/ClientForms/Misc/ratonFIle.cs
T
2026-08-27 11:23:13 -06:00

164 lines
5.5 KiB
C#

// Decompiled with JetBrains decompiler
// Type: Raton.Forms.ClientForms.Misc.ratonFIle
// 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 DarkModeForms;
using Raton.Classes;
using Server.Connection;
using Stuff;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
#nullable disable
namespace Raton.Forms.ClientForms.Misc;
public class ratonFIle : Form
{
private IContainer components;
private Label lblStatus;
private Timer timer1;
public FlatProgressBar flatProgressBar1;
public Timer timer2;
public Label lblPorcent;
public Label lblName;
public Label lblSize;
public SillyClient SillyClient { get; set; }
public long FileSize { get; set; }
public object OneByOne { get; set; }
public long TotalFileSize { get; set; }
public string FileName { get; set; }
public string UID { get; set; }
public ratonFIle()
{
this.InitializeComponent();
this.OneByOne = new object();
DarkMode.Start((Form) this);
}
private void ratonFIle_Load(object sender, EventArgs e)
{
this.timer1.Start();
this.timer2.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (this.SillyClient != null && this.SillyClient.isConnected())
return;
this.Close();
}
private void timer2_Tick(object sender, EventArgs e)
{
this.lblName.Text = this.FileName;
this.lblSize.Text = "Size: " + Helpers.BytesToString(this.FileSize);
if (this.FileSize <= 0L)
{
this.flatProgressBar1.Value = 0;
this.timer2.Stop();
}
else
{
float f = 100f * (float) this.TotalFileSize / (float) this.FileSize;
if (float.IsNaN(f) || float.IsInfinity(f))
f = 0.0f;
int num = this.Clamp((int) f, 0, 100);
this.flatProgressBar1.Value = num;
this.lblPorcent.Text = $"{num}%";
}
}
private int Clamp(int value, int min, int max)
{
if (value < min)
return min;
return value <= max ? value : max;
}
public void Status(string status) => this.Invoke((Delegate) (() => this.lblStatus.Text = status));
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();
ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (ratonFIle));
this.lblStatus = new Label();
this.lblSize = new Label();
this.lblName = new Label();
this.lblPorcent = new Label();
this.timer1 = new Timer(this.components);
this.timer2 = new Timer(this.components);
this.flatProgressBar1 = new FlatProgressBar();
this.SuspendLayout();
this.lblStatus.AutoSize = true;
this.lblStatus.Font = new Font("Microsoft JhengHei", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.lblStatus.Location = new Point(9, 45);
this.lblStatus.Name = "lblStatus";
this.lblStatus.Size = new Size(59, 15);
this.lblStatus.TabIndex = 1;
this.lblStatus.Text = "Loading...";
this.lblSize.AutoSize = true;
this.lblSize.Font = new Font("Microsoft JhengHei", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.lblSize.Location = new Point(9, 28);
this.lblSize.Name = "lblSize";
this.lblSize.Size = new Size(77, 15);
this.lblSize.TabIndex = 2;
this.lblSize.Text = "Size: Unknow";
this.lblName.AutoSize = true;
this.lblName.Font = new Font("Microsoft JhengHei", 9f, FontStyle.Bold, GraphicsUnit.Point, (byte) 0);
this.lblName.Location = new Point(9, 9);
this.lblName.Name = "lblName";
this.lblName.Size = new Size(26, 16 /*0x10*/);
this.lblName.TabIndex = 3;
this.lblName.Text = "???";
this.lblPorcent.Font = new Font("Microsoft JhengHei", 8.25f, FontStyle.Regular, GraphicsUnit.Point, (byte) 0);
this.lblPorcent.Location = new Point(289, 71);
this.lblPorcent.Name = "lblPorcent";
this.lblPorcent.Size = new Size(44, 15);
this.lblPorcent.TabIndex = 4;
this.lblPorcent.Text = "100%";
this.timer1.Tick += new EventHandler(this.timer1_Tick);
this.timer2.Tick += new EventHandler(this.timer2_Tick);
this.flatProgressBar1.Location = new Point(12, 67);
this.flatProgressBar1.Name = "flatProgressBar1";
this.flatProgressBar1.ProgressBarColor = Color.LightGreen;
this.flatProgressBar1.Size = new Size(271, 23);
this.flatProgressBar1.TabIndex = 0;
this.flatProgressBar1.Value = 70;
this.AutoScaleDimensions = new SizeF(6f, 13f);
this.AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new Size(331, 113);
this.Controls.Add((Control) this.lblStatus);
this.Controls.Add((Control) this.lblPorcent);
this.Controls.Add((Control) this.lblName);
this.Controls.Add((Control) this.lblSize);
this.Controls.Add((Control) this.flatProgressBar1);
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.Icon = (Icon) componentResourceManager.GetObject("$this.Icon");
this.MaximizeBox = false;
this.Name = nameof (ratonFIle);
this.StartPosition = FormStartPosition.CenterScreen;
this.Text = nameof (ratonFIle);
this.Load += new EventHandler(this.ratonFIle_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
}