<|start_filename|>WinNetMeter.Shell/Helper/DbManager.cs<|end_filename|>
﻿using System;
using System.Data.SQLite;
using System.IO;
using System.Windows.Forms;

namespace WinNetMeter.Shell.Helper
{
    public class DbManager
    {
        private string dbPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"/WinNetMeter/data.db";
        private string connectionQuery;
        private SQLiteConnection connection;
        private SQLiteCommand command;

        public DbManager()
        {
            //Create SQLite file if not exists
            if (!File.Exists(dbPath)) CreateDatabase();
        }

        public void CreateDatabase()
        {
            //Check If directory exists
            if (!Directory.Exists(Path.GetDirectoryName(dbPath))) Directory.CreateDirectory(Path.GetDirectoryName(dbPath));

            //Create SQLite database file
            SQLiteConnection.CreateFile(dbPath);

            connection = new SQLiteConnection("DataSource=" + dbPath + ";Version=3");
            if (connection.State == System.Data.ConnectionState.Closed) connection.Open();

            //Create adapter table
            command = new SQLiteCommand("CREATE TABLE adapter(Id INTEGER PRIMARY KEY, Name TEXT NOT NULL)", connection);

            try
            {
                command.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("There is an error when creating table " + Environment.NewLine + ex.Message, "An Error occurred", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            command.Dispose();

            //Create traffic table

            command = new SQLiteCommand("CREATE TABLE traffic(Id INTEGER PRIMARY KEY, Date VARCHAR(255), Sent TEXT NOT NULL, Received TEXT)", connection);

            try
            {
                command.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show("There is an error when creating table " + Environment.NewLine + ex.Message, "An Error occurred", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        public void Insert(string value)
        {
        }
    }
}

<|start_filename|>WinNetMeter/Program.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinNetMeter
{
    static class Program
    {
        static Mutex m;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            bool first = false;
            m = new Mutex(true, Application.ProductName.ToString(), out first);
            if ((first))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                if (Properties.Settings.Default.FirstLaunch == true)
                {
                    Application.Run(new Setup());
                }
                else
                {
                    Application.Run(new Main());
                }
            }
            else
            {
                MessageBox.Show(Application.ProductName.ToString() + " Already running");
            }

           

        }
    }
}


<|start_filename|>WinNetMeter.Core/Views/FrmFlyOut.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WinNetMeter.Core.Views
{
    public partial class FrmFlyOut : Form
    {
        public FrmFlyOut()
        {
            InitializeComponent();
        }

        private void FrmFlyOut_Load(object sender, EventArgs e)
        {
            Screen rightmost = Screen.AllScreens[0];
            foreach (Screen screen in Screen.AllScreens)
            {
                if (screen.WorkingArea.Right > rightmost.WorkingArea.Right)
                    rightmost = screen;
            }

            this.Left = rightmost.WorkingArea.Right - this.Width;
            this.Top = rightmost.WorkingArea.Bottom - this.Height;
        }


    }
}


<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage2.cs<|end_filename|>
﻿using System;
using System.Windows.Forms;

namespace WinNetMeter.UserControls.FirstRun
{
    public partial class StartPage2 : UserControl
    {
        public StartPage2()
        {
            InitializeComponent();
        }

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

<|start_filename|>WinNetMeter.Shell/Model/TrafficLog.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinNetMeter.Shell.Model
{
    public class TrafficLog
    {

    }
}


<|start_filename|>WinNetMeter/UserControls/Pages/Log.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;
using WinNetMeter.Core.Model;
using WinNetMeter.Core.Services;

namespace WinNetMeter.UserControls.Pages
{
    public partial class Log : UserControl
    {
        private RegistryManager registryManager = new RegistryManager();

        public Log()
        {
            InitializeComponent();

            #region DatabaseConfiguration

            var dbConfig = registryManager.GetDatabaseConfiguration();
            toggleTraffic.Checked = dbConfig.TrafficLogging;
            txtLogPath.Text = dbConfig.CustomLogLocation;

            #endregion DatabaseConfiguration
        }

        private void BtnSaveLog_Click(object sender, EventArgs e)
        {
            DatabaseConfiguration databaseConfiguration = new DatabaseConfiguration { TrafficLogging = toggleTraffic.Checked };
            if (toggleTraffic.Checked == true && txtLogPath.Text == "")
            {
                MessageBox.Show(this, "You have not set Log path", "Oopss!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (txtLogPath.Text != null && toggleTraffic.Checked == true)
                {
                    databaseConfiguration.CustomLogLocation = txtLogPath.Text;
                }
                else databaseConfiguration.CustomLogLocation = "Not available";
                registryManager.Save(databaseConfiguration);
                MessageBox.Show(this, "Settings saved successfully", "Saved!!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }

        private void ToggleTraffic_CheckedChanged(object sender, EventArgs e)
        {
            bool check = (toggleTraffic.Checked) ? groupBox1.Enabled = true : groupBox1.Enabled = false;
        }

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

        private void BtnTestHit_Click(object sender, EventArgs e)
        {
            //var data = new Dictionary<string, string>()
            //{
            //    {"date", DateTime.Now.ToShortDateString() },
            //    {"time", DateTime.Now.ToShortTimeString() },
            //    {"download", "1024" },
            //    {"upload", "768" }
            //};

            //TrafficLogs.Save(data);

            EventLog.WriteLog("Test log");
        }
    }
}

<|start_filename|>WinNetMeter.Core/Model/Configuration.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinNetMeter.Core.Model
{
    public class Configuration
    {
        private bool monitoring;
        private bool autoUpdate;
        private Language language;
        private string format;
        private string monitoredAdapter;

        public bool Monitoring { get => monitoring; set => monitoring = value; }
        public bool AutoUpdate { get => autoUpdate; set => autoUpdate = value; }
        public Language Language { get => language; set => language = value; }
        public string Format { get => format; set => format = value; }
        public string MonitoredAdapter { get => monitoredAdapter; set => monitoredAdapter = value; }
       
    }
}


<|start_filename|>WinNetMeter/Setup.Designer.cs<|end_filename|>
﻿using System.Drawing;

namespace WinNetMeter
{
    partial class Setup
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Setup));
            this.panel1 = new System.Windows.Forms.Panel();
            this.btnNext = new System.Windows.Forms.Button();
            this.panel2 = new System.Windows.Forms.Panel();
            this.lblProductDesc = new System.Windows.Forms.Label();
            this.lblProductName = new System.Windows.Forms.Label();
            this.panelContainer = new System.Windows.Forms.Panel();
            this.metroLink2 = new MetroFramework.Controls.MetroLink();
            this.linkBack = new MetroFramework.Controls.MetroLink();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.btnNext);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel1.Location = new System.Drawing.Point(0, 437);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(803, 54);
            this.panel1.TabIndex = 0;
            // 
            // btnNext
            // 
            this.btnNext.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(152)))), ((int)(((byte)(219)))));
            this.btnNext.FlatAppearance.BorderSize = 0;
            this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnNext.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnNext.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.btnNext.Location = new System.Drawing.Point(336, 12);
            this.btnNext.Name = "btnNext";
            this.btnNext.Size = new System.Drawing.Size(92, 29);
            this.btnNext.TabIndex = 0;
            this.btnNext.Text = "Next";
            this.btnNext.UseVisualStyleBackColor = false;
            this.btnNext.Click += new System.EventHandler(this.BtnNext_Click);
            // 
            // panel2
            // 
            this.panel2.Controls.Add(this.metroLink2);
            this.panel2.Controls.Add(this.lblProductDesc);
            this.panel2.Controls.Add(this.lblProductName);
            this.panel2.Controls.Add(this.linkBack);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location = new System.Drawing.Point(0, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(803, 47);
            this.panel2.TabIndex = 1;
            // 
            // lblProductDesc
            // 
            this.lblProductDesc.AutoSize = true;
            this.lblProductDesc.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblProductDesc.ForeColor = System.Drawing.SystemColors.ControlDark;
            this.lblProductDesc.Location = new System.Drawing.Point(139, 13);
            this.lblProductDesc.Name = "lblProductDesc";
            this.lblProductDesc.Size = new System.Drawing.Size(245, 21);
            this.lblProductDesc.TabIndex = 4;
            this.lblProductDesc.Text = "| Realtime network speed monitor";
            // 
            // lblProductName
            // 
            this.lblProductName.Font = new System.Drawing.Font("Segoe UI Semibold", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblProductName.Location = new System.Drawing.Point(12, 11);
            this.lblProductName.Name = "lblProductName";
            this.lblProductName.Size = new System.Drawing.Size(130, 25);
            this.lblProductName.TabIndex = 0;
            this.lblProductName.Text = "WinNetMeter";
            // 
            // panelContainer
            // 
            this.panelContainer.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panelContainer.Location = new System.Drawing.Point(0, 47);
            this.panelContainer.Name = "panelContainer";
            this.panelContainer.Size = new System.Drawing.Size(803, 390);
            this.panelContainer.TabIndex = 2;
            // 
            // metroLink2
            // 
            this.metroLink2.Image = global::WinNetMeter.Properties.Resources.baseline_help_outline_black_18dp;
            this.metroLink2.Location = new System.Drawing.Point(761, 9);
            this.metroLink2.Name = "metroLink2";
            this.metroLink2.Size = new System.Drawing.Size(33, 26);
            this.metroLink2.TabIndex = 5;
            this.metroLink2.UseSelectable = true;
            // 
            // linkBack
            // 
            this.linkBack.Image = global::WinNetMeter.Properties.Resources.baseline_arrow_back_black_24dp;
            this.linkBack.Location = new System.Drawing.Point(8, 11);
            this.linkBack.Name = "linkBack";
            this.linkBack.Size = new System.Drawing.Size(33, 26);
            this.linkBack.TabIndex = 2;
            this.linkBack.UseSelectable = true;
            this.linkBack.Click += new System.EventHandler(this.LinkBack_Click);
            // 
            // Setup
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ButtonHighlight;
            this.ClientSize = new System.Drawing.Size(803, 491);
            this.Controls.Add(this.panelContainer);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.MaximumSize = new System.Drawing.Size(819, 530);
            this.Name = "Setup";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Setup";
            this.Load += new System.EventHandler(this.Setup_Load);
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Button btnNext;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Label lblProductName;
        private MetroFramework.Controls.MetroLink linkBack;
        private System.Windows.Forms.Panel panelContainer;
        private System.Windows.Forms.Label lblProductDesc;
        private MetroFramework.Controls.MetroLink metroLink2;
    }
}

<|start_filename|>WinNetMeter/UserControls/Pages/IntegrationPage.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.Pages
{
    partial class IntegrationPage
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label21 = new System.Windows.Forms.Label();
            this.label17 = new System.Windows.Forms.Label();
            this.BtnUninstall = new System.Windows.Forms.Button();
            this.label13 = new System.Windows.Forms.Label();
            this.label18 = new System.Windows.Forms.Label();
            this.BtnRegister = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.lblStatus = new System.Windows.Forms.Label();
            this.BtnShow = new System.Windows.Forms.Button();
            this.BtnHide = new System.Windows.Forms.Button();
            this.LinkRefresh = new System.Windows.Forms.LinkLabel();
            this.SuspendLayout();
            // 
            // label21
            // 
            this.label21.AutoSize = true;
            this.label21.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label21.Location = new System.Drawing.Point(20, 147);
            this.label21.Name = "label21";
            this.label21.Size = new System.Drawing.Size(127, 24);
            this.label21.TabIndex = 51;
            this.label21.Text = "Uninstall Shell";
            // 
            // label17
            // 
            this.label17.AutoSize = true;
            this.label17.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label17.Location = new System.Drawing.Point(20, 10);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(156, 24);
            this.label17.TabIndex = 50;
            this.label17.Text = "Re-Register Shell";
            // 
            // BtnUninstall
            // 
            this.BtnUninstall.BackColor = System.Drawing.Color.Transparent;
            this.BtnUninstall.FlatAppearance.BorderColor = System.Drawing.Color.Black;
            this.BtnUninstall.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.BtnUninstall.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.BtnUninstall.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.BtnUninstall.Location = new System.Drawing.Point(25, 223);
            this.BtnUninstall.Name = "BtnUninstall";
            this.BtnUninstall.Size = new System.Drawing.Size(130, 34);
            this.BtnUninstall.TabIndex = 49;
            this.BtnUninstall.Text = "Uninstall Shell";
            this.BtnUninstall.UseVisualStyleBackColor = false;
            this.BtnUninstall.Click += new System.EventHandler(this.BtnUninstall_Click);
            // 
            // label13
            // 
            this.label13.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label13.Location = new System.Drawing.Point(22, 179);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(507, 35);
            this.label13.TabIndex = 48;
            this.label13.Text = "If you want update or uninstall WinNetMeter, you can Uninstall Shell before, \r\nth" +
    "en replace with new Version.";
            // 
            // label18
            // 
            this.label18.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label18.Location = new System.Drawing.Point(24, 43);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(505, 32);
            this.label18.TabIndex = 47;
            this.label18.Text = "If WinNetMeter is not working properly on the TaskBar, You can try Re-Register Sh" +
    "ell.";
            // 
            // BtnRegister
            // 
            this.BtnRegister.BackColor = System.Drawing.Color.Transparent;
            this.BtnRegister.FlatAppearance.BorderColor = System.Drawing.Color.Black;
            this.BtnRegister.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.BtnRegister.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.BtnRegister.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
            this.BtnRegister.Location = new System.Drawing.Point(27, 78);
            this.BtnRegister.Name = "BtnRegister";
            this.BtnRegister.Size = new System.Drawing.Size(128, 35);
            this.BtnRegister.TabIndex = 46;
            this.BtnRegister.Text = "Re-Register Shell";
            this.BtnRegister.UseVisualStyleBackColor = false;
            this.BtnRegister.Click += new System.EventHandler(this.BtnRegister_Click);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(20, 293);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(107, 24);
            this.label1.TabIndex = 52;
            this.label1.Text = "Shell Status";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.Location = new System.Drawing.Point(23, 322);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(45, 15);
            this.label2.TabIndex = 53;
            this.label2.Text = "Status :";
            // 
            // lblStatus
            // 
            this.lblStatus.AutoSize = true;
            this.lblStatus.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblStatus.ForeColor = System.Drawing.Color.Red;
            this.lblStatus.Location = new System.Drawing.Point(65, 322);
            this.lblStatus.Name = "lblStatus";
            this.lblStatus.Size = new System.Drawing.Size(63, 15);
            this.lblStatus.TabIndex = 54;
            this.lblStatus.Text = "Not Active";
            // 
            // BtnShow
            // 
            this.BtnShow.BackColor = System.Drawing.SystemColors.Highlight;
            this.BtnShow.FlatAppearance.BorderSize = 0;
            this.BtnShow.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.BtnShow.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.BtnShow.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.BtnShow.Location = new System.Drawing.Point(25, 350);
            this.BtnShow.Name = "BtnShow";
            this.BtnShow.Size = new System.Drawing.Size(130, 35);
            this.BtnShow.TabIndex = 55;
            this.BtnShow.Text = "Show Shell";
            this.BtnShow.UseVisualStyleBackColor = false;
            this.BtnShow.Click += new System.EventHandler(this.BtnShow_Click);
            // 
            // BtnHide
            // 
            this.BtnHide.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
            this.BtnHide.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.BtnHide.ForeColor = System.Drawing.SystemColors.Highlight;
            this.BtnHide.Location = new System.Drawing.Point(166, 349);
            this.BtnHide.Name = "BtnHide";
            this.BtnHide.Size = new System.Drawing.Size(129, 36);
            this.BtnHide.TabIndex = 56;
            this.BtnHide.Text = "Hide Shell";
            this.BtnHide.UseVisualStyleBackColor = true;
            this.BtnHide.Click += new System.EventHandler(this.BtnHide_Click);
            // 
            // LinkRefresh
            // 
            this.LinkRefresh.AutoSize = true;
            this.LinkRefresh.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.LinkRefresh.Location = new System.Drawing.Point(132, 302);
            this.LinkRefresh.Name = "LinkRefresh";
            this.LinkRefresh.Size = new System.Drawing.Size(46, 13);
            this.LinkRefresh.TabIndex = 57;
            this.LinkRefresh.TabStop = true;
            this.LinkRefresh.Text = "Refresh";
            this.LinkRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkRefresh_LinkClicked);
            // 
            // IntegrationPage
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this.Controls.Add(this.LinkRefresh);
            this.Controls.Add(this.lblStatus);
            this.Controls.Add(this.BtnHide);
            this.Controls.Add(this.BtnShow);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.label21);
            this.Controls.Add(this.label17);
            this.Controls.Add(this.BtnUninstall);
            this.Controls.Add(this.label13);
            this.Controls.Add(this.label18);
            this.Controls.Add(this.BtnRegister);
            this.Name = "IntegrationPage";
            this.Size = new System.Drawing.Size(568, 485);
            this.Load += new System.EventHandler(this.IntegrationPage_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.Label label21;
        private System.Windows.Forms.Label label17;
        private System.Windows.Forms.Button BtnUninstall;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.Label label18;
        private System.Windows.Forms.Button BtnRegister;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label lblStatus;
        private System.Windows.Forms.Button BtnShow;
        private System.Windows.Forms.Button BtnHide;
        private System.Windows.Forms.LinkLabel LinkRefresh;
    }
}


<|start_filename|>Updater/Helpers/Integration.cs<|end_filename|>
﻿using System;
using System.Diagnostics;
using System.IO;

namespace Updater.Helper
{
    internal class Integration
    {
        private string batchFileLocation = AppDomain.CurrentDomain.BaseDirectory + @"temp\toolbarInstaller.bat";
        private string FrameworkLocation;
        private StreamWriter writer;

