using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using System_Security_2010.My;
using System_Security_2010.My.Resources;
using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using Microsoft.VisualBasic.Devices;

namespace System_Security_2010;

[DesignerGenerated]
public class Quit : Form
{
	private static List<WeakReference> __ENCList = new List<WeakReference>();

	private IContainer components;

	[AccessedThroughProperty("Label1")]
	private Label _Label1;

	[AccessedThroughProperty("Label2")]
	private Label _Label2;

	[AccessedThroughProperty("PictureBox1")]
	private PictureBox _PictureBox1;

	[AccessedThroughProperty("Button1")]
	private Button _Button1;

	[AccessedThroughProperty("Button2")]
	private Button _Button2;

	[AccessedThroughProperty("Timer1")]
	private Timer _Timer1;

	private Point AppLocation;

	private Point CurLocation;

	internal virtual Label Label1
	{
		[DebuggerNonUserCode]
		get
		{
			return _Label1;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			MouseEventHandler value2 = Label1_MouseUp;
			MouseEventHandler value3 = Label1_MouseDown;
			if (_Label1 != null)
			{
				_Label1.MouseUp -= value2;
				_Label1.MouseDown -= value3;
			}
			_Label1 = value;
			if (_Label1 != null)
			{
				_Label1.MouseUp += value2;
				_Label1.MouseDown += value3;
			}
		}
	}

	internal virtual Label Label2
	{
		[DebuggerNonUserCode]
		get
		{
			return _Label2;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			MouseEventHandler value2 = Label2_MouseUp;
			MouseEventHandler value3 = Label2_MouseDown;
			if (_Label2 != null)
			{
				_Label2.MouseUp -= value2;
				_Label2.MouseDown -= value3;
			}
			_Label2 = value;
			if (_Label2 != null)
			{
				_Label2.MouseUp += value2;
				_Label2.MouseDown += value3;
			}
		}
	}

	internal virtual PictureBox PictureBox1
	{
		[DebuggerNonUserCode]
		get
		{
			return _PictureBox1;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			MouseEventHandler value2 = PictureBox1_MouseUp;
			MouseEventHandler value3 = PictureBox1_MouseDown;
			EventHandler value4 = PictureBox1_Click;
			if (_PictureBox1 != null)
			{
				_PictureBox1.MouseUp -= value2;
				_PictureBox1.MouseDown -= value3;
				_PictureBox1.Click -= value4;
			}
			_PictureBox1 = value;
			if (_PictureBox1 != null)
			{
				_PictureBox1.MouseUp += value2;
				_PictureBox1.MouseDown += value3;
				_PictureBox1.Click += value4;
			}
		}
	}

	internal virtual Button Button1
	{
		[DebuggerNonUserCode]
		get
		{
			return _Button1;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			EventHandler value2 = Button1_Click;
			if (_Button1 != null)
			{
				_Button1.Click -= value2;
			}
			_Button1 = value;
			if (_Button1 != null)
			{
				_Button1.Click += value2;
			}
		}
	}

	internal virtual Button Button2
	{
		[DebuggerNonUserCode]
		get
		{
			return _Button2;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			EventHandler value2 = Button2_Click;
			if (_Button2 != null)
			{
				_Button2.Click -= value2;
			}
			_Button2 = value;
			if (_Button2 != null)
			{
				_Button2.Click += value2;
			}
		}
	}

	internal virtual Timer Timer1
	{
		[DebuggerNonUserCode]
		get
		{
			return _Timer1;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			EventHandler value2 = Timer1_Tick;
			if (_Timer1 != null)
			{
				_Timer1.Tick -= value2;
			}
			_Timer1 = value;
			if (_Timer1 != null)
			{
				_Timer1.Tick += value2;
			}
		}
	}

	public Quit()
	{
		base.MouseDown += Quit_MouseDown;
		base.MouseUp += Quit_MouseUp;
		base.Load += Quit_Load;
		__ENCAddToList(this);
		ref Point appLocation = ref AppLocation;
		appLocation = new Point(0, 0);
		ref Point curLocation = ref CurLocation;
		curLocation = new Point(0, 0);
		InitializeComponent();
	}

	[DebuggerNonUserCode]
	private static void __ENCAddToList(object value)
	{
		checked
		{
			lock (__ENCList)
			{
				if (__ENCList.Count == __ENCList.Capacity)
				{
					int num = 0;
					int num2 = __ENCList.Count - 1;
					int num3 = 0;
					while (true)
					{
						int num4 = num3;
						int num5 = num2;
						if (num4 > num5)
						{
							break;
						}
						WeakReference weakReference = __ENCList[num3];
						if (weakReference.IsAlive)
						{
							if (num3 != num)
							{
								__ENCList[num] = __ENCList[num3];
							}
							num++;
						}
						num3++;
					}
					__ENCList.RemoveRange(num, __ENCList.Count - num);
					__ENCList.Capacity = __ENCList.Count;
				}
				__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
			}
		}
	}

	[DebuggerNonUserCode]
	protected override void Dispose(bool disposing)
	{
		try
		{
			if ((disposing && components != null) ? true : false)
			{
				components.Dispose();
			}
		}
		finally
		{
			base.Dispose(disposing);
		}
	}

