namespace VaioxOnline
{
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Drawing;
    using System.IO;
    using System.Net;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;
    using VaioxOnline.My;

    [DesignerGenerated]
    public class VotePlay : Form
    {
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("FlatClose1")]
        private FlatClose _FlatClose1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("FlatLabel1")]
        private FlatLabel _FlatLabel1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("FlatMini1")]
        private FlatMini _FlatMini1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("FlatStatusBar1")]
        private FlatStatusBar _FlatStatusBar1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("PictureBox1")]
        private PictureBox _PictureBox1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("Timer1")]
        private System.Windows.Forms.Timer _Timer1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("WebBrowser1")]
        private WebBrowser _WebBrowser1;
        [CompilerGenerated, DebuggerBrowsable(DebuggerBrowsableState.Never), AccessedThroughProperty("wlc")]
        private WebClient _wlc;
        private IContainer components;
        private string nPath;
        private string nVersion;
        private string UpdateExe;
        private string urlPath;
        private string urlVersion;
        private string version;
        private string voteUrl1;

        public VotePlay()
        {
            base.Load += new EventHandler(this.Form1_Load);
            this.urlVersion = "http://91.121.222.174:81/Update_Launcher/version.txt";
            this.urlPath = "http://91.121.222.174:81/Update_Launcher/path.txt";
            this.UpdateExe = "http://91.121.222.174:81/Update_Launcher/";
            this.version = "1.0.9";
            this.nPath = string.Empty;
            this.nVersion = string.Empty;
            this.wlc = new WebClient();
            this.voteUrl1 = "http://topofgames.com/index.php?do=votes&id=81986";
            this.InitializeComponent();
        }

        private void checkForUpdate()
        {
            try
            {
                this.nVersion = this.wlc.DownloadString(this.urlVersion);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show("Could Not connect to the Patch Server.");
                ProjectData.ClearProjectError();
                return;
            }
            if (Operators.CompareString(this.nVersion, this.version, false) > 0)
            {
                switch (Interaction.MsgBox("A New Version Is available. Please click on 'Ok' to update!", MsgBoxStyle.OkCancel, null))
                {
                    case MsgBoxResult.Ok:
                        Process.Start("UpdateLauncher.exe");
                        Application.Exit();
                        break;

                    case MsgBoxResult.Cancel:
                        Environment.Exit(0);
                        break;
                }
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components > null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void FlatClose1_Click(object sender, EventArgs e)
        {
            Environment.Exit(1);
        }

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

        private void FlatMini1_Click(object sender, EventArgs e)
        {
            base.WindowState = FormWindowState.Minimized;
        }

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

        private void Form1_Load(object sender, EventArgs e)
        {
            if (!System.IO.File.Exists("UpdateLauncher.exe"))
            {
                MyProject.Computer.Network.DownloadFile(this.UpdateExe + "UpdateLauncher.exe", "UpdateLauncher.exe");
            }
            this.checkForUpdate();
            this.WebBrowser1.Navigate(this.voteUrl1);
            this.WebBrowser1.Navigated += new WebBrowserNavigatedEventHandler(this.WebBrowser1_Navigated);
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(VotePlay));
            this.WebBrowser1 = new WebBrowser();
            this.Timer1 = new System.Windows.Forms.Timer(this.components);
            this.FlatStatusBar1 = new FlatStatusBar();
            this.FlatMini1 = new FlatMini();
            this.FlatClose1 = new FlatClose();
            this.FlatLabel1 = new FlatLabel();
            this.PictureBox1 = new PictureBox();
            ((ISupportInitialize) this.PictureBox1).BeginInit();
            base.SuspendLayout();
            this.WebBrowser1.Location = new Point(-1, 0x27);
            this.WebBrowser1.MinimumSize = new Size(20, 20);
            this.WebBrowser1.Name = "WebBrowser1";
            this.WebBrowser1.Size = new Size(0x330, 0x105);
            this.WebBrowser1.TabIndex = 3;
            this.Timer1.Enabled = true;
            this.Timer1.Interval = 0x3e8;
            this.FlatStatusBar1.BaseColor = Color.FromArgb(0x2d, 0x2f, 0x31);
            this.FlatStatusBar1.Dock = DockStyle.Bottom;
            this.FlatStatusBar1.Font = new Font("Segoe UI", 8f);
            this.FlatStatusBar1.ForeColor = Color.White;
            this.FlatStatusBar1.Location = new Point(0, 0x12d);
            this.FlatStatusBar1.Name = "FlatStatusBar1";
            this.FlatStatusBar1.RectColor = Color.FromArgb(0x23, 0xa8, 0x6d);
            this.FlatStatusBar1.ShowTimeDate = false;
            this.FlatStatusBar1.Size = new Size(0x32f, 0x17);
            this.FlatStatusBar1.TabIndex = 6;
            this.FlatStatusBar1.Text = "30  | Continue by voting, or wait!";
            this.FlatStatusBar1.TextColor = Color.White;
            this.FlatMini1.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.FlatMini1.BackColor = Color.White;
            this.FlatMini1.BaseColor = Color.FromArgb(0x2d, 0x2f, 0x31);
            this.FlatMini1.Font = new Font("Marlett", 12f);
            this.FlatMini1.Location = new Point(0x2fd, 7);
            this.FlatMini1.Name = "FlatMini1";
            this.FlatMini1.Size = new Size(0x12, 0x12);
            this.FlatMini1.TabIndex = 5;
            this.FlatMini1.Text = "FlatMini1";
            this.FlatMini1.TextColor = Color.FromArgb(0xf3, 0xf3, 0xf3);
            this.FlatClose1.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.FlatClose1.BackColor = Color.White;
            this.FlatClose1.BaseColor = Color.FromArgb(0xa8, 0x23, 0x23);
            this.FlatClose1.Font = new Font("Marlett", 10f);
            this.FlatClose1.Location = new Point(0x315, 7);
            this.FlatClose1.Name = "FlatClose1";
            this.FlatClose1.Size = new Size(0x12, 0x12);
            this.FlatClose1.TabIndex = 4;
            this.FlatClose1.Text = "FlatClose1";
            this.FlatClose1.TextColor = Color.FromArgb(0xf3, 0xf3, 0xf3);
            this.FlatLabel1.AutoSize = true;
            this.FlatLabel1.BackColor = Color.Transparent;
            this.FlatLabel1.Font = new Font("Segoe UI", 8f);
            this.FlatLabel1.ForeColor = Color.White;
            this.FlatLabel1.Location = new Point(12, 10);
            this.FlatLabel1.Name = "FlatLabel1";
            this.FlatLabel1.Size = new Size(0x2f0, 13);
            this.FlatLabel1.TabIndex = 7;
            this.FlatLabel1.Text = "Vaiox Online | Vote                                                                                                                  Please click on 'yes' to vote for us! Don't use the 'enter' key.\r\n";
            this.PictureBox1.BackColor = Color.FromArgb(0x2d, 0x2f, 0x31);
            this.PictureBox1.Location = new Point(0x31e, 0x12d);
            this.PictureBox1.Name = "PictureBox1";
            this.PictureBox1.Size = new Size(0x11, 0x17);
            this.PictureBox1.TabIndex = 8;
            this.PictureBox1.TabStop = false;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            this.BackColor = SystemColors.WindowText;
            base.ClientSize = new Size(0x32f, 0x144);
            base.Controls.Add(this.PictureBox1);
            base.Controls.Add(this.FlatLabel1);
            base.Controls.Add(this.FlatStatusBar1);
            base.Controls.Add(this.FlatMini1);
            base.Controls.Add(this.FlatClose1);
            base.Controls.Add(this.WebBrowser1);
            base.FormBorderStyle = FormBorderStyle.None;
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.Name = "VotePlay";
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Vaiox Online | Vote";
            base.TransparencyKey = Color.Fuchsia;
            ((ISupportInitialize) this.PictureBox1).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void PictureBox1_Click(object sender, EventArgs e)
        {
            this.Timer1.Stop();
            base.Hide();
            MyProject.Forms.Login.Show();
        }

        private void Timer1_Tick(object sender, EventArgs e)
        {
            this.FlatStatusBar1.Text = Conversions.ToString((double) (Conversion.Val(this.FlatStatusBar1.Text) - 1.0)) + " | Continue voting, or wait!";
            if (this.FlatStatusBar1.Text == "0 | Continue voting, or wait!")
            {
                base.Hide();
                this.Timer1.Stop();
                MyProject.Forms.Login.Show();
            }
        }

        private void WebBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
        }

        private void WebBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e)
        {
            if (Operators.CompareString(e.Url.Host, this.WebBrowser1.Url.Host, false) <= 0)
            {
                string str = e.Url.ToString();
                if (str != this.voteUrl1)
                {
                    if (str == "http://topofgames.com/")
                    {
                        base.Hide();
                        MyProject.Forms.Login.Show();
                    }
                    else
                    {
                        MessageBox.Show("Please enter the correct code!");
                        this.WebBrowser1.Navigate(this.voteUrl1);
                    }
                }
            }
        }

        internal virtual FlatClose FlatClose1
        {
            [CompilerGenerated]
            get => 
                this._FlatClose1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.FlatClose1_Click);
                FlatClose close = this._FlatClose1;
                if (close != null)
                {
                    close.Click -= handler;
                }
                this._FlatClose1 = value;
                close = this._FlatClose1;
                if (close != null)
                {
                    close.Click += handler;
                }
            }
        }

        internal virtual FlatLabel FlatLabel1
        {
            [CompilerGenerated]
            get => 
                this._FlatLabel1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.FlatLabel1_Click);
                FlatLabel label = this._FlatLabel1;
                if (label != null)
                {
                    label.Click -= handler;
                }
                this._FlatLabel1 = value;
                label = this._FlatLabel1;
                if (label != null)
                {
                    label.Click += handler;
                }
            }
        }

        internal virtual FlatMini FlatMini1
        {
            [CompilerGenerated]
            get => 
                this._FlatMini1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.FlatMini1_Click);
                FlatMini mini = this._FlatMini1;
                if (mini != null)
                {
                    mini.Click -= handler;
                }
                this._FlatMini1 = value;
                mini = this._FlatMini1;
                if (mini != null)
                {
                    mini.Click += handler;
                }
            }
        }

        internal virtual FlatStatusBar FlatStatusBar1
        {
            [CompilerGenerated]
            get => 
                this._FlatStatusBar1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                this._FlatStatusBar1 = value;
            }
        }

        internal virtual PictureBox PictureBox1
        {
            [CompilerGenerated]
            get => 
                this._PictureBox1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.PictureBox1_Click);
                PictureBox box = this._PictureBox1;
                if (box != null)
                {
                    box.Click -= handler;
                }
                this._PictureBox1 = value;
                box = this._PictureBox1;
                if (box != null)
                {
                    box.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Timer Timer1
        {
            [CompilerGenerated]
            get => 
                this._Timer1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                EventHandler handler = new EventHandler(this.Timer1_Tick);
                System.Windows.Forms.Timer timer = this._Timer1;
                if (timer != null)
                {
                    timer.Tick -= handler;
                }
                this._Timer1 = value;
                timer = this._Timer1;
                if (timer != null)
                {
                    timer.Tick += handler;
                }
            }
        }

        internal virtual WebBrowser WebBrowser1
        {
            [CompilerGenerated]
            get => 
                this._WebBrowser1
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                WebBrowserDocumentCompletedEventHandler handler = new WebBrowserDocumentCompletedEventHandler(this.WebBrowser1_DocumentCompleted);
                WebBrowser browser = this._WebBrowser1;
                if (browser != null)
                {
                    browser.DocumentCompleted -= handler;
                }
                this._WebBrowser1 = value;
                browser = this._WebBrowser1;
                if (browser != null)
                {
                    browser.DocumentCompleted += handler;
                }
            }
        }

        private WebClient wlc
        {
            [CompilerGenerated]
            get => 
                this._wlc
            [MethodImpl(MethodImplOptions.Synchronized), CompilerGenerated]
            set
            {
                this._wlc = value;
            }
        }
    }
}