        public Integration()
        {
        }

        private void WriteBatFile(string value, bool NewLine)
        {
            writer = new StreamWriter(batchFileLocation, true);
            if (NewLine) writer.Write(Environment.NewLine);

            //Write the .bat script
            writer.Write(value);

            //Close the tread
            writer.Close();
        }

        public void InstallToolbar()
        {
            //Create .bat file for toolbar installation
            if (!Directory.Exists(Path.GetDirectoryName(batchFileLocation)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(batchFileLocation));
            }


            File.Create(batchFileLocation).Close();

            //Get .NET Framework path Information
            if (Environment.Is64BitOperatingSystem)
            {
                FrameworkLocation = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework64\v4.0.30319";
                if (Directory.Exists(FrameworkLocation))
                {
                    WriteBatFile("cd " + FrameworkLocation, false);
                    WriteBatFile("regasm /codebase " + "\"" + AppDomain.CurrentDomain.BaseDirectory + @"WinNetMeter.Shell.dll" + "\"", true);
                }
            }
            else
            {
                FrameworkLocation = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework\v4.0.30319";
                if (Directory.Exists(FrameworkLocation))
                {
                    WriteBatFile("cd " + FrameworkLocation, false);
                    WriteBatFile("regasm /codebase " + "\"" + AppDomain.CurrentDomain.BaseDirectory + @"WinNetMeter.Shell.dll" + "\"", true);
                }
            }

            //Executing the .bat file
            runBat();
        }

        public void UninstallToolbar()
        {
            //Create .bat file for toolbar installation
            if (!Directory.Exists(Path.GetDirectoryName(batchFileLocation)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(batchFileLocation));
            }
            File.Create(batchFileLocation).Close();

            //Get .NET Framework path Information
            if (Environment.Is64BitOperatingSystem)
            {
                FrameworkLocation = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework64\v4.0.30319";
            }
            else
            {
                FrameworkLocation = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework\v4.0.30319";
            }

            if (Directory.Exists(FrameworkLocation))
            {
                WriteBatFile("cd " + FrameworkLocation, false);
                WriteBatFile("regasm /unregister " + "\"" + AppDomain.CurrentDomain.BaseDirectory + @"WinNetMeter.Shell.dll" + "\"", true);
            }

            //Executing the .bat file
            runBat();
        }

        public void ReinstallToolbar()
        {
            //Create .bat file for toolbar installation
            if (!Directory.Exists(Path.GetDirectoryName(batchFileLocation)))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(batchFileLocation));
            }
            File.Create(batchFileLocation).Close();

            //Get .NET Framework path Information
            if (Environment.Is64BitOperatingSystem)
            {
                FrameworkLocation = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework64\v4.0.30319";
            }
            else
            {
                FrameworkLocation = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework\v4.0.30319";
            }

            if (Directory.Exists(FrameworkLocation))
            {
                WriteBatFile("cd " + FrameworkLocation, false);

                // Unregister .dll
                WriteBatFile("regasm /unregister " + "\"" + AppDomain.CurrentDomain.BaseDirectory + @"WinNetMeter.Shell.dll" + "\"", true);

                // Register .dll
                WriteBatFile("regasm /codebase " + "\"" + AppDomain.CurrentDomain.BaseDirectory + @"WinNetMeter.Shell.dll" + "\"", true);
            }

            //Executing the .bat file
            runBat();
        }

        private void runBat()
        {
            //Executing the .bat file
            ProcessStartInfo process = new ProcessStartInfo();
            process.WorkingDirectory = Path.GetDirectoryName(batchFileLocation);
            process.FileName = "toolbarInstaller.bat";
            process.Verb = "runas";
            process.WindowStyle = ProcessWindowStyle.Hidden;
            try
            {
                Process.Start(process);
            }
            catch { }
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/Pages/UpdaterPage.cs<|end_filename|>
﻿using System;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;
using WinNetMeter.Helper;

namespace WinNetMeter.UserControls.Pages
{
    public partial class UpdaterPage : UserControl
    {
        private RegistryManager registryManager = new RegistryManager();

        public UpdaterPage()
        {
            InitializeComponent();
            if (ThisApp.IsUwpApp())
            {
                appUpdater1.Visible=false;
            }
        }

        private void BtnReset_Click(object sender, EventArgs e)
        {
            switch (MessageBox.Show(this, "Are you sure?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
            {
                case DialogResult.Yes:
                    // Delete all registry entries
                    registryManager.Reset();

                    // Restore to default
                    registryManager.CreateRegistry();
                    registryManager.MakeDefaultConfiguration();
                    var setupForm = new Setup();

                    MessageBox.Show("Application settings has been reset", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    setupForm.Show();
                    ((Form)this.TopLevelControl).Hide();
                    break;
            }
        }
    }
}

<|start_filename|>WinNetMeter.Core/Helper/NetworkMonitor.cs<|end_filename|>
﻿using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Timers;
using Microsoft.Win32.SafeHandles;
using WinNetMeter.Core.Controllers;

namespace WinNetMeter.Core.Helper
{
    public class NetworkMonitor : IDisposable
    {
        private AdapterController adapter;
        private Timer monitor;
        private bool disposed = false;
        private SafeHandle handle = new SafeFileHandle(IntPtr.Zero, true);

        public NetworkMonitor(AdapterController adapterC)
        {
            this.adapter = adapterC;
            InitAdapter();
            monitor = new Timer();
            monitor.Interval = 1000;
            monitor.Elapsed += Monitor_Elapsed;
        }

        public void Dispose()
        {
            // Dispose of unmanaged resources.
            Dispose(true);
            // Suppress finalization.
            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
                return;
            if (disposing)
            {
                handle.Dispose();
            }
            disposed = true;
        }

        private void Monitor_Elapsed(object sender, ElapsedEventArgs e)
        {
            adapter.Refresh();
        }

        public void InitAdapter()
        {
            PerformanceCounterCategory counterCategory = new PerformanceCounterCategory("Network Interface");

            foreach (string name in counterCategory.GetInstanceNames())
            {
                if (name == adapter.AdapaterName)
                {
                    adapter.DownloadSpeedCounter = new PerformanceCounter("Network Interface", "Bytes Received/sec", name);
                    adapter.UploadSpeedCounter = new PerformanceCounter("Network Interface", "Bytes Sent/sec", name);
                }
            }
        }

        public void Start()
        {
            if (!(this.adapter.AdapaterName == null))
            {
                adapter.Initialize();
                monitor.Enabled = true;
            }
        }

        public void Stop()
        {
            monitor.Enabled = false;
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/Pages/About.cs<|end_filename|>
﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using WinNetMeter.Core.Views;

namespace WinNetMeter.UserControls.Pages
{
    public partial class About : UserControl
    {
        public About()
        {
            InitializeComponent();
        }

        #region Link

        private void LinkArfan_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://www.facebook.com/MArfan890");
        }

        private void LinkAzhe_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://www.facebook.com/azhe403");
        }

        private void LinkJeremy_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://www.facebook.com/SiiJere");
        }

        private void LinkJovan_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://www.facebook.com/jovanzers");
        }

        private void LinkWebsite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://www.winten.tk");
        }

        private void LinkGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://github.com/WinTenDev");
        }

        private void LinkDonation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FWM2D25VHMERG&source=url");
        }

        #endregion

        private void About_Load(object sender, EventArgs e)
        {
            var assemblyInfo = Assembly.GetExecutingAssembly();
            var assemblyCompany = assemblyInfo
            .GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)
            .OfType<AssemblyCompanyAttribute>()
            .FirstOrDefault();

            lblVersion.Text = "v" + Application.ProductVersion;
            lblCopyright.Text = "Copyright © 2019 " + assemblyCompany.Company;
        }

        private void LinkReport_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("https://t.me/WinTenGroup");
        }

        private void BtnTest_Click(object sender, EventArgs e)
        {
            var updaterForm = new FormUpdater();
            updaterForm.Show();
        }
    }
}


<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage3.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.FirstRun
{
    partial class StartPage3
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.listAdapter = new System.Windows.Forms.ListBox();
            this.lblDetecting = new System.Windows.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(92, 176);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(589, 36);
            this.label1.TabIndex = 2;
            this.label1.Text = "Select Network adapter";
            this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Image = global::WinNetMeter.Properties.Resources.router_180px;
            this.pictureBox1.Location = new System.Drawing.Point(277, 32);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(206, 129);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pictureBox1.TabIndex = 3;
            this.pictureBox1.TabStop = false;
            // 
            // listAdapter
            // 
            this.listAdapter.BackColor = System.Drawing.SystemColors.Control;
            this.listAdapter.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.listAdapter.Enabled = false;
            this.listAdapter.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.listAdapter.FormattingEnabled = true;
            this.listAdapter.ItemHeight = 15;
            this.listAdapter.Location = new System.Drawing.Point(201, 234);
            this.listAdapter.Name = "listAdapter";
            this.listAdapter.Size = new System.Drawing.Size(384, 150);
            this.listAdapter.TabIndex = 4;
            this.listAdapter.SelectedIndexChanged += new System.EventHandler(this.ListAdapter_SelectedIndexChanged);
            // 
            // lblDetecting
            // 
            this.lblDetecting.AutoSize = true;
            this.lblDetecting.BackColor = System.Drawing.Color.Transparent;
            this.lblDetecting.Font = new System.Drawing.Font("Segoe UI Semibold", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblDetecting.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
            this.lblDetecting.Location = new System.Drawing.Point(259, 296);
            this.lblDetecting.Name = "lblDetecting";
            this.lblDetecting.Size = new System.Drawing.Size(253, 17);
            this.lblDetecting.TabIndex = 6;
            this.lblDetecting.Text = "Detecting network adapter, please wait...";
            this.lblDetecting.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // StartPage3
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.lblDetecting);
            this.Controls.Add(this.listAdapter);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.label1);
            this.Name = "StartPage3";
            this.Size = new System.Drawing.Size(819, 510);
            this.Load += new System.EventHandler(this.StartPage3_Load);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.ListBox listAdapter;
        private System.Windows.Forms.Label lblDetecting;
    }
}