	[System.Diagnostics.DebuggerStepThrough]
	private void InitializeComponent()
	{
		components = new System.ComponentModel.Container();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(System_Security_2010.Quit));
		Label1 = new System.Windows.Forms.Label();
		Label2 = new System.Windows.Forms.Label();
		PictureBox1 = new System.Windows.Forms.PictureBox();
		Button1 = new System.Windows.Forms.Button();
		Button2 = new System.Windows.Forms.Button();
		Timer1 = new System.Windows.Forms.Timer(components);
		((System.ComponentModel.ISupportInitialize)PictureBox1).BeginInit();
		SuspendLayout();
		Label1.AutoSize = true;
		Label1.BackColor = System.Drawing.Color.Transparent;
		Label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		Label1.ForeColor = System.Drawing.Color.White;
		System.Drawing.Point point2 = (Label1.Location = new System.Drawing.Point(62, 20));
		Label1.Name = "Label1";
		System.Drawing.Size size2 = (Label1.Size = new System.Drawing.Size(290, 25));
		Label1.TabIndex = 0;
		Label1.Text = "Your system is Under Attack!";
		Label2.BackColor = System.Drawing.Color.Transparent;
		Label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		Label2.ForeColor = System.Drawing.Color.White;
		point2 = (Label2.Location = new System.Drawing.Point(12, 45));
		Label2.Name = "Label2";
		size2 = (Label2.Size = new System.Drawing.Size(390, 23));
		Label2.TabIndex = 1;
		Label2.Text = "For your own safety, this action could not be Completed.";
		PictureBox1.BackColor = System.Drawing.Color.Transparent;
		PictureBox1.Image = System_Security_2010.My.Resources.Resources.CautionShield;
		point2 = (PictureBox1.Location = new System.Drawing.Point(149, 71));
		PictureBox1.Name = "PictureBox1";
		size2 = (PictureBox1.Size = new System.Drawing.Size(117, 117));
		PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
		PictureBox1.TabIndex = 2;
		PictureBox1.TabStop = false;
		Button1.BackColor = System.Drawing.Color.Red;
		Button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(192, 0, 0);
		Button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(255, 128, 128);
		Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		Button1.ForeColor = System.Drawing.Color.White;
		point2 = (Button1.Location = new System.Drawing.Point(12, 234));
		Button1.Name = "Button1";
		size2 = (Button1.Size = new System.Drawing.Size(172, 30));
		Button1.TabIndex = 3;
		Button1.Text = "Activate to Complete Action";
		Button1.UseVisualStyleBackColor = false;
		Button2.BackColor = System.Drawing.Color.Red;
		Button2.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(192, 0, 0);
		Button2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(255, 128, 128);
		Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		Button2.ForeColor = System.Drawing.Color.White;
		point2 = (Button2.Location = new System.Drawing.Point(230, 234));
		Button2.Name = "Button2";
		size2 = (Button2.Size = new System.Drawing.Size(172, 30));
		Button2.TabIndex = 4;
		Button2.Text = "Continue Unprotected";
		Button2.UseVisualStyleBackColor = false;
		Timer1.Interval = 2;
		System.Drawing.SizeF sizeF2 = (AutoScaleDimensions = new System.Drawing.SizeF(6f, 13f));
		AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		BackgroundImage = System_Security_2010.My.Resources.Resources.Background;
		BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
		size2 = (ClientSize = new System.Drawing.Size(414, 276));
		Controls.Add(Button2);
		Controls.Add(Button1);
		Controls.Add(PictureBox1);
		Controls.Add(Label2);
		Controls.Add(Label1);
		FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
		Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
		MaximizeBox = false;
		MinimizeBox = false;
		Name = "Quit";
		System.Windows.Forms.Padding padding2 = (Padding = new System.Windows.Forms.Padding(9));
		ShowInTaskbar = false;
		StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
		Text = "Quit";
		TopMost = true;
		((System.ComponentModel.ISupportInitialize)PictureBox1).EndInit();
		ResumeLayout(false);
		PerformLayout();
	}

	private void Quit_Load(object sender, EventArgs e)
	{
		if (((ServerComputer)MyProject.Computer).get_FileSystem().FileExists("RegSS10.dll.egisenc"))
		{
			Close();
		}
		else
		{
			((Computer)MyProject.Computer).get_Audio().Play((Stream)Resources.Please_Register, (AudioPlayMode)1);
		}
	}

	private void Sync()
	{
		AppLocation = Location;
		CurLocation = Cursor.Position;
	}

	private void Timer1_Tick(object sender, EventArgs e)
	{
		Location = AppLocation - (Size)CurLocation + (Size)Cursor.Position;
	}

	private void Quit_MouseDown(object sender, MouseEventArgs e)
	{
		Timer1.Enabled = true;
		Timer1.Start();
		Sync();
	}

	private void Quit_MouseUp(object sender, MouseEventArgs e)
	{
		Timer1.Stop();
		Sync();
	}

	private void PictureBox1_Click(object sender, EventArgs e)
	{
		Timer1.Stop();
		Sync();
	}

	private void PictureBox1_MouseDown(object sender, MouseEventArgs e)
	{
		Timer1.Enabled = true;
		Timer1.Start();
		Sync();
	}

	private void PictureBox1_MouseUp(object sender, MouseEventArgs e)
	{
		Timer1.Stop();
		Sync();
	}

	private void Label1_MouseDown(object sender, MouseEventArgs e)
	{
		Timer1.Enabled = true;
		Timer1.Start();
		Sync();
	}

	private void Label1_MouseUp(object sender, MouseEventArgs e)
	{
		Timer1.Stop();
		Sync();
	}

	private void Label2_MouseDown(object sender, MouseEventArgs e)
	{
		Timer1.Enabled = true;
		Timer1.Start();
		Sync();
	}

	private void Label2_MouseUp(object sender, MouseEventArgs e)
	{
		Timer1.Stop();
		Sync();
	}

	private void Button2_Click(object sender, EventArgs e)
	{
		MyProject.Forms.Dimond_Security1.Show();
	}

	private void Button1_Click(object sender, EventArgs e)
	{
		MyProject.Forms.Register.Show();
	}
}
