using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Media;
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 Register : Form
{
	private static List<WeakReference> __ENCList = new List<WeakReference>();

	private IContainer components;

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

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

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

	[AccessedThroughProperty("TextBox1")]
	private TextBox _TextBox1;

	[AccessedThroughProperty("Label3")]
	private Label _Label3;

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

	[AccessedThroughProperty("Button3")]
	private Button _Button3;

	[AccessedThroughProperty("Label4")]
	private Label _Label4;

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

	[AccessedThroughProperty("ToolTip1")]
	private ToolTip _ToolTip1;

	[AccessedThroughProperty("Label5")]
	private Label _Label5;

	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 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;
			}
		}
	}

	internal virtual TextBox TextBox1
	{
		[DebuggerNonUserCode]
		get
		{
			return _TextBox1;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			_TextBox1 = value;
		}
	}

	internal virtual Label Label3
	{
		[DebuggerNonUserCode]
		get
		{
			return _Label3;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			_Label3 = value;
		}
	}

	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 Button Button3
	{
		[DebuggerNonUserCode]
		get
		{
			return _Button3;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			EventHandler value2 = Button3_Click;
			if (_Button3 != null)
			{
				_Button3.Click -= value2;
			}
			_Button3 = value;
			if (_Button3 != null)
			{
				_Button3.Click += value2;
			}
		}
	}

	internal virtual Label Label4
	{
		[DebuggerNonUserCode]
		get
		{
			return _Label4;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			EventHandler value2 = Label4_Click;
			if (_Label4 != null)
			{
				_Label4.Click -= value2;
			}
			_Label4 = value;
			if (_Label4 != null)
			{
				_Label4.Click += value2;
			}
		}
	}

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

	internal virtual ToolTip ToolTip1
	{
		[DebuggerNonUserCode]
		get
		{
			return _ToolTip1;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			_ToolTip1 = value;
		}
	}

	internal virtual Label Label5
	{
		[DebuggerNonUserCode]
		get
		{
			return _Label5;
		}
		[MethodImpl(MethodImplOptions.Synchronized)]
		[DebuggerNonUserCode]
		set
		{
			_Label5 = value;
		}
	}

	public Register()
	{
		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.Register));
		Label1 = new System.Windows.Forms.Label();
		Label2 = new System.Windows.Forms.Label();
		Timer1 = new System.Windows.Forms.Timer(components);
		TextBox1 = new System.Windows.Forms.TextBox();
		Label3 = new System.Windows.Forms.Label();
		Button2 = new System.Windows.Forms.Button();
		Button3 = new System.Windows.Forms.Button();
		Label4 = new System.Windows.Forms.Label();
		Button1 = new System.Windows.Forms.Button();
		ToolTip1 = new System.Windows.Forms.ToolTip(components);
		Label5 = new System.Windows.Forms.Label();
		SuspendLayout();
		Label1.AutoSize = true;
		Label1.BackColor = System.Drawing.Color.Transparent;
		Label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, 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(18, 12));
		Label1.Name = "Label1";
		System.Drawing.Size size2 = (Label1.Size = new System.Drawing.Size(270, 20));
		Label1.TabIndex = 0;
		Label1.Text = "Please Enter your Registration Code,\r\n";
		Label2.AutoSize = true;
		Label2.BackColor = System.Drawing.Color.Transparent;
		Label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25f, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, 0);
		Label2.ForeColor = System.Drawing.Color.White;
		point2 = (Label2.Location = new System.Drawing.Point(83, 32));
		Label2.Name = "Label2";
		size2 = (Label2.Size = new System.Drawing.Size(232, 18));
		Label2.TabIndex = 1;
		Label2.Text = "To Activate System Security 2010.\r\n";
		Timer1.Interval = 2;
		TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
		point2 = (TextBox1.Location = new System.Drawing.Point(102, 60));
		TextBox1.Name = "TextBox1";
		size2 = (TextBox1.Size = new System.Drawing.Size(287, 20));
		TextBox1.TabIndex = 3;
		Label3.AutoSize = true;
		Label3.BackColor = System.Drawing.Color.Transparent;
		Label3.ForeColor = System.Drawing.Color.White;
		point2 = (Label3.Location = new System.Drawing.Point(19, 63));
		Label3.Name = "Label3";
		size2 = (Label3.Size = new System.Drawing.Size(77, 13));
		Label3.TabIndex = 4;
		Label3.Text = "Register Code:";
		Button2.BackColor = System.Drawing.Color.MidnightBlue;
		Button2.FlatAppearance.BorderColor = System.Drawing.Color.Navy;
		Button2.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(0, 0, 64);
		Button2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(128, 128, 255);
		Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		Button2.ForeColor = System.Drawing.Color.White;
		Button2.Image = System_Security_2010.My.Resources.Resources.@lock;
		Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		point2 = (Button2.Location = new System.Drawing.Point(193, 86));
		Button2.Name = "Button2";
		size2 = (Button2.Size = new System.Drawing.Size(95, 34));
		Button2.TabIndex = 5;
		Button2.Text = "Purchase";
		Button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		Button2.UseVisualStyleBackColor = false;
		Button3.BackColor = System.Drawing.Color.MidnightBlue;
		Button3.FlatAppearance.BorderColor = System.Drawing.Color.Navy;
		Button3.FlatAppearance.BorderSize = 2;
		Button3.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(0, 0, 64);
		Button3.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(128, 128, 255);
		Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		Button3.ForeColor = System.Drawing.Color.White;
		Button3.Image = System_Security_2010.My.Resources.Resources.key;
		Button3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		point2 = (Button3.Location = new System.Drawing.Point(294, 86));
		Button3.Name = "Button3";
		size2 = (Button3.Size = new System.Drawing.Size(95, 34));
		Button3.TabIndex = 7;
		Button3.Text = "Register";
		Button3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		Button3.UseVisualStyleBackColor = false;
		Label4.AutoSize = true;
		Label4.BackColor = System.Drawing.Color.Transparent;
		Label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12f, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 0);
		Label4.ForeColor = System.Drawing.Color.White;
		point2 = (Label4.Location = new System.Drawing.Point(376, 3));
		Label4.Name = "Label4";
		size2 = (Label4.Size = new System.Drawing.Size(21, 20));
		Label4.TabIndex = 8;
		Label4.Text = "X\r\n";
		Label4.Visible = false;
		Button1.BackColor = System.Drawing.Color.MidnightBlue;
		Button1.Enabled = false;
		Button1.FlatAppearance.BorderColor = System.Drawing.Color.Navy;
		Button1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(0, 0, 64);
		Button1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(128, 128, 255);
		Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
		Button1.ForeColor = System.Drawing.Color.White;
		Button1.Image = System_Security_2010.My.Resources.Resources.file_download;
		Button1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
		point2 = (Button1.Location = new System.Drawing.Point(22, 86));
		Button1.Name = "Button1";
		size2 = (Button1.Size = new System.Drawing.Size(165, 34));
		Button1.TabIndex = 9;
		Button1.Text = "Download Key File";
		Button1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		Button1.UseVisualStyleBackColor = false;
		ToolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
		ToolTip1.ToolTipTitle = "Download Key File";
		Label5.BackColor = System.Drawing.Color.Transparent;
		Label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
		Label5.ForeColor = System.Drawing.Color.White;
		point2 = (Label5.Location = new System.Drawing.Point(26, 123));
		Label5.Name = "Label5";
		size2 = (Label5.Size = new System.Drawing.Size(371, 42));
		Label5.TabIndex = 10;
		Label5.Text = "Enter your Registration Code, Then Click Register and Click \"Download Key File\", Place it in the System Security Folder.";
		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(400, 166));
		Controls.Add(Label5);
		Controls.Add(Button1);
		Controls.Add(Label4);
		Controls.Add(Button3);
		Controls.Add(Button2);
		Controls.Add(Label3);
		Controls.Add(TextBox1);
		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 = "Register";
		System.Windows.Forms.Padding padding2 = (Padding = new System.Windows.Forms.Padding(9));
		ShowInTaskbar = false;
		StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
		Text = "Register";
		TopMost = true;
		ResumeLayout(false);
		PerformLayout();
	}

	private void Quit_Load(object sender, EventArgs e)
	{
		if (((ServerComputer)MyProject.Computer).get_FileSystem().FileExists("RegSS10.dll.egisenc"))
		{
			TextBox1.Text = "You have Registered, Thank you!";
			Button1.Enabled = false;
			Button2.Enabled = false;
			Button3.Enabled = false;
			TextBox1.Enabled = false;
			Label4.Visible = true;
			ToolTip1.SetToolTip(Button1, "Thanks for Registering.");
		}
		else
		{
			ToolTip1.SetToolTip(Button1, "Click here to Download the Key File, You will have to Place it in the Same Folder as System Security 2010.");
		}
	}

	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 Button3_Click(object sender, EventArgs e)
	{
		if (Operators.CompareString(TextBox1.Text, "}Start-3193KDSN=#K#-}}203DOES{{2033", false) == 0)
		{
			((Computer)MyProject.Computer).get_Audio().Play((Stream)Resources.Registered, (AudioPlayMode)1);
			TextBox1.BackColor = Color.Green;
			TextBox1.Text = "Now Please click Download Key File.";
			Button2.Enabled = false;
			Button3.Enabled = false;
			Button1.Enabled = true;
			TextBox1.Enabled = false;
			MyProject.Forms.Form1.Button2.Enabled = false;
			MyProject.Forms.Form1.Button2.Text = "Unregistered";
			MyProject.Forms.Form1.Label2.Text = "Unregistered.";
			MyProject.Forms.Form1.RegisterToolStripMenuItem.Text = "1/2 Registered";
			Label4.Visible = true;
		}
		else
		{
			((Computer)MyProject.Computer).get_Audio().Play((Stream)Resources.Register_Failed, (AudioPlayMode)1);
			TextBox1.BackColor = Color.Red;
		}
	}

	private void Button2_Click(object sender, EventArgs e)
	{
		((Computer)MyProject.Computer).get_Audio().PlaySystemSound(SystemSounds.Hand);
	}

	private void Label4_Click(object sender, EventArgs e)
	{
		Close();
	}

	private void Button1_Click_1(object sender, EventArgs e)
	{
	}
}