<|start_filename|>WinNetMeter/UserControls/Pages/General.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.Pages
{
    partial class General
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label26 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.ListAdapter = new System.Windows.Forms.ListBox();
            this.label3 = new System.Windows.Forms.Label();
            this.ToggleMonitor = new MetroFramework.Controls.MetroToggle();
            this.ToggleAutoUpdate = new MetroFramework.Controls.MetroToggle();
            this.btnSaveGeneral = new System.Windows.Forms.Button();
            this.metroComboBox3 = new MetroFramework.Controls.MetroComboBox();
            this.cmbFormat = new MetroFramework.Controls.MetroComboBox();
            this.radioIndonesia = new MetroFramework.Controls.MetroRadioButton();
            this.radioEnglish = new MetroFramework.Controls.MetroRadioButton();
            this.label1 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            // 
            // label26
            // 
            this.label26.AutoSize = true;
            this.label26.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label26.Location = new System.Drawing.Point(25, 142);
            this.label26.Name = "label26";
            this.label26.Size = new System.Drawing.Size(137, 17);
            this.label26.TabIndex = 14;
            this.label26.Text = "Server Update Stream";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label4.Location = new System.Drawing.Point(24, 11);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(73, 17);
            this.label4.TabIndex = 5;
            this.label4.Text = "Monitoring";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label7.Location = new System.Drawing.Point(25, 98);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(49, 17);
            this.label7.TabIndex = 9;
            this.label7.Text = "Format";
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label6.Location = new System.Drawing.Point(24, 53);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(187, 17);
            this.label6.TabIndex = 8;
            this.label6.Text = "Automatically check for update";
            // 
            // ListAdapter
            // 
            this.ListAdapter.BackColor = System.Drawing.SystemColors.Control;
            this.ListAdapter.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.ListAdapter.CausesValidation = false;
            this.ListAdapter.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.ListAdapter.FormattingEnabled = true;
            this.ListAdapter.ItemHeight = 15;
            this.ListAdapter.Location = new System.Drawing.Point(29, 274);
            this.ListAdapter.Name = "ListAdapter";
            this.ListAdapter.Size = new System.Drawing.Size(510, 90);
            this.ListAdapter.TabIndex = 2;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.ForeColor = System.Drawing.SystemColors.Highlight;
            this.label3.Location = new System.Drawing.Point(26, 238);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(143, 21);
            this.label3.TabIndex = 3;
            this.label3.Text = "Network Interface";
            // 
            // ToggleMonitor
            // 
            this.ToggleMonitor.AutoSize = true;
            this.ToggleMonitor.Location = new System.Drawing.Point(439, 11);
            this.ToggleMonitor.Name = "ToggleMonitor";
            this.ToggleMonitor.Size = new System.Drawing.Size(80, 17);
            this.ToggleMonitor.TabIndex = 4;
            this.ToggleMonitor.Text = "Off";
            this.ToggleMonitor.UseSelectable = true;
            // 
            // ToggleAutoUpdate
            // 
            this.ToggleAutoUpdate.AutoSize = true;
            this.ToggleAutoUpdate.Location = new System.Drawing.Point(439, 53);
            this.ToggleAutoUpdate.Name = "ToggleAutoUpdate";
            this.ToggleAutoUpdate.Size = new System.Drawing.Size(80, 17);
            this.ToggleAutoUpdate.TabIndex = 7;
            this.ToggleAutoUpdate.Text = "Off";
            this.ToggleAutoUpdate.UseSelectable = true;
            // 
            // btnSaveGeneral
            // 
            this.btnSaveGeneral.BackColor = System.Drawing.Color.Transparent;
            this.btnSaveGeneral.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
            this.btnSaveGeneral.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnSaveGeneral.ForeColor = System.Drawing.Color.Black;
            this.btnSaveGeneral.Image = global::WinNetMeter.Properties.Resources.Checked_outline_16px;
            this.btnSaveGeneral.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnSaveGeneral.Location = new System.Drawing.Point(418, 376);
            this.btnSaveGeneral.Name = "btnSaveGeneral";
            this.btnSaveGeneral.Size = new System.Drawing.Size(121, 33);
            this.btnSaveGeneral.TabIndex = 16;
            this.btnSaveGeneral.Text = "  Save";
            this.btnSaveGeneral.UseVisualStyleBackColor = false;
            this.btnSaveGeneral.Click += new System.EventHandler(this.BtnSaveGeneral_Click);
            // 
            // metroComboBox3
            // 
            this.metroComboBox3.Enabled = false;
            this.metroComboBox3.FormattingEnabled = true;
            this.metroComboBox3.ItemHeight = 23;
            this.metroComboBox3.Location = new System.Drawing.Point(337, 137);
            this.metroComboBox3.Name = "metroComboBox3";
            this.metroComboBox3.Size = new System.Drawing.Size(182, 29);
            this.metroComboBox3.TabIndex = 21;
            this.metroComboBox3.UseSelectable = true;
            // 
            // cmbFormat
            // 
            this.cmbFormat.FormattingEnabled = true;
            this.cmbFormat.ItemHeight = 23;
            this.cmbFormat.Items.AddRange(new object[] {
            "Auto",
            "KB",
            "MB"});
            this.cmbFormat.Location = new System.Drawing.Point(337, 90);
            this.cmbFormat.Name = "cmbFormat";
            this.cmbFormat.Size = new System.Drawing.Size(182, 29);
            this.cmbFormat.TabIndex = 19;
            this.cmbFormat.UseSelectable = true;
            // 
            // radioIndonesia
            // 
            this.radioIndonesia.AutoSize = true;
            this.radioIndonesia.Enabled = false;
            this.radioIndonesia.Location = new System.Drawing.Point(438, 189);
            this.radioIndonesia.Name = "radioIndonesia";
            this.radioIndonesia.Size = new System.Drawing.Size(81, 15);
            this.radioIndonesia.TabIndex = 23;
            this.radioIndonesia.Text = "Indonesian";
            this.radioIndonesia.UseSelectable = true;
            // 
            // radioEnglish
            // 
            this.radioEnglish.AutoSize = true;
            this.radioEnglish.Location = new System.Drawing.Point(337, 189);
            this.radioEnglish.Name = "radioEnglish";
            this.radioEnglish.Size = new System.Drawing.Size(61, 15);
            this.radioEnglish.TabIndex = 24;
            this.radioEnglish.Text = "English";
            this.radioEnglish.UseSelectable = true;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(27, 184);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(65, 17);
            this.label1.TabIndex = 25;
            this.label1.Text = "Language";
            // 
            // General
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this.Controls.Add(this.label1);
            this.Controls.Add(this.radioEnglish);
            this.Controls.Add(this.radioIndonesia);
            this.Controls.Add(this.metroComboBox3);
            this.Controls.Add(this.cmbFormat);
            this.Controls.Add(this.label26);
            this.Controls.Add(this.btnSaveGeneral);
            this.Controls.Add(this.label4);
            this.Controls.Add(this.label7);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.ListAdapter);
            this.Controls.Add(this.ToggleAutoUpdate);
            this.Controls.Add(this.ToggleMonitor);
            this.Controls.Add(this.label3);
            this.Name = "General";
            this.Size = new System.Drawing.Size(560, 420);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.Label label26;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.ListBox ListAdapter;
        private System.Windows.Forms.Label label3;
        private MetroFramework.Controls.MetroToggle ToggleMonitor;
        private MetroFramework.Controls.MetroToggle ToggleAutoUpdate;
        private System.Windows.Forms.Button btnSaveGeneral;
        private MetroFramework.Controls.MetroComboBox metroComboBox3;
        private MetroFramework.Controls.MetroComboBox cmbFormat;
        private MetroFramework.Controls.MetroRadioButton radioIndonesia;
        private MetroFramework.Controls.MetroRadioButton radioEnglish;
        private System.Windows.Forms.Label label1;
    }
}


<|start_filename|>WinNetMeter.Core/Controllers/AdapterController.cs<|end_filename|>
﻿using System.Diagnostics;
using WinNetMeter.Core.Helper;

namespace WinNetMeter.Core.Controllers
{
    public class AdapterController
    {
        private string name;
        private long FirstDownloadValue, FirstUploadValue;
        private long DownloadValue, UploadValue;
        private long downloadSpeed, uploadSpeed;
        public PerformanceCounter DownloadSpeedCounter, UploadSpeedCounter;

        public string AdapaterName { get => name; set => name = value; }
        public long DownloadSpeed { get => downloadSpeed; set => downloadSpeed = value; }
        public long UploadSpeed { get => uploadSpeed; set => uploadSpeed = value; }

        public double UploadSpeedKBps { get => this.uploadSpeed / 1024.0; }

        public double DownloadSpeedKBps { get => this.downloadSpeed / 1024.0; }

        public double UploadSpeedMBps { get => (this.uploadSpeed / 1024.0) / 1024.0; }

        public double DownloadSpeedMBps { get => (this.downloadSpeed / 1024.0) / 1024.0; }

        public string DownloadSpeedAutoFormatting { get => Numeric.SizeFormat(this.downloadSpeed, "/s"); }

        public string UploadSpeedAutoFormatting { get => Numeric.SizeFormat(this.uploadSpeed, "/s"); }

        public AdapterController(string adapterName)
        {
            AdapaterName = adapterName;
        }

        public void Initialize()
        {
            this.FirstDownloadValue = DownloadSpeedCounter.NextSample().RawValue;
            this.FirstUploadValue = UploadSpeedCounter.NextSample().RawValue;
        }

        public void Refresh()
        {
            this.DownloadValue = DownloadSpeedCounter.NextSample().RawValue;
            this.UploadValue = UploadSpeedCounter.NextSample().RawValue;

            this.DownloadSpeed = DownloadValue - FirstDownloadValue;
            this.uploadSpeed = UploadValue - FirstUploadValue;

            UpdateFirstValue();
        }

        public void UpdateFirstValue()
        {
            this.FirstDownloadValue = DownloadSpeedCounter.NextSample().RawValue;
            this.FirstUploadValue = UploadSpeedCounter.NextSample().RawValue;
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/Pages/IntegrationPage.cs<|end_filename|>
﻿using System;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;

namespace WinNetMeter.UserControls.Pages
{
    public partial class IntegrationPage : UserControl
    {
        private ShellController shellControlller = new ShellController();
        private Integration integration = new Integration();

        public IntegrationPage()
        {
            InitializeComponent();
        }

        private void BtnRegister_Click(object sender, EventArgs e)
        {
            try
            {
                shellControlller.hideDeskband();
                integration.ReinstallToolbar();
                MessageBox.Show("Re-Register Shell Integration Successfully.", "WinNetMeter Integration",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Something happened. {ex.Message}", "WinNetMeter Integration",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void BtnUninstall_Click(object sender, EventArgs e)
        {
            try
            {
                shellControlller.hideDeskband();
                integration.UninstallToolbar();
                MessageBox.Show("Uninstall Shell Integration Successfully.", "WinNetMeter Integration",
                    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Something happened. {ex.Message}", "WinNetMeter Integration",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void IntegrationPage_Load(object sender, EventArgs e)
        {
            CheckIsShellActive();
        }

        private void BtnShow_Click(object sender, EventArgs e)
        {
            // Call the shell
            shellControlller.callDeskband();

            try
            {
                Main.State = FormWindowState.Minimized;
            }
            catch { }

            // Refresh shell status
            CheckIsShellActive();
        }

        private void CheckIsShellActive()
        {
            if (shellControlller.IsShellShown())
            {
                lblStatus.Text = "Active";
                lblStatus.ForeColor = System.Drawing.Color.Green;
            }
            else
            {
                lblStatus.Text = "Not Active";
                lblStatus.ForeColor = System.Drawing.Color.Red;
            }
        }

        private void BtnHide_Click(object sender, EventArgs e)
        {
            // Hide the shell
            shellControlller.hideDeskband();

            // Refresh shell status
            CheckIsShellActive();
        }

        private void LinkRefresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            CheckIsShellActive();
        }
    }
}

<|start_filename|>WinNetMeter/Components/ButtonEx.cs<|end_filename|>
﻿using System.ComponentModel;
using System.Windows.Forms;

namespace WinNetMeter.Components
{
    [Description("The ButtonEx is extended from Button base"), Category("Common Control")]
    internal class ButtonEx : Button
    {
        public override void NotifyDefault(bool value)
        {
            base.NotifyDefault(false);
        }
    }
}

<|start_filename|>WinNetMeter/Helper/NativeMethods.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace WinNetMeter.Helper
{
    internal class NativeMethods
    {
        public const int HWND_BROADCAST = 0xffff;
        public static readonly int WM_RESTART = RegisterWindowMessage("WM_RESTART");
        public static readonly int WM_OFFMONITOR = RegisterWindowMessage("WM_OFFMONITOR");
        [DllImport("user32")]
        public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);
        [DllImport("user32")]
        public static extern int RegisterWindowMessage(string message);
    }
}


<|start_filename|>WinNetMeter/Properties/Resources.Designer.cs<|end_filename|>
﻿//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace WinNetMeter.Properties {
    using System;
    
    
    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {
        
        private static global::System.Resources.ResourceManager resourceMan;
        
        private static global::System.Globalization.CultureInfo resourceCulture;
        
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }
        
        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinNetMeter.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }
        
        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap About_flat_16px {
            get {
                object obj = ResourceManager.GetObject("About_flat_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Arrow_back_24px {
            get {
                object obj = ResourceManager.GetObject("Arrow_back_24px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Arrow_back_32px {
            get {
                object obj = ResourceManager.GetObject("Arrow_back_32px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap baseline_arrow_back_black_24dp {
            get {
                object obj = ResourceManager.GetObject("baseline_arrow_back_black_24dp", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap baseline_help_outline_black_18dp {
            get {
                object obj = ResourceManager.GetObject("baseline_help_outline_black_18dp", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Brush_filled_16px {
            get {
                object obj = ResourceManager.GetObject("Brush_filled_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Chain_filled_16px {
            get {
                object obj = ResourceManager.GetObject("Chain_filled_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Chain_grey_180px {
            get {
                object obj = ResourceManager.GetObject("Chain_grey_180px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Checked_outline_16px {
            get {
                object obj = ResourceManager.GetObject("Checked_outline_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Database_filled_16px {
            get {
                object obj = ResourceManager.GetObject("Database_filled_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap down_black_16px {
            get {
                object obj = ResourceManager.GetObject("down_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap dun_black_16px {
            get {
                object obj = ResourceManager.GetObject("dun_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap dun_white_16px {
            get {
                object obj = ResourceManager.GetObject("dun_white_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap github_black_16px {
            get {
                object obj = ResourceManager.GetObject("github_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap github_black_24px {
            get {
                object obj = ResourceManager.GetObject("github_black_24px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Join_our_development_256px {
            get {
                object obj = ResourceManager.GetObject("Join_our_development_256px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Love_colored_16px {
            get {
                object obj = ResourceManager.GetObject("Love_colored_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap outline_arrow_down_black_16px {
            get {
                object obj = ResourceManager.GetObject("outline_arrow_down_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap outline_arrow_down_white_16px {
            get {
                object obj = ResourceManager.GetObject("outline_arrow_down_white_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap outline_arrow_up_black_16px {
            get {
                object obj = ResourceManager.GetObject("outline_arrow_up_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap outline_arrow_up_white_16px {
            get {
                object obj = ResourceManager.GetObject("outline_arrow_up_white_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap refresh_darkgrey_16px {
            get {
                object obj = ResourceManager.GetObject("refresh_darkgrey_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap refresh_darkgrey_24px {
            get {
                object obj = ResourceManager.GetObject("refresh_darkgrey_24px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap router_180px {
            get {
                object obj = ResourceManager.GetObject("router_180px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Settings_colored_16px {
            get {
                object obj = ResourceManager.GetObject("Settings_colored_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Share_blue_16px {
            get {
                object obj = ResourceManager.GetObject("Share_blue_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Tire_180px {
            get {
                object obj = ResourceManager.GetObject("Tire_180px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Triangle_down_arrow_16px {
            get {
                object obj = ResourceManager.GetObject("Triangle_down_arrow_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Triangle_down_arrow_black_16px {
            get {
                object obj = ResourceManager.GetObject("Triangle_down_arrow_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Triangle_up_arrow_16px {
            get {
                object obj = ResourceManager.GetObject("Triangle_up_arrow_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap Triangle_up_arrow_black_16px {
            get {
                object obj = ResourceManager.GetObject("Triangle_up_arrow_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap up_black_16px {
            get {
                object obj = ResourceManager.GetObject("up_black_16px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap WinNetMeter_128px {
            get {
                object obj = ResourceManager.GetObject("WinNetMeter_128px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Bitmap.
        /// </summary>
        internal static System.Drawing.Bitmap WinNetMeter_180px {
            get {
                object obj = ResourceManager.GetObject("WinNetMeter_180px", resourceCulture);
                return ((System.Drawing.Bitmap)(obj));
            }
        }
        
        /// <summary>
        ///   Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
        /// </summary>
        internal static System.Drawing.Icon winnetmeterlogo {
            get {
                object obj = ResourceManager.GetObject("winnetmeterlogo", resourceCulture);
                return ((System.Drawing.Icon)(obj));
            }
        }
    }
}


<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage5.cs<|end_filename|>
﻿using System;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;

namespace WinNetMeter.UserControls.FirstRun
{
    public partial class StartPage5 : UserControl
    {
        private string batchFileLocation = AppDomain.CurrentDomain.BaseDirectory + @"temp\toolbarInstaller.bat";
        private Integration integration = new Integration();

        public StartPage5()
        {
            InitializeComponent();
        }

        private void StartPage5_Load(object sender, EventArgs e)
        {
            RegistryManager registryManager = new RegistryManager();
            registryManager.SaveExecutableLocation(Application.ExecutablePath);
        }

        private void ToggleInstaller_CheckedChanged(object sender, EventArgs e)
        {
            switch (ToggleInstaller.Checked)
            {
                case true:
                    integration.InstallToolbar();

                    // Show the deskband
                    ShellController shellController = new ShellController();
                    shellController.callDeskband();
                    break;

                case false:
                    integration.UninstallToolbar();
                    break;
            }
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage4.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.FirstRun
{
    partial class StartPage4
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.label2 = new System.Windows.Forms.Label();
            this.checkJoinDevelopment = new System.Windows.Forms.CheckBox();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(92, 176);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(589, 36);
            this.label1.TabIndex = 4;
            this.label1.Text = "Join our development!";
            this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Image = global::WinNetMeter.Properties.Resources.Join_our_development_256px;
            this.pictureBox1.Location = new System.Drawing.Point(278, 32);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(206, 129);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pictureBox1.TabIndex = 5;
            this.pictureBox1.TabStop = false;
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Segoe UI Semibold", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
            this.label2.Location = new System.Drawing.Point(176, 212);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(428, 70);
            this.label2.TabIndex = 6;
            this.label2.Text = "Help us to improve our apps, Let\'s build something great together.";
            this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // checkJoinDevelopment
            // 
            this.checkJoinDevelopment.AutoSize = true;
            this.checkJoinDevelopment.BackColor = System.Drawing.Color.Transparent;
            this.checkJoinDevelopment.Font = new System.Drawing.Font("Segoe UI Semibold", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.checkJoinDevelopment.Location = new System.Drawing.Point(296, 358);
            this.checkJoinDevelopment.Name = "checkJoinDevelopment";
            this.checkJoinDevelopment.Size = new System.Drawing.Size(150, 21);
            this.checkJoinDevelopment.TabIndex = 8;
            this.checkJoinDevelopment.Text = "I want to participate";
            this.checkJoinDevelopment.UseVisualStyleBackColor = false;
            this.checkJoinDevelopment.CheckedChanged += new System.EventHandler(this.CheckJoinDevelopment_CheckedChanged);
            // 
            // StartPage4
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.checkJoinDevelopment);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.label1);
            this.Name = "StartPage4";
            this.Size = new System.Drawing.Size(819, 510);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.CheckBox checkJoinDevelopment;
    }
}


<|start_filename|>WinNetMeter/UserControls/Pages/General.cs<|end_filename|>
﻿using System;
using System.Linq;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;
using WinNetMeter.Core.Model;

namespace WinNetMeter.UserControls.Pages
{
    public partial class General : UserControl
    {
        private RegistryManager registryManager = new RegistryManager();

        public General()
        {
            InitializeComponent();

            NetworkIntefaceModule netModule = new NetworkIntefaceModule();
            var adapters = netModule.GetNetworkInterface();
            foreach (String adapter in adapters)
            {
                ListAdapter.Items.Add(adapter);
            }

            //Set to default value
            cmbFormat.SelectedItem = "Auto";
            radioEnglish.Checked = true;
            if (ListAdapter.Items != null)
            {
                ListAdapter.SelectedIndex = 0;
            }

            if (EnvironmentHelper.IsUwpApp())
            {
                ToggleAutoUpdate.Checked = false;
                ToggleAutoUpdate.Enabled = false;
                label6.Text += " (Disabled)";
            }

            #region LoadConfiguration

            //Get app configuration
            var configuration = registryManager.GetGeneralConfiguration();

            //set configuration
            ToggleMonitor.Checked = (configuration.Monitoring) ? true : false;
            ToggleAutoUpdate.Checked = (configuration.AutoUpdate) ? true : false;

            if (configuration.Format != null)
            {
                cmbFormat.SelectedItem = configuration.Format;
            }

            if (configuration.Language == Language.English)
            {
                radioEnglish.Checked = true;
            }
            else
            {
                radioIndonesia.Checked = true;
            }

            if (configuration.MonitoredAdapter != null && ListAdapter.Items.Contains(configuration.MonitoredAdapter))
            {
                ListAdapter.SelectedItem = configuration.MonitoredAdapter;
            }

            #endregion LoadConfiguration
        }

        private void BtnSaveGeneral_Click(object sender, EventArgs e)
        {
            if (ListAdapter.SelectedItem == null)
            {
                MessageBox.Show(this, "You have not chosen the network inteface", "Oopss!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (!radioEnglish.Checked && !radioIndonesia.Checked)
            {
                MessageBox.Show(this, "You have not chosen something", "Oopss!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                Configuration config = new Configuration
                {
                    Monitoring = ToggleMonitor.Checked,
                    AutoUpdate = ToggleAutoUpdate.Checked,
                    Language = (Language)Enum.Parse(typeof(Language), this.Controls.OfType<RadioButton>().FirstOrDefault(r => r.Checked).Text),
                    Format = cmbFormat.SelectedItem.ToString(),
                    MonitoredAdapter = ListAdapter.SelectedItem.ToString()
                };

                // Save settings
                registryManager.Save(config);

                try
                {
                    NativeMethods.PostMessage(new IntPtr(Convert.ToInt32(registryManager.GetHwnd())), NativeMethods.WM_RESTART, IntPtr.Zero, IntPtr.Zero);
                }
                catch
                {
                }
            }
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/Pages/About.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.Pages
{
    partial class About
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label24 = new System.Windows.Forms.Label();
            this.linkDonation = new System.Windows.Forms.LinkLabel();
            this.linkGithub = new System.Windows.Forms.LinkLabel();
            this.label23 = new System.Windows.Forms.Label();
            this.linkWebsite = new System.Windows.Forms.LinkLabel();
            this.label22 = new System.Windows.Forms.Label();
            this.linkJovan = new System.Windows.Forms.LinkLabel();
            this.linkJeremy = new System.Windows.Forms.LinkLabel();
            this.linkAzhe = new System.Windows.Forms.LinkLabel();
            this.linkArfan = new System.Windows.Forms.LinkLabel();
            this.lblCopyright = new System.Windows.Forms.Label();
            this.label20 = new System.Windows.Forms.Label();
            this.linkLabel1 = new System.Windows.Forms.LinkLabel();
            this.lblVersion = new System.Windows.Forms.Label();
            this.label19 = new System.Windows.Forms.Label();
            this.panel1 = new System.Windows.Forms.Panel();
            this.label1 = new System.Windows.Forms.Label();
            this.pictureBox7 = new System.Windows.Forms.PictureBox();
            this.pictureBox10 = new System.Windows.Forms.PictureBox();
            this.pictureBox9 = new System.Windows.Forms.PictureBox();
            this.pictureBox8 = new System.Windows.Forms.PictureBox();
            this.panel2 = new System.Windows.Forms.Panel();
            this.BtnTest = new WinNetMeter.Components.ButtonEx();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            // 
            // label24
            // 
            this.label24.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.label24.AutoSize = true;
            this.label24.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label24.Location = new System.Drawing.Point(154, 323);
            this.label24.Name = "label24";
            this.label24.Size = new System.Drawing.Size(148, 17);
            this.label24.TabIndex = 57;
            this.label24.Text = "for further development";
            // 
            // linkDonation
            // 
            this.linkDonation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.linkDonation.AutoSize = true;
            this.linkDonation.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkDonation.Location = new System.Drawing.Point(47, 323);
            this.linkDonation.Name = "linkDonation";
            this.linkDonation.Size = new System.Drawing.Size(110, 17);
            this.linkDonation.TabIndex = 56;
            this.linkDonation.TabStop = true;
            this.linkDonation.Text = "Send us donation";
            this.linkDonation.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkDonation_LinkClicked);
            // 
            // linkGithub
            // 
            this.linkGithub.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.linkGithub.AutoSize = true;
            this.linkGithub.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkGithub.Location = new System.Drawing.Point(263, 301);
            this.linkGithub.Name = "linkGithub";
            this.linkGithub.Size = new System.Drawing.Size(146, 17);
            this.linkGithub.TabIndex = 54;
            this.linkGithub.TabStop = true;
            this.linkGithub.Text = "GitHub repository page";
            this.linkGithub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkGithub_LinkClicked);
            // 
            // label23
            // 
            this.label23.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.label23.AutoSize = true;
            this.label23.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label23.Location = new System.Drawing.Point(149, 301);
            this.label23.Name = "label23";
            this.label23.Size = new System.Drawing.Size(97, 17);
            this.label23.TabIndex = 52;
            this.label23.Text = "And our official";
            // 
            // linkWebsite
            // 
            this.linkWebsite.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.linkWebsite.AutoSize = true;
            this.linkWebsite.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkWebsite.Location = new System.Drawing.Point(47, 301);
            this.linkWebsite.Name = "linkWebsite";
            this.linkWebsite.Size = new System.Drawing.Size(104, 17);
            this.linkWebsite.TabIndex = 50;
            this.linkWebsite.TabStop = true;
            this.linkWebsite.Text = "Visit our website";
            this.linkWebsite.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkWebsite_LinkClicked);
            // 
            // label22
            // 
            this.label22.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.label22.AutoSize = true;
            this.label22.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label22.ForeColor = System.Drawing.Color.Black;
            this.label22.Location = new System.Drawing.Point(21, 275);
            this.label22.Name = "label22";
            this.label22.Size = new System.Drawing.Size(64, 20);
            this.label22.TabIndex = 49;
            this.label22.Text = "Support";
            // 
            // linkJovan
            // 
            this.linkJovan.AutoSize = true;
            this.linkJovan.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkJovan.Location = new System.Drawing.Point(5, 101);
            this.linkJovan.Name = "linkJovan";
            this.linkJovan.Size = new System.Drawing.Size(204, 17);
            this.linkJovan.TabIndex = 48;
            this.linkJovan.TabStop = true;
            this.linkJovan.Text = "<NAME>";
            this.linkJovan.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkJovan_LinkClicked);
            // 
            // linkJeremy
            // 
            this.linkJeremy.AutoSize = true;
            this.linkJeremy.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkJeremy.Location = new System.Drawing.Point(5, 80);
            this.linkJeremy.Name = "linkJeremy";
            this.linkJeremy.Size = new System.Drawing.Size(88, 17);
            this.linkJeremy.TabIndex = 47;
            this.linkJeremy.TabStop = true;
            this.linkJeremy.Text = "<NAME>";
            this.linkJeremy.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkJeremy_LinkClicked);
            // 
            // linkAzhe
            // 
            this.linkAzhe.AutoSize = true;
            this.linkAzhe.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkAzhe.Location = new System.Drawing.Point(5, 62);
            this.linkAzhe.Name = "linkAzhe";
            this.linkAzhe.Size = new System.Drawing.Size(62, 17);
            this.linkAzhe.TabIndex = 46;
            this.linkAzhe.TabStop = true;
            this.linkAzhe.Text = "<NAME>";
            this.linkAzhe.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkAzhe_LinkClicked);
            // 
            // linkArfan
            // 
            this.linkArfan.AutoSize = true;
            this.linkArfan.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkArfan.Location = new System.Drawing.Point(5, 42);
            this.linkArfan.Name = "linkArfan";
            this.linkArfan.Size = new System.Drawing.Size(113, 17);
            this.linkArfan.TabIndex = 45;
            this.linkArfan.TabStop = true;
            this.linkArfan.Text = "<NAME>";
            this.linkArfan.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkArfan_LinkClicked);
            // 
            // lblCopyright
            // 
            this.lblCopyright.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.lblCopyright.AutoSize = true;
            this.lblCopyright.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblCopyright.Location = new System.Drawing.Point(25, 369);
            this.lblCopyright.Name = "lblCopyright";
            this.lblCopyright.Size = new System.Drawing.Size(272, 15);
            this.lblCopyright.TabIndex = 44;
            this.lblCopyright.Text = "© 2019 WinTenDev Inc. by Team and Contributors.";
            // 
            // label20
            // 
            this.label20.AutoSize = true;
            this.label20.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label20.ForeColor = System.Drawing.Color.Black;
            this.label20.Location = new System.Drawing.Point(3, 15);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(81, 20);
            this.label20.TabIndex = 42;
            this.label20.Text = "Team Core";
            // 
            // linkLabel1
            // 
            this.linkLabel1.AutoSize = true;
            this.linkLabel1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.linkLabel1.Location = new System.Drawing.Point(87, 67);
            this.linkLabel1.Name = "linkLabel1";
            this.linkLabel1.Size = new System.Drawing.Size(97, 13);
            this.linkLabel1.TabIndex = 62;
            this.linkLabel1.TabStop = true;
            this.linkLabel1.Text = "Report a problem";
            // 
            // lblVersion
            // 
            this.lblVersion.AutoSize = true;
            this.lblVersion.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblVersion.Location = new System.Drawing.Point(87, 46);
            this.lblVersion.Name = "lblVersion";
            this.lblVersion.Size = new System.Drawing.Size(51, 17);
            this.lblVersion.TabIndex = 61;
            this.lblVersion.Text = "v1.0.0.0";
            // 
            // label19
            // 
            this.label19.AutoSize = true;
            this.label19.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label19.Location = new System.Drawing.Point(86, 25);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(234, 21);
            this.label19.TabIndex = 59;
            this.label19.Text = "WinNetMeter By WinTenDev Inc.";
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.Red;
            this.panel1.Controls.Add(this.label1);
            this.panel1.Location = new System.Drawing.Point(319, 28);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(44, 18);
            this.panel1.TabIndex = 65;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.label1.Location = new System.Drawing.Point(3, 2);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(37, 13);
            this.label1.TabIndex = 66;
            this.label1.Text = "Alpha";
            // 
            // pictureBox7
            // 
            this.pictureBox7.Image = global::WinNetMeter.Properties.Resources.WinNetMeter_128px;
            this.pictureBox7.Location = new System.Drawing.Point(23, 25);
            this.pictureBox7.Name = "pictureBox7";
            this.pictureBox7.Size = new System.Drawing.Size(58, 55);
            this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pictureBox7.TabIndex = 60;
            this.pictureBox7.TabStop = false;
            // 
            // pictureBox10
            // 
            this.pictureBox10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.pictureBox10.Image = global::WinNetMeter.Properties.Resources.Love_colored_16px;
            this.pictureBox10.Location = new System.Drawing.Point(28, 324);
            this.pictureBox10.Name = "pictureBox10";
            this.pictureBox10.Size = new System.Drawing.Size(16, 16);
            this.pictureBox10.TabIndex = 55;
            this.pictureBox10.TabStop = false;
            // 
            // pictureBox9
            // 
            this.pictureBox9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.pictureBox9.Image = global::WinNetMeter.Properties.Resources.github_black_16px;
            this.pictureBox9.Location = new System.Drawing.Point(246, 302);
            this.pictureBox9.Name = "pictureBox9";
            this.pictureBox9.Size = new System.Drawing.Size(16, 16);
            this.pictureBox9.TabIndex = 53;
            this.pictureBox9.TabStop = false;
            // 
            // pictureBox8
            // 
            this.pictureBox8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.pictureBox8.Image = global::WinNetMeter.Properties.Resources.Share_blue_16px;
            this.pictureBox8.Location = new System.Drawing.Point(28, 302);
            this.pictureBox8.Name = "pictureBox8";
            this.pictureBox8.Size = new System.Drawing.Size(16, 16);
            this.pictureBox8.TabIndex = 51;
            this.pictureBox8.TabStop = false;
            // 
            // panel2
            // 
            this.panel2.Controls.Add(this.label20);
            this.panel2.Controls.Add(this.linkArfan);
            this.panel2.Controls.Add(this.linkAzhe);
            this.panel2.Controls.Add(this.linkJeremy);
            this.panel2.Controls.Add(this.linkJovan);
            this.panel2.Location = new System.Drawing.Point(23, 107);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(336, 131);
            this.panel2.TabIndex = 66;
            // 
            // BtnTest
            // 
            this.BtnTest.Location = new System.Drawing.Point(389, 117);
            this.BtnTest.Name = "BtnTest";
            this.BtnTest.Size = new System.Drawing.Size(103, 32);
            this.BtnTest.TabIndex = 67;
            this.BtnTest.Text = "buttonEx1";
            this.BtnTest.UseVisualStyleBackColor = true;
            this.BtnTest.Click += new System.EventHandler(this.BtnTest_Click);
            // 
            // About
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ButtonHighlight;
            this.Controls.Add(this.BtnTest);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.linkLabel1);
            this.Controls.Add(this.lblVersion);
            this.Controls.Add(this.pictureBox7);
            this.Controls.Add(this.label19);
            this.Controls.Add(this.label24);
            this.Controls.Add(this.linkDonation);
            this.Controls.Add(this.pictureBox10);
            this.Controls.Add(this.linkGithub);
            this.Controls.Add(this.pictureBox9);
            this.Controls.Add(this.label23);
            this.Controls.Add(this.pictureBox8);
            this.Controls.Add(this.linkWebsite);
            this.Controls.Add(this.label22);
            this.Controls.Add(this.lblCopyright);
            this.Name = "About";
            this.Size = new System.Drawing.Size(568, 404);
            this.Load += new System.EventHandler(this.About_Load);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox10)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit();
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.Label label24;
        private System.Windows.Forms.LinkLabel linkDonation;
        private System.Windows.Forms.PictureBox pictureBox10;
        private System.Windows.Forms.LinkLabel linkGithub;
        private System.Windows.Forms.PictureBox pictureBox9;
        private System.Windows.Forms.Label label23;
        private System.Windows.Forms.PictureBox pictureBox8;
        private System.Windows.Forms.LinkLabel linkWebsite;
        private System.Windows.Forms.Label label22;
        private System.Windows.Forms.LinkLabel linkJovan;
        private System.Windows.Forms.LinkLabel linkJeremy;
        private System.Windows.Forms.LinkLabel linkAzhe;
        private System.Windows.Forms.LinkLabel linkArfan;
        private System.Windows.Forms.Label lblCopyright;
        private System.Windows.Forms.Label label20;
        private System.Windows.Forms.LinkLabel linkLabel1;
        private System.Windows.Forms.Label lblVersion;
        private System.Windows.Forms.PictureBox pictureBox7;
        private System.Windows.Forms.Label label19;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Panel panel2;
        private Components.ButtonEx BtnTest;
    }
}


<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage4.cs<|end_filename|>
﻿using System;
using System.Windows.Forms;

namespace WinNetMeter.UserControls.FirstRun
{
    public partial class StartPage4 : UserControl
    {
        private static bool joinDevelopment;

        public static bool JoinDevelopment { get => joinDevelopment; set => joinDevelopment = value; }

        public StartPage4()
        {
            InitializeComponent();
        }

        private void CheckJoinDevelopment_CheckedChanged(object sender, EventArgs e)
        {
            joinDevelopment = checkJoinDevelopment.Checked;
        }
    }
}

<|start_filename|>WinNetMeter.Core/Model/ConfigurationType.cs<|end_filename|>
﻿namespace WinNetMeter.Core.Model
{
    public enum ConfigurationType
    {
        GeneralConfiguration,
        StyleConfiguration,
        DatabaseConfiguration
    }
}

<|start_filename|>WinNetMeter.Core/Helper/NativeMethods.cs<|end_filename|>
﻿using System;
using System.Runtime.InteropServices;

namespace WinNetMeter.Core.Helper
{
    public class NativeMethods
    {
        public const int HWND_BROADCAST = 0xffff;
        public static readonly int WM_RESTART = RegisterWindowMessage("WM_RESTART");
        public static readonly int WM_OFFMONITOR = RegisterWindowMessage("WM_OFFMONITOR");

        [DllImport("user32")]
        public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);

        [DllImport("user32")]
        public static extern int RegisterWindowMessage(string message);
    }
}

<|start_filename|>WinNetMeter.Core/Helper/NetworkIntefaceModule.cs<|end_filename|>
﻿using System.Collections.Generic;
using System.Diagnostics;
using System.Management;

namespace WinNetMeter.Core.Helper
{
    public class NetworkIntefaceModule
    {
        public List<string> GetActiveNetworkInterface()
        {
            List<string> adapters = new List<string>();
            ManagementObjectSearcher objectSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter" + " WHERE NetConnectionStatus=2");
            foreach (ManagementObject obj in objectSearcher.Get())
            {
                adapters.Add(obj["Name"].ToString());
            }

            return adapters;
        }

        public List<string> GetNetworkInterface()
        {
            List<string> adapters = new List<string>();
            PerformanceCounterCategory category = new PerformanceCounterCategory("Network Interface");
            foreach (string name in category.GetInstanceNames())
            {
                adapters.Add(name);
            }
            return adapters;
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage3.cs<|end_filename|>
﻿using System;
using System.Threading;
using System.Windows.Forms;
using WinNetMeter.Helper;

namespace WinNetMeter.UserControls.FirstRun
{
    public partial class StartPage3 : UserControl
    {
        private static bool isLoadCompleted;

        private static string selectedAdapter;

        public static string SelectedAdapter { get => selectedAdapter; set => selectedAdapter = value; }

        public static bool IsLoadCompleted
        {
            get
            {
                return isLoadCompleted;
            }
            set
            {
                isLoadCompleted = value;
            }
        }

        public StartPage3()
        {
            InitializeComponent();
        }

        private void StartPage3_Load(object sender, EventArgs e)
        {
            Thread getAdapter = new Thread(delegate ()
            {
                NetworkIntefaceModule netModule = new NetworkIntefaceModule();
                var adapters = netModule.GetNetworkInterface();
                this.BeginInvoke(new MethodInvoker(delegate ()
                {
                    foreach (String adapter in adapters)
                    {
                        listAdapter.Items.Add(adapter);
                    }
                    IsLoadCompleted = true;
                    listAdapter.Enabled = true;
                    lblDetecting.Visible = false;
                }));
            });

            getAdapter.Start();
        }

        private void ListAdapter_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                SelectedAdapter = listAdapter.SelectedItem.ToString();
            }
            catch
            {
                //MessageBox.Show("List adapter sedang dimuat, silakan tunggu.", "WinNetMeter Setup",
                //    MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/Controls/AppUpdater.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.Controls
{
    partial class AppUpdater
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Title = new System.Windows.Forms.Label();
            this.Description = new System.Windows.Forms.Label();
            this.BtnCheckUpdates = new System.Windows.Forms.Button();
            this.BtnCancel = new System.Windows.Forms.Button();
            this.Changelog = new System.Windows.Forms.LinkLabel();
            this.SuspendLayout();
            // 
            // Title
            // 
            this.Title.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.Title.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Title.ForeColor = System.Drawing.Color.Black;
            this.Title.Location = new System.Drawing.Point(6, 6);
            this.Title.Name = "Title";
            this.Title.Size = new System.Drawing.Size(263, 20);
            this.Title.TabIndex = 0;
            this.Title.Text = "Check for Updates";
            // 
            // Description
            // 
            this.Description.AutoSize = true;
            this.Description.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Description.Location = new System.Drawing.Point(8, 35);
            this.Description.Name = "Description";
            this.Description.Size = new System.Drawing.Size(90, 13);
            this.Description.TabIndex = 1;
            this.Description.Text = "Get new version";
            // 
            // BtnCheckUpdates
            // 
            this.BtnCheckUpdates.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.BtnCheckUpdates.BackColor = System.Drawing.SystemColors.Highlight;
            this.BtnCheckUpdates.FlatAppearance.BorderSize = 0;
            this.BtnCheckUpdates.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.BtnCheckUpdates.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.BtnCheckUpdates.ForeColor = System.Drawing.SystemColors.ControlLightLight;
            this.BtnCheckUpdates.Location = new System.Drawing.Point(14, 116);
            this.BtnCheckUpdates.Name = "BtnCheckUpdates";
            this.BtnCheckUpdates.Size = new System.Drawing.Size(117, 28);
            this.BtnCheckUpdates.TabIndex = 34;
            this.BtnCheckUpdates.Text = "Check for Updates";
            this.BtnCheckUpdates.UseVisualStyleBackColor = false;
            this.BtnCheckUpdates.Click += new System.EventHandler(this.BtnCheckUpdates_Click);
            // 
            // BtnCancel
            // 
            this.BtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.BtnCancel.FlatAppearance.BorderColor = System.Drawing.SystemColors.Highlight;
            this.BtnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.BtnCancel.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.BtnCancel.ForeColor = System.Drawing.SystemColors.Highlight;
            this.BtnCancel.Location = new System.Drawing.Point(137, 116);
            this.BtnCancel.Name = "BtnCancel";
            this.BtnCancel.Size = new System.Drawing.Size(116, 26);
            this.BtnCancel.TabIndex = 35;
            this.BtnCancel.Text = "Cancel Update";
            this.BtnCancel.UseVisualStyleBackColor = true;
            this.BtnCancel.Visible = false;
            this.BtnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
            // 
            // Changelog
            // 
            this.Changelog.AutoSize = true;
            this.Changelog.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Changelog.Location = new System.Drawing.Point(8, 52);
            this.Changelog.Name = "Changelog";
            this.Changelog.Size = new System.Drawing.Size(90, 13);
            this.Changelog.TabIndex = 36;
            this.Changelog.TabStop = true;
            this.Changelog.Text = "View changelog";
            this.Changelog.Visible = false;
            this.Changelog.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.Changelog_LinkClicked);
            // 
            // AppUpdater
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.Changelog);
            this.Controls.Add(this.BtnCancel);
            this.Controls.Add(this.BtnCheckUpdates);
            this.Controls.Add(this.Description);
            this.Controls.Add(this.Title);
            this.Name = "AppUpdater";
            this.Size = new System.Drawing.Size(275, 150);
            this.Load += new System.EventHandler(this.AppUpdater_Load);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label Title;
        private System.Windows.Forms.Label Description;
        private System.Windows.Forms.Button BtnCheckUpdates;
        private System.Windows.Forms.Button BtnCancel;
        private System.Windows.Forms.LinkLabel Changelog;
    }
}


<|start_filename|>WinNetMeter.Core/Model/StyleConfiguration.cs<|end_filename|>
﻿namespace WinNetMeter.Core.Model
{
    public class StyleConfiguration
    {

        private bool adaptive;
        string textColor;
        string fontFamily;
        IconStyle icon;

        public string TextColor { get => textColor; set => textColor = value; }
        public string FontFamily { get => fontFamily; set => fontFamily = value; }
        public IconStyle Icon { get => icon; set => icon = value; }
        public bool Adaptive { get => adaptive; set => adaptive = value; }
    }
}


<|start_filename|>WinNetMeter/Setup.cs<|end_filename|>
﻿using System;
using System.Drawing;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;
using WinNetMeter.Core.Model;
using WinNetMeter.UserControls.FirstRun;

namespace WinNetMeter
{
    public partial class Setup : Form
    {
        private static bool btnNextEnabled;

        private static Setup setup;

        public static bool BtnNextEnabled
        {
            get
            {
                return btnNextEnabled;
            }
            set
            {
                btnNextEnabled = value;
                setup.btnNext.Enabled = value;
            }
        }

        public static string BtnNextEnabledText
        {
            get
            {
                return setup.btnNext.Text;
            }
            set
            {
                setup.btnNext.Text = value;
            }
        }

        public static int page = 1;
        private RegistryManager settingsManager = new RegistryManager();

        public Setup()
        {
            InitializeComponent();
            setup = this;
        }

        private void Setup_Load(object sender, EventArgs e)
        {
            StartPage1 page1 = new StartPage1();
            page1.Dock = DockStyle.Fill;
            panelContainer.Controls.Add(page1);
        }

        private void BtnNext_Click(object sender, EventArgs e)
        {
            if (page == 1 && panelContainer.Controls.ContainsKey("StartPage2"))
            {
                panelContainer.Controls["StartPage2"].BringToFront();
                moveProductTitle(MoveLabel.Right);
                page = 2;
            }
            else if (page == 2 && panelContainer.Controls.ContainsKey("StartPage3"))
            {
                panelContainer.Controls["StartPage3"].BringToFront();
                page = 3;
            }
            else if (page == 3 && panelContainer.Controls.ContainsKey("StartPage4"))
            {
                panelContainer.Controls["StartPage4"].BringToFront();
                page = 4;
            }
            else if (page == 4 && panelContainer.Controls.ContainsKey("StartPage5"))
            {
                panelContainer.Controls["StartPage5"].BringToFront();
                page = 5;
            }
            else if (page == 1 && panelContainer.Controls.ContainsKey("StartPage2") == false)
            {
                StartPage2 page2 = new StartPage2();
                page2.Dock = DockStyle.Fill;
                panelContainer.Controls.Add(page2);

                panelContainer.Controls["StartPage2"].BringToFront();
                moveProductTitle(MoveLabel.Right);
                page = 2;
            }
            else if (page == 2 && panelContainer.Controls.ContainsKey("StartPage3") == false)
            {
                StartPage3 page3 = new StartPage3();
                page3.Dock = DockStyle.Fill;
                panelContainer.Controls.Add(page3);

                panelContainer.Controls["StartPage3"].BringToFront();
                page = 3;
            }
            else if (page == 3 && panelContainer.Controls.ContainsKey("StartPage4") == false)
            {
                if (StartPage3.SelectedAdapter != null)
                {
                    settingsManager.Save("MonitoredAdapter", StartPage3.SelectedAdapter, ConfigurationType.GeneralConfiguration);

                    StartPage4 page4 = new StartPage4();
                    page4.Dock = DockStyle.Fill;
                    panelContainer.Controls.Add(page4);

                    panelContainer.Controls["StartPage4"].BringToFront();
                    page = 4;
                }
                else MessageBox.Show(this, "You have not chosen the network adapter", "Ooopss!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (page == 4 && panelContainer.Controls.ContainsKey("StartPage5") == false)
            {
                StartPage5 page5 = new StartPage5();
                page5.Dock = DockStyle.Fill;
                panelContainer.Controls.Add(page5);

                panelContainer.Controls["StartPage5"].BringToFront();
                page = 5;
            }
            else if (page == 5)
            {
                Properties.Settings.Default.FirstLaunch = false;
                Properties.Settings.Default.Save();
                Hide();

                //                Main main = new Main();
                //                main.Show();
                Application.Restart();

                if (StartPage4.JoinDevelopment) System.Diagnostics.Process.Start("https://github.com/WinTenDev/WinNetMeter");
            }
        }

        private void moveProductTitle(MoveLabel move)
        {
            switch (move)
            {
                case MoveLabel.Right:
                    lblProductName.Location = new Point(47, 11);
                    lblProductDesc.Location = new Point(176, 13);
                    break;

                case MoveLabel.Left:
                    lblProductName.Location = new Point(12, 11);
                    lblProductDesc.Location = new Point(139, 13);
                    break;
            }
        }

        private enum MoveLabel
        {
            Right,
            Left
        }

        private void LinkBack_Click(object sender, EventArgs e)
        {
            if (page == 2)
            {
                page = 1;
                panelContainer.Controls["StartPage1"].BringToFront();
                moveProductTitle(MoveLabel.Left);
            }
            else if (page == 3)
            {
                page = 2;
                panelContainer.Controls["StartPage2"].BringToFront();
            }
            else if (page == 4)
            {
                page = 3;
                panelContainer.Controls["StartPage3"].BringToFront();
            }
            else if (page == 5)
            {
                page = 4;
                panelContainer.Controls["StartPage4"].BringToFront();
            }
        }
    }
}

<|start_filename|>WinNetMeter.Core/Helper/TaskBarHelper.cs<|end_filename|>
﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;

namespace WinNetMeter.Core.Helper
{
    public class TaskBarHelper
    {
        [DllImport("shell32.dll")]
        private static extern IntPtr SHAppBarMessage(int msg, ref APPBARDATA data);

        [DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
        private static extern int BitBlt(IntPtr hDC, int x, int y, int nWidth, int nHeight, IntPtr hSrcDC, int xSrc, int ySrc, int dwRop);

        private struct APPBARDATA
        {
            public int cbSize;
            public IntPtr hWnd;
            public int uCallbackMessage;
            public int uEdge;
            public RECT rc;
            public IntPtr lParam;
        }

        private struct RECT
        {
            public int left, top, right, bottom;
        }

        private const int ABM_GETTASKBARPOS = 5;

        public Rectangle GetTaskbarPosition()
        {
            APPBARDATA data = new APPBARDATA();
            data.cbSize = Marshal.SizeOf(data);

            IntPtr retval = SHAppBarMessage(ABM_GETTASKBARPOS, ref data);
            if (retval == IntPtr.Zero)
            {
                throw new Win32Exception("Please re-install Windows");
            }

            return new Rectangle(data.rc.left, data.rc.top, data.rc.right - data.rc.left, data.rc.bottom - data.rc.top);
        }

        public Color GetColourAt(Point location)
        {
            using (Bitmap screenPixel = new Bitmap(1, 1, PixelFormat.Format32bppArgb))
            using (Graphics gdest = Graphics.FromImage(screenPixel))
            {
                using (Graphics gsrc = Graphics.FromHwnd(IntPtr.Zero))
                {
                    IntPtr hSrcDC = gsrc.GetHdc();
                    IntPtr hDC = gdest.GetHdc();
                    int retval = BitBlt(hDC, 0, 0, 1, 1, hSrcDC, location.X, location.Y, (int)CopyPixelOperation.SourceCopy);
                    gdest.ReleaseHdc();
                    gsrc.ReleaseHdc();
                }

                return screenPixel.GetPixel(0, 0);
            }
        }

        public bool IsDarkColor(int R, int G, int B)
        {
            bool IsDark = false;

            if (R <= 128 || G <= 128 || B <= 128) IsDark = true;

            return IsDark;
        }
    }
}

<|start_filename|>WinNetMeter.Core/Model/Language.cs<|end_filename|>
﻿
namespace WinNetMeter.Core.Model
{
    public enum Language
    {
        English,
        Indonesian
    }
}


<|start_filename|>WinNetMeter.Core/Model/DatabaseConfiguration.cs<|end_filename|>
﻿
namespace WinNetMeter.Core.Model
{
    public class DatabaseConfiguration
    {
        bool trafficLogging;
        string customLogLocation;

        public string CustomLogLocation { get => customLogLocation; set => customLogLocation = value; }
        public bool TrafficLogging { get => trafficLogging; set => trafficLogging = value; }
    }
}


<|start_filename|>WinNetMeter.Core/Model/PathInfo.cs<|end_filename|>
﻿using System;

namespace WinNetMeter.Core.Model
{
    public class PathInfo
    {

        // Directory
        public static readonly string baseApp = AppDomain.CurrentDomain.BaseDirectory;
        public static readonly string baseLocalData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
        public static readonly string companyFolderName = "WinTenDev";
        public static string tempFolderName = "temp";
        public static string updateFolderName = "update";

        // File
        public static readonly string toolBarInstallerFileName = "toolbarInstaller.bat";
        public static string toolBarUninstallerFileName = "toolbarUninstaller.bat";

        public static readonly string tempLocation = $@"{baseLocalData}\{companyFolderName}\{tempFolderName}";
        public static readonly string updateLocation = $@"{baseLocalData}\{companyFolderName}\{updateFolderName}";
        public static readonly string toolBarInstallerLocation = $@"{baseLocalData}\{companyFolderName}\{tempFolderName}\{toolBarInstallerFileName}";
        public static readonly string toolBarUninstallerLocation = $@"{baseLocalData}\{companyFolderName}\{tempFolderName}\{toolBarUninstallerFileName}";
        public static readonly string appLocation = $"{baseApp}WinNetMeter.exe";
        public static readonly string shellLocation = $"{baseApp}WinNetMeter.Shell.dll";
    }
}


<|start_filename|>WinNetMeter.Core/Model/IconStyle.cs<|end_filename|>
﻿
namespace WinNetMeter.Core.Model
{
    public enum IconStyle
    {
        Arrow,
        TriangleArrow,
        Outline_Arrow
    }
}


<|start_filename|>WinNetMeter/Helper/NetworkIntefaceModule.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Management;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.NetworkInformation;
using System.Diagnostics;

namespace WinNetMeter.Helper
{
    public class NetworkIntefaceModule
    {
        public List<string> GetActiveNetworkInterface()
        {
            List<string> adapters = new List<string>();
            ManagementObjectSearcher objectSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter" + " WHERE NetConnectionStatus=2");
            foreach(ManagementObject obj  in objectSearcher.Get())
            {
                adapters.Add(obj["Name"].ToString());
            }
           
            return adapters;
        }

        public List<string> GetNetworkInterface()
        {
            List<string> adapters = new List<string>();
            PerformanceCounterCategory category = new PerformanceCounterCategory("Network Interface");
            foreach(string name in category.GetInstanceNames())
            {
                adapters.Add(name);
            }
            return adapters;
        }
    }
}


<|start_filename|>Updater/Program.cs<|end_filename|>
﻿using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Updater.Helper;

namespace Updater
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            string baseExe = "WinNetMeter.exe";
            string baseShell = "WinNetMeter.Shell.dll";

            // Configure update directory
            string baseLocalAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            string exeUpdateFile = baseLocalAppData + @"\WinTenDev\update\WinNetMeter.exe";
            string shellUpdateFile = baseLocalAppData + @"\WinTenDev\update\WinNetMeter.Shell.dll";

            //string exeUpdateFile = AppDomain.CurrentDomain.BaseDirectory + @"update/WinNetMeter.exe";
            //string shellUpdateFile = AppDomain.CurrentDomain.BaseDirectory + @"update/WinNetMeter.Shell.dll";

            
            if (File.Exists(exeUpdateFile) && File.Exists(shellUpdateFile))
            {

                // Kill explorer.exe process

                    foreach (Process process in Process.GetProcessesByName("explorer"))
                    {
                        process.Kill();
                    }

                Console.WriteLine("Updating app..");

                // Start the explorer.exe again
                Process.Start("explorer.exe");

                FileHelper.SafeDelete($"{baseExe}");

                Console.WriteLine("Installing dashboard..");
                FileHelper.SaveMove(exeUpdateFile, $"{baseExe}");

                Console.WriteLine("Installing shell..");

                // nstalling new shell
                Integration integration = new Integration();

                // Delete shell old file
                FileHelper.SafeDelete($"{baseShell}");
                FileHelper.SaveMove(shellUpdateFile, $"{baseShell}");

                integration.InstallToolbar();


                Console.WriteLine("Finished..");
                Thread.Sleep(1000);

                Process.Start($"{baseExe}");
                Environment.Exit(0);
            }
            else
            {
                Environment.Exit(0);
            }
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/Pages/Customize.cs<|end_filename|>
﻿using System;
using System.Drawing;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;
using WinNetMeter.Core.Model;

namespace WinNetMeter.UserControls.Pages
{
    public partial class Customize : UserControl
    {
        private RegistryManager registryManager;

        public Customize()
        {
            InitializeComponent();

            registryManager = new RegistryManager();

            #region StyleConfiguration

            var styleConfig = registryManager.GetStyleConfiguration();
            colorGrid1.Color = ColorTranslator.FromHtml(styleConfig.TextColor);

            foreach (FontFamily font in FontFamily.Families)
            {
                ComboboxFont.Items.Add(font.Name);
            }

            ComboboxFont.SelectedItem = styleConfig.FontFamily;
            if (styleConfig.Icon == IconStyle.Arrow) radioPictArrow.Checked = true;
            else if (styleConfig.Icon == IconStyle.TriangleArrow) radioPictTriangleArrow.Checked = true;
            else if (styleConfig.Icon == IconStyle.Outline_Arrow) radioPictOutline.Checked = true;

            if (ComboboxFont.Items.Contains("")) ComboboxFont.Items.Remove("");

            ToggleAdaptive.Checked = styleConfig.Adaptive;

            var isAdaptiveChecked = ToggleAdaptive.Checked ? colorGrid1.Enabled = false : colorGrid1.Enabled = true;

            #endregion StyleConfiguration
        }

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

        private void BtnSaveStyle_Click(object sender, EventArgs e)
        {
            if (ComboboxFont.SelectedItem != null)
            {
                StyleConfiguration styleConfiguration = new StyleConfiguration
                {
                    Adaptive = ToggleAdaptive.Checked,
                    TextColor = ColorTranslator.ToHtml(colorGrid1.Color),
                    FontFamily = ComboboxFont.SelectedItem.ToString()
                };

                if (radioPictArrow.Checked == true) styleConfiguration.Icon = IconStyle.Arrow;
                else if (radioPictTriangleArrow.Checked == true) styleConfiguration.Icon = IconStyle.TriangleArrow;
                else if (radioPictOutline.Checked == true) styleConfiguration.Icon = IconStyle.Outline_Arrow;

                registryManager.Save(styleConfiguration);
            }
            else
            {
                MessageBox.Show(this, "You have not chosen font style", "Oopss!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            try
            {
                NativeMethods.PostMessage(new IntPtr(Convert.ToInt32(registryManager.GetHwnd())), NativeMethods.WM_RESTART, IntPtr.Zero, IntPtr.Zero);
            }
            catch { }
        }

        private void ToggleAdaptive_CheckedChanged(object sender, EventArgs e)
        {
            var isChecked = ToggleAdaptive.Checked ? colorGrid1.Enabled = false : colorGrid1.Enabled = true;
        }
    }
}

<|start_filename|>WinNetMeter/Model/Update.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WinNetMeter.Model
{
    class Update
    {
        private string dashboardVersion;
        private List<string> changelog;

        public List<string> Changelog { get => changelog; set => changelog = value; }
        public string DashboardVersion { get => dashboardVersion; set => dashboardVersion = value; }
    } 
}


<|start_filename|>WinNetMeter/UserControls/Pages/Log.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.Pages
{
    partial class Log
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.linkDefaultLoc = new System.Windows.Forms.LinkLabel();
            this.txtLogPath = new System.Windows.Forms.TextBox();
            this.btnBrowseLog = new System.Windows.Forms.Button();
            this.label9 = new System.Windows.Forms.Label();
            this.toggleTraffic = new MetroFramework.Controls.MetroToggle();
            this.btnSaveLog = new System.Windows.Forms.Button();
            this.BtnTestHit = new WinNetMeter.Components.ButtonEx();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.linkDefaultLoc);
            this.groupBox1.Controls.Add(this.txtLogPath);
            this.groupBox1.Controls.Add(this.btnBrowseLog);
            this.groupBox1.Location = new System.Drawing.Point(26, 52);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(498, 110);
            this.groupBox1.TabIndex = 17;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Log location";
            // 
            // linkDefaultLoc
            // 
            this.linkDefaultLoc.AutoSize = true;
            this.linkDefaultLoc.Location = new System.Drawing.Point(10, 81);
            this.linkDefaultLoc.Name = "linkDefaultLoc";
            this.linkDefaultLoc.Size = new System.Drawing.Size(110, 13);
            this.linkDefaultLoc.TabIndex = 10;
            this.linkDefaultLoc.TabStop = true;
            this.linkDefaultLoc.Text = "Set to default location";
            // 
            // txtLogPath
            // 
            this.txtLogPath.Location = new System.Drawing.Point(13, 43);
            this.txtLogPath.Name = "txtLogPath";
            this.txtLogPath.Size = new System.Drawing.Size(391, 20);
            this.txtLogPath.TabIndex = 8;
            // 
            // btnBrowseLog
            // 
            this.btnBrowseLog.Location = new System.Drawing.Point(410, 41);
            this.btnBrowseLog.Name = "btnBrowseLog";
            this.btnBrowseLog.Size = new System.Drawing.Size(75, 23);
            this.btnBrowseLog.TabIndex = 9;
            this.btnBrowseLog.Text = "...";
            this.btnBrowseLog.UseVisualStyleBackColor = true;
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label9.Location = new System.Drawing.Point(23, 10);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(66, 17);
            this.label9.TabIndex = 16;
            this.label9.Text = "Traffic log";
            // 
            // toggleTraffic
            // 
            this.toggleTraffic.AutoSize = true;
            this.toggleTraffic.Checked = true;
            this.toggleTraffic.CheckState = System.Windows.Forms.CheckState.Checked;
            this.toggleTraffic.Enabled = false;
            this.toggleTraffic.Location = new System.Drawing.Point(441, 10);
            this.toggleTraffic.Name = "toggleTraffic";
            this.toggleTraffic.Size = new System.Drawing.Size(80, 17);
            this.toggleTraffic.TabIndex = 15;
            this.toggleTraffic.Text = "On";
            this.toggleTraffic.UseSelectable = true;
            this.toggleTraffic.CheckedChanged += new System.EventHandler(this.ToggleTraffic_CheckedChanged);
            // 
            // btnSaveLog
            // 
            this.btnSaveLog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnSaveLog.BackColor = System.Drawing.Color.Transparent;
            this.btnSaveLog.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
            this.btnSaveLog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnSaveLog.ForeColor = System.Drawing.Color.Black;
            this.btnSaveLog.Image = global::WinNetMeter.Properties.Resources.Checked_outline_16px;
            this.btnSaveLog.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnSaveLog.Location = new System.Drawing.Point(414, 375);
            this.btnSaveLog.Name = "btnSaveLog";
            this.btnSaveLog.Size = new System.Drawing.Size(121, 33);
            this.btnSaveLog.TabIndex = 18;
            this.btnSaveLog.Text = "  Save";
            this.btnSaveLog.UseVisualStyleBackColor = false;
            this.btnSaveLog.Click += new System.EventHandler(this.BtnSaveLog_Click);
            // 
            // BtnTestHit
            // 
            this.BtnTestHit.Location = new System.Drawing.Point(404, 216);
            this.BtnTestHit.Name = "BtnTestHit";
            this.BtnTestHit.Size = new System.Drawing.Size(107, 43);
            this.BtnTestHit.TabIndex = 19;
            this.BtnTestHit.Text = "buttonEx1";
            this.BtnTestHit.UseVisualStyleBackColor = true;
            this.BtnTestHit.Click += new System.EventHandler(this.BtnTestHit_Click);
            // 
            // Log
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ButtonHighlight;
            this.Controls.Add(this.BtnTestHit);
            this.Controls.Add(this.btnSaveLog);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.label9);
            this.Controls.Add(this.toggleTraffic);
            this.Name = "Log";
            this.Size = new System.Drawing.Size(560, 420);
            this.Load += new System.EventHandler(this.Log_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.Button btnSaveLog;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.LinkLabel linkDefaultLoc;
        private System.Windows.Forms.TextBox txtLogPath;
        private System.Windows.Forms.Button btnBrowseLog;
        private System.Windows.Forms.Label label9;
        private MetroFramework.Controls.MetroToggle toggleTraffic;
        private Components.ButtonEx BtnTestHit;
    }
}


<|start_filename|>WinNetMeter.Core/Model/EventLog.cs<|end_filename|>
﻿using System;
using WinNetMeter.Core.Helper;

namespace WinNetMeter.Core.Model
{
    public class EventLog
    {
        public static void WriteLog(string value)
        {
            RegistryManager registryManager = new RegistryManager();
            var appBase = registryManager.ReadFromRegistry("WinNetMeter", "AppBasePath");

            var path = $@"{appBase}\Sources\activity.log";
            var timeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            var data = $"{timeStamp} - {value}";

            FileHelper.WriteToFile(path, data);
        }
    }
}

<|start_filename|>WinNetMeter/Helper/Updater.cs<|end_filename|>
﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
using System.Windows.Forms;
using WinNetMeter.Model;

namespace WinNetMeter.Helper
{
    internal class Updater
    {
        private readonly string baseUrl = "https://cdn.winten.space";
        private readonly string urlUpdateConfig = "";
        private readonly string updaterConfig = "update-config.json";
        private WebClient client;
        private Update update;

        internal Updater()
        {
            urlUpdateConfig = $"{baseUrl}/products/win-netmeter/release/{updaterConfig}";
          
        }


        public bool IsUpdateAvailable()
        {
            bool Available = false;
            client = new WebClient();
            var data = client.DownloadString(urlUpdateConfig);

            update = JsonConvert.DeserializeObject<Update>(data);

            // Compare dashboard version
            Version currentVersion = new Version(Application.ProductVersion);
            Version latestDashboardVersion = new Version(update.DashboardVersion);

            var comparison = currentVersion.CompareTo(latestDashboardVersion);

            if (comparison < 0)
            {
                Available = true;
            }

            return Available;
        }

        public string getDashboardVersion()
        {
            return update.DashboardVersion;
        }


        public List<string> getChangelog()
        {
            return update.Changelog;
        }

        public void createFile()
        {
            File.Create("test.json").Close();
            Update update = new Update()
            {
                DashboardVersion = "1.0",
                Changelog = new List<string>()
                {
                    "ewoasdasd",
                    "asdasdasd"
                }
            };

            var json = JsonConvert.SerializeObject(update);
            File.WriteAllText("test.json", json);
        }
    }
}

<|start_filename|>WinNetMeter.Core/Helper/QueryBuilder.cs<|end_filename|>
﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using WinNetMeter.Core.Services;

namespace WinNetMeter.Core.Helper
{
    internal class QueryBuilder
    {
        private readonly DbConnection dbConnection;

        public QueryBuilder()
        {
            dbConnection = new DbConnection();
        }

        private static string SqlEscape(object str)
        {
            return Regex.Replace(str.ToString(), @"[\x00'""\b\n\r\t\cZ\\%]",
                delegate (Match match)
                {
                    var v = match.Value;
                    switch (v)
                    {
                        case "\x00": // ASCII NUL (0x00) character
                            return "\\0";

                        case "\b": // BACKSPACE character
                            return "\\b";

                        case "\n": // NEWLINE (linefeed) character
                            return "\\n";

                        case "\r": // CARRIAGE RETURN character
                            return "\\r";

                        case "\t": // TAB
                            return "\\t";

                        case "\u001A": // Ctrl-Z
                            return "\\Z";

                        default:
                            return "\\" + v;
                    }
                });
        }

        public bool IsTableExist(string tableName)
        {
            var isTableExist = false;

            var query = "SELECT * FROM " + tableName;
            var dTbl = dbConnection.ExecWithQuery(query);

            if (dTbl.Rows.Count > 0) isTableExist = true;

            return isTableExist;
        }

        public bool IsDataExist(string tableName, Dictionary<string, object> where)
        {
            string query = $"SELECT * FROM {tableName} WHERE {where.First().Key} = \'{where.First().Value}\'";
            var dTbl = dbConnection.ExecWithQuery(query);

            return dTbl.Rows.Count > 0;
        }

        public string GenerateId(string tableName, string id, string prefix)
        {
            var code = "";
            var idx = 0;
            var query = $"SELECT IFNULL(MAX(SUBSTRING({id}, 3, 4)), 0) as {id} from {tableName}";
            var dtTbl = dbConnection.ExecWithQuery(query);

            if (dtTbl.Rows.Count > 0)
                foreach (DataRow tmp in dtTbl.Rows)
                    idx = Convert.ToInt32(tmp[id].ToString());

            if (idx >= 0 && idx <= 8)
                code = prefix + "00" + Convert.ToInt32(idx + 1);
            else if (idx >= 9 && idx <= 98)
                code = prefix + "0" + Convert.ToInt32(idx + 1);
            else if (idx >= 99 && idx <= 998)
                code = prefix + Convert.ToInt32(idx + 1);

            return code
                ;
        }

        public DataTable Select(string tableName, string param)
        {
            var query1 = $"SELECT GROUP_CONCAT(column_name ORDER BY ordinal_position) as concat " +
                $"FROM information_schema.columns WHERE table_schema = DATABASE() and table_name = '{tableName}' " +
                $"GROUP BY table_name ORDER BY table_name";
            var dTbl1 = dbConnection.ExecWithQuery(query1);
            if (dTbl1.Rows.Count <= 0) return new DataTable(null);

            var concat = dTbl1.Rows[0];

            var query2 = $"SELECT * FROM {tableName} WHERE concat_ws({concat["concat"]}) like '%{param}%'";
            var dTbl2 = dbConnection.ExecWithQuery(query2);

            if (dTbl2.Rows.Count > 0)
                return dTbl2;
            return new DataTable(null);
        }

        public DataTable SelectAll(string tableName)
        {
            var query2 = "SELECT * FROM " + tableName;
            var dTbl2 = dbConnection.ExecWithQuery(query2);

            return dTbl2.Rows.Count > 0 ? dTbl2 : new DataTable(null);
        }

        public bool Insert(string tableName, Dictionary<string, string> data)
        {
            var insertOk = false;
            var column = "";
            var value = "";
            var count = 1;

            foreach (var val in data)
            {
                if (count != data.Count)
                {
                    column += val.Key + ",";
                    value += "'" + SqlEscape(val.Value.ToString()) + "',";
                }
                else
                {
                    column += val.Key;
                    value += "'" + SqlEscape(val.Value.ToString()) + "'";
                }

                count++;
            }

            var query = $"INSERT INTO {tableName} ({column}) VALUES ({value})";
            if (dbConnection.ExecNonQuery(query) > 0) insertOk = true;

            return insertOk;
        }

        public bool Update(string tableName, Dictionary<string, object> data, Dictionary<string, object> where)
        {
            var updateOk = false;
            var column = "";
            var count = 1;

            foreach (var val in data)
            {
                if (count != data.Count)
                    column += val.Key + " = '" + SqlEscape(val.Value.ToString()) + "', ";
                else
                    column += val.Key + " = '" + SqlEscape(val.Value.ToString()) + "' ";
                count++;
            }

            var query = $"UPDATE {tableName} SET {column} WHERE {where.First().Key} = \'{where.First().Value}\'";
            if (dbConnection.ExecNonQuery(query) > 0) updateOk = true;

            return updateOk;
        }

        public bool Delete(string tableName, Dictionary<string, object> where)
        {
            var deleteOk = false;

            var query = $"DELETE FROM {tableName} WHERE {where.First().Key} = \'{where.First().Value}\'";
            if (dbConnection.ExecNonQuery(query) > 0) deleteOk = true;

            return deleteOk;
        }

        public DataTable ExecWithQuery(string query)
        {
            var dTbl = dbConnection.ExecWithQuery(query);

            return dTbl.Rows.Count > 0 ? dTbl : new DataTable(null);
        }

        public bool ExecNonQuery(string query)
        {
            return dbConnection.ExecNonQuery(query) > 0;
        }
    }
}

<|start_filename|>WinNetMeter/Helper/UpdateHandler.cs<|end_filename|>
﻿using System;
using System.Diagnostics;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;
namespace WinNetMeter.Helper
{
    class UpdateHandler
    {
        public void InstallUpdate()
        {
            try
            {
                // Uninstall shell
                Integration integration = new Integration();
                integration.UninstallToolbar();

                FileHelper.SafeDelete("Updater.exe");
                FileHelper.SaveMove(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\WinTenDev\update\Updater.exe", "Updater.exe");

                // Running updater.exe for processing update files
                Process.Start("Updater.exe");
                Application.Exit();
            }catch(Exception ex)
            {
                MessageBox.Show("Error : " + ex.Message, "Unable to start updater", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
         
        }

    }
}


<|start_filename|>WinNetMeter.Shell/Deskband.cs<|end_filename|>
﻿using System;
using System.Drawing;
using System.Runtime.InteropServices;
using CSDeskBand;
using System.Windows.Forms;

namespace WinNetMeter.Shell
{
    [ComVisible(true)]
    [Guid("0F0283BE-FADD-4EAA-9984-9C1822AE469A")]
    [CSDeskBandRegistration(Name = "WinNetMeter", ShowDeskBand = false)]
    public class Deskband : CSDeskBandWin
    {
        private static Control _control;

        public Deskband()
        {
            Options.MinHorizontalSize = new Size(111, 30);
            _control = new DeskBandUI(this);
        }

        protected override Control Control => _control;
    }
}


<|start_filename|>WinNetMeter/UserControls/Pages/UpdaterPage.Designer.cs<|end_filename|>
﻿using WinNetMeter.UserControls.Controls;

namespace WinNetMeter.UserControls.Pages
{
    partial class UpdaterPage
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.panel1 = new System.Windows.Forms.Panel();
            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
            this.appUpdater1 = new WinNetMeter.UserControls.Controls.AppUpdater();
            this.BtnReset = new WinNetMeter.Components.ButtonEx();
            this.panel1.SuspendLayout();
            this.flowLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
            this.label2.Location = new System.Drawing.Point(8, 40);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(492, 38);
            this.label2.TabIndex = 22;
            this.label2.Text = "All application settings will be reset to default including general, style, shell" +
    " data, etc.\r\nWindows Explorer process may will be restarted. Make sure there is " +
    "no file operation activity.";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.BackColor = System.Drawing.Color.Transparent;
            this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
            this.label1.Location = new System.Drawing.Point(8, 9);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(115, 21);
            this.label1.TabIndex = 20;
            this.label1.Text = "Reset Settings";
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.label1);
            this.panel1.Controls.Add(this.BtnReset);
            this.panel1.Controls.Add(this.label2);
            this.panel1.Location = new System.Drawing.Point(3, 136);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(511, 162);
            this.panel1.TabIndex = 24;
            // 
            // flowLayoutPanel1
            // 
            this.flowLayoutPanel1.Controls.Add(this.appUpdater1);
            this.flowLayoutPanel1.Controls.Add(this.panel1);
            this.flowLayoutPanel1.Location = new System.Drawing.Point(13, 3);
            this.flowLayoutPanel1.Name = "flowLayoutPanel1";
            this.flowLayoutPanel1.Size = new System.Drawing.Size(523, 316);
            this.flowLayoutPanel1.TabIndex = 25;
            // 
            // appUpdater1
            // 
            this.appUpdater1.Location = new System.Drawing.Point(3, 3);
            this.appUpdater1.Name = "appUpdater1";
            this.appUpdater1.Size = new System.Drawing.Size(511, 127);
            this.appUpdater1.TabIndex = 9;
            // 
            // BtnReset
            // 
            this.BtnReset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.BtnReset.Location = new System.Drawing.Point(14, 91);
            this.BtnReset.Name = "BtnReset";
            this.BtnReset.Size = new System.Drawing.Size(140, 34);
            this.BtnReset.TabIndex = 23;
            this.BtnReset.Text = "ResetSettings";
            this.BtnReset.UseVisualStyleBackColor = true;
            this.BtnReset.Click += new System.EventHandler(this.BtnReset_Click);
            // 
            // UpdaterPage
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this.Controls.Add(this.flowLayoutPanel1);
            this.Name = "UpdaterPage";
            this.Size = new System.Drawing.Size(555, 344);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.flowLayoutPanel1.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion
        private AppUpdater appUpdater1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private Components.ButtonEx BtnReset;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
    }
}


<|start_filename|>WinNetMeter/Helper/ThisApp.cs<|end_filename|>
﻿using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using WinNetMeter.Core.Helper;

namespace WinNetMeter.Helper
{
    internal class ThisApp
    {
        public static void InstallUpdates()
        {
            string batUpdates = "install.bat";
            string baseExe = "WinNetMeter";
            string baseShell = "WinNetMeter.Shell";

            var FrameworkLocation = Environment.GetEnvironmentVariable("windir") + @"\Microsoft.NET\Framework64\v4.0.30319";
            var installToolbar = "";
            if (Directory.Exists(FrameworkLocation))
            {
                installToolbar = $"cd {FrameworkLocation}" +
                    $"\nregasm /codebase " + "\"" + AppDomain.CurrentDomain.BaseDirectory + @"WinNetMeter.Shell.dll" + "\"";
            }
            else
            {
                MessageBox.Show("May problem with Windows 32 Bit", "Updater");
            }

            string forBat =
               $"taskkill /f /im {baseExe}.exe" +
               $"\nmove {baseExe}.exe {baseExe}.exe.old" + // Backup old .exe
               $"\ncopy {baseShell}.dll {baseShell}.exe.old" + // backup old .dll
               $"\nmove {baseExe}.aim {baseExe}.exe" + // Move to new .exe
               $"\nmove {baseShell}.aim {baseShell}.dll" +
               $"\n{installToolbar}" +
               $"\ndel {baseExe}.aim" +
               $"\ndel {baseShell}.aim" +
               $"\ndel {batUpdates}" +
               $"\n{baseExe}.exe"; // Move to new .dll

            Integration integration = new Integration();
            integration.UninstallToolbar();

            FileHelper.SafeDelete(batUpdates);
            FileHelper.WriteBatFile(batUpdates, forBat, false);

            runBat(batUpdates);
            //Application.Exit();
        }

        public static bool IsUwpApp()
        {
            var helpers = new DesktopBridge.Helpers();
            return helpers.IsRunningAsUwp();
        }

        private static void runBat(string path)
        {
            //Executing the .bat file
            ProcessStartInfo process = new ProcessStartInfo();
            process.WorkingDirectory = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory + @path);
            process.FileName = "install.bat";
            process.Verb = "runas";
            process.WindowStyle = ProcessWindowStyle.Hidden;
            try
            {
                Process.Start(process);
            }
            catch { }
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage2.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.FirstRun
{
    partial class StartPage2
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.checkBox1 = new System.Windows.Forms.CheckBox();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Segoe UI Semibold", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
            this.label2.Location = new System.Drawing.Point(188, 212);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(395, 75);
            this.label2.TabIndex = 5;
            this.label2.Text = "You can also monitor bandwidth usage in each application running in the backgroun" +
    "d";
            this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Segoe UI", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(92, 176);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(589, 36);
            this.label1.TabIndex = 4;
            this.label1.Text = "Monitor app bandwith usage";
            this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Image = global::WinNetMeter.Properties.Resources.Tire_180px;
            this.pictureBox1.Location = new System.Drawing.Point(277, 32);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(206, 129);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pictureBox1.TabIndex = 3;
            this.pictureBox1.TabStop = false;
            // 
            // checkBox1
            // 
            this.checkBox1.AutoSize = true;
            this.checkBox1.Enabled = false;
            this.checkBox1.Font = new System.Drawing.Font("Segoe UI Semibold", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.checkBox1.Location = new System.Drawing.Point(267, 356);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(208, 21);
            this.checkBox1.TabIndex = 8;
            this.checkBox1.Text = "Enable app Bandwith monitor";
            this.checkBox1.UseVisualStyleBackColor = true;
            // 
            // StartPage2
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.checkBox1);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.pictureBox1);
            this.Name = "StartPage2";
            this.Size = new System.Drawing.Size(819, 510);
            this.Load += new System.EventHandler(this.StartPage2_Load);
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.CheckBox checkBox1;
    }
}


<|start_filename|>Updater/Helpers/FileHelper.cs<|end_filename|>
﻿using System;
using System.IO;

namespace Updater.Helper
{
    internal class FileHelper
    {
        public static void WriteBatFile(string path, string value, bool NewLine)
        {
            var writer = new StreamWriter(path, true);
            if (NewLine) writer.Write(Environment.NewLine);

            //Write the .bat script
            writer.Write(value);

            //Close the tread
            writer.Close();
        }

        public static void SafeDelete(string path)
        {
            if (File.Exists(path))
            {
                File.Delete(path);
            }
        }

        public static void SaveMove(string path, string newPath)
        {
            if (File.Exists(path))
            {
                File.Move(path, newPath);
            }
        }

        public static void SaveCopy(string path, string newPath)
        {
            if (File.Exists(path))
            {
                File.Copy(path, newPath, true);
            }
        }
    }
}

<|start_filename|>WinNetMeter/UserControls/Pages/Customize.Designer.cs<|end_filename|>
﻿namespace WinNetMeter.UserControls.Pages
{
    partial class Customize
    {
        /// <summary> 
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.panel2 = new System.Windows.Forms.Panel();
            this.label4 = new System.Windows.Forms.Label();
            this.ToggleAdaptive = new MetroFramework.Controls.MetroToggle();
            this.colorGrid1 = new Cyotek.Windows.Forms.ColorGrid();
            this.label14 = new System.Windows.Forms.Label();
            this.label15 = new System.Windows.Forms.Label();
            this.pictureBox3 = new System.Windows.Forms.PictureBox();
            this.ComboboxFont = new System.Windows.Forms.ComboBox();
            this.pictureBox4 = new System.Windows.Forms.PictureBox();
            this.label16 = new System.Windows.Forms.Label();
            this.radioPictOutline = new System.Windows.Forms.RadioButton();
            this.radioPictArrow = new System.Windows.Forms.RadioButton();
            this.pictureBox5 = new System.Windows.Forms.PictureBox();
            this.radioPictTriangleArrow = new System.Windows.Forms.RadioButton();
            this.pictureBox6 = new System.Windows.Forms.PictureBox();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.pictureBox2 = new System.Windows.Forms.PictureBox();
            this.btnSaveStyle = new System.Windows.Forms.Button();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
            this.SuspendLayout();
            // 
            // panel2
            // 
            this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
            | System.Windows.Forms.AnchorStyles.Left) 
            | System.Windows.Forms.AnchorStyles.Right)));
            this.panel2.AutoScroll = true;
            this.panel2.Controls.Add(this.label4);
            this.panel2.Controls.Add(this.ToggleAdaptive);
            this.panel2.Controls.Add(this.colorGrid1);
            this.panel2.Controls.Add(this.label14);
            this.panel2.Controls.Add(this.label15);
            this.panel2.Controls.Add(this.pictureBox3);
            this.panel2.Controls.Add(this.ComboboxFont);
            this.panel2.Controls.Add(this.pictureBox4);
            this.panel2.Controls.Add(this.label16);
            this.panel2.Controls.Add(this.radioPictOutline);
            this.panel2.Controls.Add(this.radioPictArrow);
            this.panel2.Controls.Add(this.pictureBox5);
            this.panel2.Controls.Add(this.radioPictTriangleArrow);
            this.panel2.Controls.Add(this.pictureBox6);
            this.panel2.Controls.Add(this.pictureBox1);
            this.panel2.Controls.Add(this.pictureBox2);
            this.panel2.Location = new System.Drawing.Point(10, 3);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(547, 359);
            this.panel2.TabIndex = 43;
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label4.Location = new System.Drawing.Point(14, 7);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(89, 17);
            this.label4.TabIndex = 42;
            this.label4.Text = "Adaptive style";
            // 
            // ToggleAdaptive
            // 
            this.ToggleAdaptive.AutoSize = true;
            this.ToggleAdaptive.Location = new System.Drawing.Point(434, 7);
            this.ToggleAdaptive.Name = "ToggleAdaptive";
            this.ToggleAdaptive.Size = new System.Drawing.Size(80, 17);
            this.ToggleAdaptive.TabIndex = 41;
            this.ToggleAdaptive.Text = "Off";
            this.ToggleAdaptive.UseSelectable = true;
            this.ToggleAdaptive.CheckedChanged += new System.EventHandler(this.ToggleAdaptive_CheckedChanged);
            // 
            // colorGrid1
            // 
            this.colorGrid1.Location = new System.Drawing.Point(16, 65);
            this.colorGrid1.Name = "colorGrid1";
            this.colorGrid1.Size = new System.Drawing.Size(247, 165);
            this.colorGrid1.TabIndex = 39;
            // 
            // label14
            // 
            this.label14.AutoSize = true;
            this.label14.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label14.ForeColor = System.Drawing.SystemColors.Highlight;
            this.label14.Location = new System.Drawing.Point(13, 250);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(50, 21);
            this.label14.TabIndex = 18;
            this.label14.Text = "Fonts";
            // 
            // label15
            // 
            this.label15.AutoSize = true;
            this.label15.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label15.ForeColor = System.Drawing.SystemColors.Highlight;
            this.label15.Location = new System.Drawing.Point(12, 41);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(84, 21);
            this.label15.TabIndex = 19;
            this.label15.Text = "Text Color";
            // 
            // pictureBox3
            // 
            this.pictureBox3.Image = global::WinNetMeter.Properties.Resources.Triangle_down_arrow_black_16px;
            this.pictureBox3.Location = new System.Drawing.Point(142, 368);
            this.pictureBox3.Name = "pictureBox3";
            this.pictureBox3.Size = new System.Drawing.Size(14, 14);
            this.pictureBox3.TabIndex = 38;
            this.pictureBox3.TabStop = false;
            // 
            // ComboboxFont
            // 
            this.ComboboxFont.BackColor = System.Drawing.SystemColors.Control;
            this.ComboboxFont.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.ComboboxFont.FormattingEnabled = true;
            this.ComboboxFont.Location = new System.Drawing.Point(17, 274);
            this.ComboboxFont.Name = "ComboboxFont";
            this.ComboboxFont.Size = new System.Drawing.Size(157, 21);
            this.ComboboxFont.TabIndex = 20;
            // 
            // pictureBox4
            // 
            this.pictureBox4.Image = global::WinNetMeter.Properties.Resources.Triangle_up_arrow_black_16px;
            this.pictureBox4.Location = new System.Drawing.Point(142, 351);
            this.pictureBox4.Name = "pictureBox4";
            this.pictureBox4.Size = new System.Drawing.Size(14, 14);
            this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pictureBox4.TabIndex = 37;
            this.pictureBox4.TabStop = false;
            // 
            // label16
            // 
            this.label16.AutoSize = true;
            this.label16.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label16.ForeColor = System.Drawing.SystemColors.Highlight;
            this.label16.Location = new System.Drawing.Point(13, 323);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(42, 21);
            this.label16.TabIndex = 22;
            this.label16.Text = "Icon";
            // 
            // radioPictOutline
            // 
            this.radioPictOutline.AutoSize = true;
            this.radioPictOutline.Location = new System.Drawing.Point(282, 361);
            this.radioPictOutline.Name = "radioPictOutline";
            this.radioPictOutline.Size = new System.Drawing.Size(14, 13);
            this.radioPictOutline.TabIndex = 35;
            this.radioPictOutline.UseVisualStyleBackColor = true;
            // 
            // radioPictArrow
            // 
            this.radioPictArrow.AutoSize = true;
            this.radioPictArrow.Checked = true;
            this.radioPictArrow.Location = new System.Drawing.Point(47, 361);
            this.radioPictArrow.Name = "radioPictArrow";
            this.radioPictArrow.Size = new System.Drawing.Size(14, 13);
            this.radioPictArrow.TabIndex = 27;
            this.radioPictArrow.TabStop = true;
            this.radioPictArrow.UseVisualStyleBackColor = true;
            // 
            // pictureBox5
            // 
            this.pictureBox5.Image = global::WinNetMeter.Properties.Resources.outline_arrow_down_black_16px;
            this.pictureBox5.Location = new System.Drawing.Point(258, 368);
            this.pictureBox5.Name = "pictureBox5";
            this.pictureBox5.Size = new System.Drawing.Size(14, 14);
            this.pictureBox5.TabIndex = 34;
            this.pictureBox5.TabStop = false;
            // 
            // radioPictTriangleArrow
            // 
            this.radioPictTriangleArrow.AutoSize = true;
            this.radioPictTriangleArrow.Location = new System.Drawing.Point(169, 361);
            this.radioPictTriangleArrow.Name = "radioPictTriangleArrow";
            this.radioPictTriangleArrow.Size = new System.Drawing.Size(14, 13);
            this.radioPictTriangleArrow.TabIndex = 28;
            this.radioPictTriangleArrow.UseVisualStyleBackColor = true;
            // 
            // pictureBox6
            // 
            this.pictureBox6.Image = global::WinNetMeter.Properties.Resources.outline_arrow_up_black_16px;
            this.pictureBox6.Location = new System.Drawing.Point(258, 351);
            this.pictureBox6.Name = "pictureBox6";
            this.pictureBox6.Size = new System.Drawing.Size(14, 14);
            this.pictureBox6.TabIndex = 33;
            this.pictureBox6.TabStop = false;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Image = global::WinNetMeter.Properties.Resources.up_black_16px;
            this.pictureBox1.Location = new System.Drawing.Point(17, 351);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(14, 14);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
            this.pictureBox1.TabIndex = 31;
            this.pictureBox1.TabStop = false;
            // 
            // pictureBox2
            // 
            this.pictureBox2.Image = global::WinNetMeter.Properties.Resources.down_black_16px;
            this.pictureBox2.Location = new System.Drawing.Point(24, 368);
            this.pictureBox2.Name = "pictureBox2";
            this.pictureBox2.Size = new System.Drawing.Size(14, 14);
            this.pictureBox2.TabIndex = 32;
            this.pictureBox2.TabStop = false;
            // 
            // btnSaveStyle
            // 
            this.btnSaveStyle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnSaveStyle.BackColor = System.Drawing.Color.Transparent;
            this.btnSaveStyle.FlatAppearance.BorderColor = System.Drawing.Color.Silver;
            this.btnSaveStyle.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            this.btnSaveStyle.ForeColor = System.Drawing.Color.Black;
            this.btnSaveStyle.Image = global::WinNetMeter.Properties.Resources.Checked_outline_16px;
            this.btnSaveStyle.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btnSaveStyle.Location = new System.Drawing.Point(414, 375);
            this.btnSaveStyle.Name = "btnSaveStyle";
            this.btnSaveStyle.Size = new System.Drawing.Size(121, 33);
            this.btnSaveStyle.TabIndex = 42;
            this.btnSaveStyle.Text = "  Save";
            this.btnSaveStyle.UseVisualStyleBackColor = false;
            this.btnSaveStyle.Click += new System.EventHandler(this.BtnSaveStyle_Click);
            // 
            // Customize
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ControlLightLight;
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.btnSaveStyle);
            this.Name = "Customize";
            this.Size = new System.Drawing.Size(560, 420);
            this.Load += new System.EventHandler(this.Customize_Load);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox6)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion


        private System.Windows.Forms.Panel panel2;
        private Cyotek.Windows.Forms.ColorGrid colorGrid1;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.PictureBox pictureBox3;
        private System.Windows.Forms.ComboBox ComboboxFont;
        private System.Windows.Forms.PictureBox pictureBox4;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.RadioButton radioPictOutline;
        private System.Windows.Forms.RadioButton radioPictArrow;
        private System.Windows.Forms.PictureBox pictureBox5;
        private System.Windows.Forms.RadioButton radioPictTriangleArrow;
        private System.Windows.Forms.PictureBox pictureBox6;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.PictureBox pictureBox2;
        private System.Windows.Forms.Button btnSaveStyle;
        private System.Windows.Forms.Label label4;
        private MetroFramework.Controls.MetroToggle ToggleAdaptive;
    }
}


<|start_filename|>WinNetMeter/UserControls/FirstRun/StartPage1.cs<|end_filename|>
﻿using System.Windows.Forms;

namespace WinNetMeter.UserControls.FirstRun
{
    public partial class StartPage1 : UserControl
    {
        public StartPage1()
        {
            InitializeComponent();
        }
    }
}