From c5a71c236367a7068fcc9d5da1e03883a4520f6b Mon Sep 17 00:00:00 2001 From: Bruce Wayne Date: Mon, 27 Jan 2020 14:55:26 +0800 Subject: [PATCH] Add a menu item --- Netch/Forms/MainForm.Designer.cs | 936 ++++++++++++++++--------------- Netch/Forms/MainForm.cs | 11 +- Netch/Resources/zh-CN | 1 + Netch/Utils/Utils.cs | 44 ++ 4 files changed, 526 insertions(+), 466 deletions(-) create mode 100644 Netch/Utils/Utils.cs diff --git a/Netch/Forms/MainForm.Designer.cs b/Netch/Forms/MainForm.Designer.cs index 157d777a..25ee0d0f 100644 --- a/Netch/Forms/MainForm.Designer.cs +++ b/Netch/Forms/MainForm.Designer.cs @@ -30,492 +30,501 @@ namespace Netch.Forms /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.MenuStrip = new System.Windows.Forms.MenuStrip(); - this.ServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ImportServersFromClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.AddSocks5ServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.AddShadowsocksServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.AddShadowsocksRServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.AddVMessServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.CreateProcessModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.SubscribeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ManageSubscribeLinksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.UpdateServersFromSubscribeLinksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.OptionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.ReloadModesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.RestartServiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.UninstallServiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.CleanDNSCacheToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.AboutToolStripButton = new System.Windows.Forms.ToolStripButton(); - this.VersionLabel = new System.Windows.Forms.ToolStripLabel(); - this.ConfigurationGroupBox = new System.Windows.Forms.GroupBox(); - this.ProfileNameText = new System.Windows.Forms.TextBox(); - this.ProfileLabel = new System.Windows.Forms.Label(); - this.SpeedPictureBox = new System.Windows.Forms.PictureBox(); - this.DeletePictureBox = new System.Windows.Forms.PictureBox(); - this.EditPictureBox = new System.Windows.Forms.PictureBox(); - this.ModeLabel = new System.Windows.Forms.Label(); - this.ModeComboBox = new System.Windows.Forms.SearchComboBox(); - this.ServerComboBox = new System.Windows.Forms.ComboBox(); - this.ServerLabel = new System.Windows.Forms.Label(); - this.StatusStrip = new System.Windows.Forms.StatusStrip(); - this.StatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.UsedBandwidthLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.DownloadSpeedLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.UploadSpeedLabel = new System.Windows.Forms.ToolStripStatusLabel(); - this.ControlButton = new System.Windows.Forms.Button(); - this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components); - this.NotifyMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.ShowMainFormToolStripButton = new System.Windows.Forms.ToolStripMenuItem(); - this.ExitToolStripButton = new System.Windows.Forms.ToolStripMenuItem(); - this.SettingsButton = new System.Windows.Forms.Button(); - this.ProfileGroupBox = new System.Windows.Forms.GroupBox(); - this.ProfileTable = new System.Windows.Forms.TableLayoutPanel(); - this.MenuStrip.SuspendLayout(); - this.ConfigurationGroupBox.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.EditPictureBox)).BeginInit(); - this.StatusStrip.SuspendLayout(); - this.NotifyMenu.SuspendLayout(); - this.ProfileGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // MenuStrip - // - this.MenuStrip.BackColor = System.Drawing.SystemColors.Control; - this.MenuStrip.ImageScalingSize = new System.Drawing.Size(20, 20); - this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.MenuStrip = new System.Windows.Forms.MenuStrip(); + this.ServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ImportServersFromClipboardToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AddSocks5ServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AddShadowsocksServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AddShadowsocksRServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AddVMessServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.CreateProcessModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ManageProcessModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.SubscribeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ManageSubscribeLinksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.UpdateServersFromSubscribeLinksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.OptionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.ReloadModesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.RestartServiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.UninstallServiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.CleanDNSCacheToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.AboutToolStripButton = new System.Windows.Forms.ToolStripButton(); + this.VersionLabel = new System.Windows.Forms.ToolStripLabel(); + this.ConfigurationGroupBox = new System.Windows.Forms.GroupBox(); + this.ProfileNameText = new System.Windows.Forms.TextBox(); + this.ProfileLabel = new System.Windows.Forms.Label(); + this.SpeedPictureBox = new System.Windows.Forms.PictureBox(); + this.DeletePictureBox = new System.Windows.Forms.PictureBox(); + this.EditPictureBox = new System.Windows.Forms.PictureBox(); + this.ModeLabel = new System.Windows.Forms.Label(); + this.ModeComboBox = new System.Windows.Forms.SearchComboBox(); + this.ServerComboBox = new System.Windows.Forms.ComboBox(); + this.ServerLabel = new System.Windows.Forms.Label(); + this.StatusStrip = new System.Windows.Forms.StatusStrip(); + this.StatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.UsedBandwidthLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.DownloadSpeedLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.UploadSpeedLabel = new System.Windows.Forms.ToolStripStatusLabel(); + this.ControlButton = new System.Windows.Forms.Button(); + this.NotifyIcon = new System.Windows.Forms.NotifyIcon(this.components); + this.NotifyMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.ShowMainFormToolStripButton = new System.Windows.Forms.ToolStripMenuItem(); + this.ExitToolStripButton = new System.Windows.Forms.ToolStripMenuItem(); + this.SettingsButton = new System.Windows.Forms.Button(); + this.ProfileGroupBox = new System.Windows.Forms.GroupBox(); + this.ProfileTable = new System.Windows.Forms.TableLayoutPanel(); + this.MenuStrip.SuspendLayout(); + this.ConfigurationGroupBox.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.EditPictureBox)).BeginInit(); + this.StatusStrip.SuspendLayout(); + this.NotifyMenu.SuspendLayout(); + this.ProfileGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // MenuStrip + // + this.MenuStrip.BackColor = System.Drawing.SystemColors.Control; + this.MenuStrip.ImageScalingSize = new System.Drawing.Size(20, 20); + this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ServerToolStripMenuItem, this.ModeToolStripMenuItem, this.SubscribeToolStripMenuItem, this.OptionsToolStripMenuItem, this.AboutToolStripButton, this.VersionLabel}); - this.MenuStrip.Location = new System.Drawing.Point(0, 0); - this.MenuStrip.Name = "MenuStrip"; - this.MenuStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.MenuStrip.Size = new System.Drawing.Size(608, 26); - this.MenuStrip.TabIndex = 0; - // - // ServerToolStripMenuItem - // - this.ServerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.MenuStrip.Location = new System.Drawing.Point(0, 0); + this.MenuStrip.Name = "MenuStrip"; + this.MenuStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; + this.MenuStrip.Size = new System.Drawing.Size(608, 26); + this.MenuStrip.TabIndex = 0; + // + // ServerToolStripMenuItem + // + this.ServerToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ImportServersFromClipboardToolStripMenuItem, this.AddSocks5ServerToolStripMenuItem, this.AddShadowsocksServerToolStripMenuItem, this.AddShadowsocksRServerToolStripMenuItem, this.AddVMessServerToolStripMenuItem}); - this.ServerToolStripMenuItem.Margin = new System.Windows.Forms.Padding(3, 0, 0, 1); - this.ServerToolStripMenuItem.Name = "ServerToolStripMenuItem"; - this.ServerToolStripMenuItem.Size = new System.Drawing.Size(57, 21); - this.ServerToolStripMenuItem.Text = "Server"; - // - // ImportServersFromClipboardToolStripMenuItem - // - this.ImportServersFromClipboardToolStripMenuItem.Name = "ImportServersFromClipboardToolStripMenuItem"; - this.ImportServersFromClipboardToolStripMenuItem.Size = new System.Drawing.Size(259, 22); - this.ImportServersFromClipboardToolStripMenuItem.Text = "Import Servers From Clipboard"; - this.ImportServersFromClipboardToolStripMenuItem.Click += new System.EventHandler(this.ImportServersFromClipboardToolStripMenuItem_Click); - // - // AddSocks5ServerToolStripMenuItem - // - this.AddSocks5ServerToolStripMenuItem.Name = "AddSocks5ServerToolStripMenuItem"; - this.AddSocks5ServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); - this.AddSocks5ServerToolStripMenuItem.Text = "Add [Socks5] Server"; - this.AddSocks5ServerToolStripMenuItem.Click += new System.EventHandler(this.AddSocks5ServerToolStripMenuItem_Click); - // - // AddShadowsocksServerToolStripMenuItem - // - this.AddShadowsocksServerToolStripMenuItem.Name = "AddShadowsocksServerToolStripMenuItem"; - this.AddShadowsocksServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); - this.AddShadowsocksServerToolStripMenuItem.Text = "Add [Shadowsocks] Server"; - this.AddShadowsocksServerToolStripMenuItem.Click += new System.EventHandler(this.AddShadowsocksServerToolStripMenuItem_Click); - // - // AddShadowsocksRServerToolStripMenuItem - // - this.AddShadowsocksRServerToolStripMenuItem.Name = "AddShadowsocksRServerToolStripMenuItem"; - this.AddShadowsocksRServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); - this.AddShadowsocksRServerToolStripMenuItem.Text = "Add [ShadowsocksR] Server"; - this.AddShadowsocksRServerToolStripMenuItem.Click += new System.EventHandler(this.AddShadowsocksRServerToolStripMenuItem_Click); - // - // AddVMessServerToolStripMenuItem - // - this.AddVMessServerToolStripMenuItem.Name = "AddVMessServerToolStripMenuItem"; - this.AddVMessServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); - this.AddVMessServerToolStripMenuItem.Text = "Add [VMess] Server"; - this.AddVMessServerToolStripMenuItem.Click += new System.EventHandler(this.AddVMessServerToolStripMenuItem_Click); - // - // ModeToolStripMenuItem - // - this.ModeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.CreateProcessModeToolStripMenuItem}); - this.ModeToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); - this.ModeToolStripMenuItem.Name = "ModeToolStripMenuItem"; - this.ModeToolStripMenuItem.Size = new System.Drawing.Size(55, 21); - this.ModeToolStripMenuItem.Text = "Mode"; - // - // CreateProcessModeToolStripMenuItem - // - this.CreateProcessModeToolStripMenuItem.Name = "CreateProcessModeToolStripMenuItem"; - this.CreateProcessModeToolStripMenuItem.Size = new System.Drawing.Size(202, 22); - this.CreateProcessModeToolStripMenuItem.Text = "Create Process Mode"; - this.CreateProcessModeToolStripMenuItem.Click += new System.EventHandler(this.CreateProcessModeToolStripButton_Click); - // - // SubscribeToolStripMenuItem - // - this.SubscribeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ServerToolStripMenuItem.Margin = new System.Windows.Forms.Padding(3, 0, 0, 1); + this.ServerToolStripMenuItem.Name = "ServerToolStripMenuItem"; + this.ServerToolStripMenuItem.Size = new System.Drawing.Size(57, 21); + this.ServerToolStripMenuItem.Text = "Server"; + // + // ImportServersFromClipboardToolStripMenuItem + // + this.ImportServersFromClipboardToolStripMenuItem.Name = "ImportServersFromClipboardToolStripMenuItem"; + this.ImportServersFromClipboardToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.ImportServersFromClipboardToolStripMenuItem.Text = "Import Servers From Clipboard"; + this.ImportServersFromClipboardToolStripMenuItem.Click += new System.EventHandler(this.ImportServersFromClipboardToolStripMenuItem_Click); + // + // AddSocks5ServerToolStripMenuItem + // + this.AddSocks5ServerToolStripMenuItem.Name = "AddSocks5ServerToolStripMenuItem"; + this.AddSocks5ServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddSocks5ServerToolStripMenuItem.Text = "Add [Socks5] Server"; + this.AddSocks5ServerToolStripMenuItem.Click += new System.EventHandler(this.AddSocks5ServerToolStripMenuItem_Click); + // + // AddShadowsocksServerToolStripMenuItem + // + this.AddShadowsocksServerToolStripMenuItem.Name = "AddShadowsocksServerToolStripMenuItem"; + this.AddShadowsocksServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddShadowsocksServerToolStripMenuItem.Text = "Add [Shadowsocks] Server"; + this.AddShadowsocksServerToolStripMenuItem.Click += new System.EventHandler(this.AddShadowsocksServerToolStripMenuItem_Click); + // + // AddShadowsocksRServerToolStripMenuItem + // + this.AddShadowsocksRServerToolStripMenuItem.Name = "AddShadowsocksRServerToolStripMenuItem"; + this.AddShadowsocksRServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddShadowsocksRServerToolStripMenuItem.Text = "Add [ShadowsocksR] Server"; + this.AddShadowsocksRServerToolStripMenuItem.Click += new System.EventHandler(this.AddShadowsocksRServerToolStripMenuItem_Click); + // + // AddVMessServerToolStripMenuItem + // + this.AddVMessServerToolStripMenuItem.Name = "AddVMessServerToolStripMenuItem"; + this.AddVMessServerToolStripMenuItem.Size = new System.Drawing.Size(259, 22); + this.AddVMessServerToolStripMenuItem.Text = "Add [VMess] Server"; + this.AddVMessServerToolStripMenuItem.Click += new System.EventHandler(this.AddVMessServerToolStripMenuItem_Click); + // + // ModeToolStripMenuItem + // + this.ModeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.CreateProcessModeToolStripMenuItem, + this.ManageProcessModeToolStripMenuItem}); + this.ModeToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); + this.ModeToolStripMenuItem.Name = "ModeToolStripMenuItem"; + this.ModeToolStripMenuItem.Size = new System.Drawing.Size(55, 21); + this.ModeToolStripMenuItem.Text = "Mode"; + // + // CreateProcessModeToolStripMenuItem + // + this.CreateProcessModeToolStripMenuItem.Name = "CreateProcessModeToolStripMenuItem"; + this.CreateProcessModeToolStripMenuItem.Size = new System.Drawing.Size(212, 22); + this.CreateProcessModeToolStripMenuItem.Text = "Create Process Mode"; + this.CreateProcessModeToolStripMenuItem.Click += new System.EventHandler(this.CreateProcessModeToolStripButton_Click); + // + // ManageProcessModeToolStripMenuItem + // + this.ManageProcessModeToolStripMenuItem.Name = "ManageProcessModeToolStripMenuItem"; + this.ManageProcessModeToolStripMenuItem.Size = new System.Drawing.Size(212, 22); + this.ManageProcessModeToolStripMenuItem.Text = "Manage Process Mode"; + this.ManageProcessModeToolStripMenuItem.Click += new System.EventHandler(this.ManageProcessModeToolStripMenuItem_Click); + // + // SubscribeToolStripMenuItem + // + this.SubscribeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ManageSubscribeLinksToolStripMenuItem, this.UpdateServersFromSubscribeLinksToolStripMenuItem}); - this.SubscribeToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); - this.SubscribeToolStripMenuItem.Name = "SubscribeToolStripMenuItem"; - this.SubscribeToolStripMenuItem.Size = new System.Drawing.Size(77, 21); - this.SubscribeToolStripMenuItem.Text = "Subscribe"; - // - // ManageSubscribeLinksToolStripMenuItem - // - this.ManageSubscribeLinksToolStripMenuItem.Name = "ManageSubscribeLinksToolStripMenuItem"; - this.ManageSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(294, 22); - this.ManageSubscribeLinksToolStripMenuItem.Text = "Manage Subscribe Links"; - this.ManageSubscribeLinksToolStripMenuItem.Click += new System.EventHandler(this.ManageSubscribeLinksToolStripMenuItem_Click); - // - // UpdateServersFromSubscribeLinksToolStripMenuItem - // - this.UpdateServersFromSubscribeLinksToolStripMenuItem.Name = "UpdateServersFromSubscribeLinksToolStripMenuItem"; - this.UpdateServersFromSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(294, 22); - this.UpdateServersFromSubscribeLinksToolStripMenuItem.Text = "Update Servers From Subscribe Links"; - this.UpdateServersFromSubscribeLinksToolStripMenuItem.Click += new System.EventHandler(this.UpdateServersFromSubscribeLinksToolStripMenuItem_Click); - // - // OptionsToolStripMenuItem - // - this.OptionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.SubscribeToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); + this.SubscribeToolStripMenuItem.Name = "SubscribeToolStripMenuItem"; + this.SubscribeToolStripMenuItem.Size = new System.Drawing.Size(77, 21); + this.SubscribeToolStripMenuItem.Text = "Subscribe"; + // + // ManageSubscribeLinksToolStripMenuItem + // + this.ManageSubscribeLinksToolStripMenuItem.Name = "ManageSubscribeLinksToolStripMenuItem"; + this.ManageSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(294, 22); + this.ManageSubscribeLinksToolStripMenuItem.Text = "Manage Subscribe Links"; + this.ManageSubscribeLinksToolStripMenuItem.Click += new System.EventHandler(this.ManageSubscribeLinksToolStripMenuItem_Click); + // + // UpdateServersFromSubscribeLinksToolStripMenuItem + // + this.UpdateServersFromSubscribeLinksToolStripMenuItem.Name = "UpdateServersFromSubscribeLinksToolStripMenuItem"; + this.UpdateServersFromSubscribeLinksToolStripMenuItem.Size = new System.Drawing.Size(294, 22); + this.UpdateServersFromSubscribeLinksToolStripMenuItem.Text = "Update Servers From Subscribe Links"; + this.UpdateServersFromSubscribeLinksToolStripMenuItem.Click += new System.EventHandler(this.UpdateServersFromSubscribeLinksToolStripMenuItem_Click); + // + // OptionsToolStripMenuItem + // + this.OptionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ReloadModesToolStripMenuItem, this.RestartServiceToolStripMenuItem, this.UninstallServiceToolStripMenuItem, this.CleanDNSCacheToolStripMenuItem}); - this.OptionsToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); - this.OptionsToolStripMenuItem.Name = "OptionsToolStripMenuItem"; - this.OptionsToolStripMenuItem.Size = new System.Drawing.Size(66, 21); - this.OptionsToolStripMenuItem.Text = "Options"; - // - // ReloadModesToolStripMenuItem - // - this.ReloadModesToolStripMenuItem.Name = "ReloadModesToolStripMenuItem"; - this.ReloadModesToolStripMenuItem.Size = new System.Drawing.Size(177, 22); - this.ReloadModesToolStripMenuItem.Text = "Reload Modes"; - this.ReloadModesToolStripMenuItem.Click += new System.EventHandler(this.ReloadModesToolStripMenuItem_Click); - // - // RestartServiceToolStripMenuItem - // - this.RestartServiceToolStripMenuItem.Name = "RestartServiceToolStripMenuItem"; - this.RestartServiceToolStripMenuItem.Size = new System.Drawing.Size(177, 22); - this.RestartServiceToolStripMenuItem.Text = "Restart Service"; - this.RestartServiceToolStripMenuItem.Click += new System.EventHandler(this.RestartServiceToolStripMenuItem_Click); - // - // UninstallServiceToolStripMenuItem - // - this.UninstallServiceToolStripMenuItem.Name = "UninstallServiceToolStripMenuItem"; - this.UninstallServiceToolStripMenuItem.Size = new System.Drawing.Size(177, 22); - this.UninstallServiceToolStripMenuItem.Text = "Uninstall Service"; - this.UninstallServiceToolStripMenuItem.Click += new System.EventHandler(this.UninstallServiceToolStripMenuItem_Click); - // - // CleanDNSCacheToolStripMenuItem - // - this.CleanDNSCacheToolStripMenuItem.Name = "CleanDNSCacheToolStripMenuItem"; - this.CleanDNSCacheToolStripMenuItem.Size = new System.Drawing.Size(177, 22); - this.CleanDNSCacheToolStripMenuItem.Text = "Clean DNS Cache"; - this.CleanDNSCacheToolStripMenuItem.Click += new System.EventHandler(this.CleanDNSCacheToolStripMenuItem_Click); - // - // AboutToolStripButton - // - this.AboutToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.AboutToolStripButton.AutoToolTip = false; - this.AboutToolStripButton.Margin = new System.Windows.Forms.Padding(0, 0, 3, 1); - this.AboutToolStripButton.Name = "AboutToolStripButton"; - this.AboutToolStripButton.Size = new System.Drawing.Size(47, 21); - this.AboutToolStripButton.Text = "About"; - this.AboutToolStripButton.Click += new System.EventHandler(this.AboutToolStripButton_Click); - // - // VersionLabel - // - this.VersionLabel.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.VersionLabel.BackColor = System.Drawing.Color.Transparent; - this.VersionLabel.ForeColor = System.Drawing.Color.Red; - this.VersionLabel.IsLink = true; - this.VersionLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; - this.VersionLabel.Name = "VersionLabel"; - this.VersionLabel.Size = new System.Drawing.Size(32, 19); - this.VersionLabel.Text = "x.x.x"; - this.VersionLabel.Click += new System.EventHandler(this.VersionLabel_Click); - // - // ConfigurationGroupBox - // - this.ConfigurationGroupBox.Controls.Add(this.ProfileNameText); - this.ConfigurationGroupBox.Controls.Add(this.ProfileLabel); - this.ConfigurationGroupBox.Controls.Add(this.SpeedPictureBox); - this.ConfigurationGroupBox.Controls.Add(this.DeletePictureBox); - this.ConfigurationGroupBox.Controls.Add(this.EditPictureBox); - this.ConfigurationGroupBox.Controls.Add(this.ModeLabel); - this.ConfigurationGroupBox.Controls.Add(this.ModeComboBox); - this.ConfigurationGroupBox.Controls.Add(this.ServerComboBox); - this.ConfigurationGroupBox.Controls.Add(this.ServerLabel); - this.ConfigurationGroupBox.Location = new System.Drawing.Point(12, 28); - this.ConfigurationGroupBox.Name = "ConfigurationGroupBox"; - this.ConfigurationGroupBox.Size = new System.Drawing.Size(584, 113); - this.ConfigurationGroupBox.TabIndex = 1; - this.ConfigurationGroupBox.TabStop = false; - this.ConfigurationGroupBox.Text = "Configuration"; - // - // ProfileNameText - // - this.ProfileNameText.Location = new System.Drawing.Point(57, 83); - this.ProfileNameText.Name = "ProfileNameText"; - this.ProfileNameText.Size = new System.Drawing.Size(455, 23); - this.ProfileNameText.TabIndex = 11; - // - // ProfileLabel - // - this.ProfileLabel.AutoSize = true; - this.ProfileLabel.Location = new System.Drawing.Point(6, 86); - this.ProfileLabel.Name = "ProfileLabel"; - this.ProfileLabel.Size = new System.Drawing.Size(84, 17); - this.ProfileLabel.TabIndex = 10; - this.ProfileLabel.Text = "Profile"; - // - // SpeedPictureBox - // - this.SpeedPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.SpeedPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("SpeedPictureBox.Image"))); - this.SpeedPictureBox.Location = new System.Drawing.Point(562, 26); - this.SpeedPictureBox.Name = "SpeedPictureBox"; - this.SpeedPictureBox.Size = new System.Drawing.Size(16, 16); - this.SpeedPictureBox.TabIndex = 9; - this.SpeedPictureBox.TabStop = false; - this.SpeedPictureBox.Click += new System.EventHandler(this.SpeedPictureBox_Click); - // - // DeletePictureBox - // - this.DeletePictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.DeletePictureBox.Image = ((System.Drawing.Image)(resources.GetObject("DeletePictureBox.Image"))); - this.DeletePictureBox.Location = new System.Drawing.Point(540, 26); - this.DeletePictureBox.Name = "DeletePictureBox"; - this.DeletePictureBox.Size = new System.Drawing.Size(16, 16); - this.DeletePictureBox.TabIndex = 8; - this.DeletePictureBox.TabStop = false; - this.DeletePictureBox.Click += new System.EventHandler(this.DeletePictureBox_Click); - // - // EditPictureBox - // - this.EditPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.EditPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("EditPictureBox.Image"))); - this.EditPictureBox.Location = new System.Drawing.Point(518, 26); - this.EditPictureBox.Name = "EditPictureBox"; - this.EditPictureBox.Size = new System.Drawing.Size(16, 16); - this.EditPictureBox.TabIndex = 7; - this.EditPictureBox.TabStop = false; - this.EditPictureBox.Click += new System.EventHandler(this.EditPictureBox_Click); - // - // ModeLabel - // - this.ModeLabel.AutoSize = true; - this.ModeLabel.Location = new System.Drawing.Point(6, 56); - this.ModeLabel.Name = "ModeLabel"; - this.ModeLabel.Size = new System.Drawing.Size(43, 17); - this.ModeLabel.TabIndex = 3; - this.ModeLabel.Text = "Mode"; - // - // ModeComboBox - // - this.ModeComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ModeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; - this.ModeComboBox.FormattingEnabled = true; - this.ModeComboBox.IntegralHeight = false; - this.ModeComboBox.Location = new System.Drawing.Point(57, 53); - this.ModeComboBox.Name = "ModeComboBox"; - this.ModeComboBox.Size = new System.Drawing.Size(455, 24); - this.ModeComboBox.TabIndex = 2; - this.ModeComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); - // - // ServerComboBox - // - this.ServerComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ServerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ServerComboBox.FormattingEnabled = true; - this.ServerComboBox.IntegralHeight = false; - this.ServerComboBox.Location = new System.Drawing.Point(57, 22); - this.ServerComboBox.MaxDropDownItems = 16; - this.ServerComboBox.Name = "ServerComboBox"; - this.ServerComboBox.Size = new System.Drawing.Size(455, 24); - this.ServerComboBox.TabIndex = 1; - this.ServerComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); - // - // ServerLabel - // - this.ServerLabel.AutoSize = true; - this.ServerLabel.Location = new System.Drawing.Point(6, 26); - this.ServerLabel.Name = "ServerLabel"; - this.ServerLabel.Size = new System.Drawing.Size(45, 17); - this.ServerLabel.TabIndex = 0; - this.ServerLabel.Text = "Server"; - // - // StatusStrip - // - this.StatusStrip.ImageScalingSize = new System.Drawing.Size(20, 20); - this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.OptionsToolStripMenuItem.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); + this.OptionsToolStripMenuItem.Name = "OptionsToolStripMenuItem"; + this.OptionsToolStripMenuItem.Size = new System.Drawing.Size(66, 21); + this.OptionsToolStripMenuItem.Text = "Options"; + // + // ReloadModesToolStripMenuItem + // + this.ReloadModesToolStripMenuItem.Name = "ReloadModesToolStripMenuItem"; + this.ReloadModesToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.ReloadModesToolStripMenuItem.Text = "Reload Modes"; + this.ReloadModesToolStripMenuItem.Click += new System.EventHandler(this.ReloadModesToolStripMenuItem_Click); + // + // RestartServiceToolStripMenuItem + // + this.RestartServiceToolStripMenuItem.Name = "RestartServiceToolStripMenuItem"; + this.RestartServiceToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.RestartServiceToolStripMenuItem.Text = "Restart Service"; + this.RestartServiceToolStripMenuItem.Click += new System.EventHandler(this.RestartServiceToolStripMenuItem_Click); + // + // UninstallServiceToolStripMenuItem + // + this.UninstallServiceToolStripMenuItem.Name = "UninstallServiceToolStripMenuItem"; + this.UninstallServiceToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.UninstallServiceToolStripMenuItem.Text = "Uninstall Service"; + this.UninstallServiceToolStripMenuItem.Click += new System.EventHandler(this.UninstallServiceToolStripMenuItem_Click); + // + // CleanDNSCacheToolStripMenuItem + // + this.CleanDNSCacheToolStripMenuItem.Name = "CleanDNSCacheToolStripMenuItem"; + this.CleanDNSCacheToolStripMenuItem.Size = new System.Drawing.Size(177, 22); + this.CleanDNSCacheToolStripMenuItem.Text = "Clean DNS Cache"; + this.CleanDNSCacheToolStripMenuItem.Click += new System.EventHandler(this.CleanDNSCacheToolStripMenuItem_Click); + // + // AboutToolStripButton + // + this.AboutToolStripButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.AboutToolStripButton.AutoToolTip = false; + this.AboutToolStripButton.Margin = new System.Windows.Forms.Padding(0, 0, 3, 1); + this.AboutToolStripButton.Name = "AboutToolStripButton"; + this.AboutToolStripButton.Size = new System.Drawing.Size(47, 21); + this.AboutToolStripButton.Text = "About"; + this.AboutToolStripButton.Click += new System.EventHandler(this.AboutToolStripButton_Click); + // + // VersionLabel + // + this.VersionLabel.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.VersionLabel.BackColor = System.Drawing.Color.Transparent; + this.VersionLabel.ForeColor = System.Drawing.Color.Red; + this.VersionLabel.IsLink = true; + this.VersionLabel.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; + this.VersionLabel.Name = "VersionLabel"; + this.VersionLabel.Size = new System.Drawing.Size(32, 19); + this.VersionLabel.Text = "x.x.x"; + this.VersionLabel.Click += new System.EventHandler(this.VersionLabel_Click); + // + // ConfigurationGroupBox + // + this.ConfigurationGroupBox.Controls.Add(this.ProfileNameText); + this.ConfigurationGroupBox.Controls.Add(this.ProfileLabel); + this.ConfigurationGroupBox.Controls.Add(this.SpeedPictureBox); + this.ConfigurationGroupBox.Controls.Add(this.DeletePictureBox); + this.ConfigurationGroupBox.Controls.Add(this.EditPictureBox); + this.ConfigurationGroupBox.Controls.Add(this.ModeLabel); + this.ConfigurationGroupBox.Controls.Add(this.ModeComboBox); + this.ConfigurationGroupBox.Controls.Add(this.ServerComboBox); + this.ConfigurationGroupBox.Controls.Add(this.ServerLabel); + this.ConfigurationGroupBox.Location = new System.Drawing.Point(12, 28); + this.ConfigurationGroupBox.Name = "ConfigurationGroupBox"; + this.ConfigurationGroupBox.Size = new System.Drawing.Size(584, 113); + this.ConfigurationGroupBox.TabIndex = 1; + this.ConfigurationGroupBox.TabStop = false; + this.ConfigurationGroupBox.Text = "Configuration"; + // + // ProfileNameText + // + this.ProfileNameText.Location = new System.Drawing.Point(57, 83); + this.ProfileNameText.Name = "ProfileNameText"; + this.ProfileNameText.Size = new System.Drawing.Size(455, 23); + this.ProfileNameText.TabIndex = 11; + // + // ProfileLabel + // + this.ProfileLabel.AutoSize = true; + this.ProfileLabel.Location = new System.Drawing.Point(6, 86); + this.ProfileLabel.Name = "ProfileLabel"; + this.ProfileLabel.Size = new System.Drawing.Size(45, 17); + this.ProfileLabel.TabIndex = 10; + this.ProfileLabel.Text = "Profile"; + // + // SpeedPictureBox + // + this.SpeedPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; + this.SpeedPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("SpeedPictureBox.Image"))); + this.SpeedPictureBox.Location = new System.Drawing.Point(562, 26); + this.SpeedPictureBox.Name = "SpeedPictureBox"; + this.SpeedPictureBox.Size = new System.Drawing.Size(16, 16); + this.SpeedPictureBox.TabIndex = 9; + this.SpeedPictureBox.TabStop = false; + this.SpeedPictureBox.Click += new System.EventHandler(this.SpeedPictureBox_Click); + // + // DeletePictureBox + // + this.DeletePictureBox.Cursor = System.Windows.Forms.Cursors.Hand; + this.DeletePictureBox.Image = ((System.Drawing.Image)(resources.GetObject("DeletePictureBox.Image"))); + this.DeletePictureBox.Location = new System.Drawing.Point(540, 26); + this.DeletePictureBox.Name = "DeletePictureBox"; + this.DeletePictureBox.Size = new System.Drawing.Size(16, 16); + this.DeletePictureBox.TabIndex = 8; + this.DeletePictureBox.TabStop = false; + this.DeletePictureBox.Click += new System.EventHandler(this.DeletePictureBox_Click); + // + // EditPictureBox + // + this.EditPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; + this.EditPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("EditPictureBox.Image"))); + this.EditPictureBox.Location = new System.Drawing.Point(518, 26); + this.EditPictureBox.Name = "EditPictureBox"; + this.EditPictureBox.Size = new System.Drawing.Size(16, 16); + this.EditPictureBox.TabIndex = 7; + this.EditPictureBox.TabStop = false; + this.EditPictureBox.Click += new System.EventHandler(this.EditPictureBox_Click); + // + // ModeLabel + // + this.ModeLabel.AutoSize = true; + this.ModeLabel.Location = new System.Drawing.Point(6, 56); + this.ModeLabel.Name = "ModeLabel"; + this.ModeLabel.Size = new System.Drawing.Size(43, 17); + this.ModeLabel.TabIndex = 3; + this.ModeLabel.Text = "Mode"; + // + // ModeComboBox + // + this.ModeComboBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.ModeComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.ModeComboBox.FormattingEnabled = true; + this.ModeComboBox.IntegralHeight = false; + this.ModeComboBox.Location = new System.Drawing.Point(57, 53); + this.ModeComboBox.Name = "ModeComboBox"; + this.ModeComboBox.Size = new System.Drawing.Size(455, 24); + this.ModeComboBox.TabIndex = 2; + this.ModeComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); + // + // ServerComboBox + // + this.ServerComboBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.ServerComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.ServerComboBox.FormattingEnabled = true; + this.ServerComboBox.IntegralHeight = false; + this.ServerComboBox.Location = new System.Drawing.Point(57, 22); + this.ServerComboBox.MaxDropDownItems = 16; + this.ServerComboBox.Name = "ServerComboBox"; + this.ServerComboBox.Size = new System.Drawing.Size(455, 24); + this.ServerComboBox.TabIndex = 1; + this.ServerComboBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ComboBox_DrawItem); + // + // ServerLabel + // + this.ServerLabel.AutoSize = true; + this.ServerLabel.Location = new System.Drawing.Point(6, 26); + this.ServerLabel.Name = "ServerLabel"; + this.ServerLabel.Size = new System.Drawing.Size(45, 17); + this.ServerLabel.TabIndex = 0; + this.ServerLabel.Text = "Server"; + // + // StatusStrip + // + this.StatusStrip.ImageScalingSize = new System.Drawing.Size(20, 20); + this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.StatusLabel, this.UsedBandwidthLabel, this.DownloadSpeedLabel, this.UploadSpeedLabel}); - this.StatusStrip.Location = new System.Drawing.Point(0, 254); - this.StatusStrip.Name = "StatusStrip"; - this.StatusStrip.Size = new System.Drawing.Size(608, 22); - this.StatusStrip.SizingGrip = false; - this.StatusStrip.TabIndex = 2; - // - // StatusLabel - // - this.StatusLabel.BackColor = System.Drawing.Color.Transparent; - this.StatusLabel.Name = "StatusLabel"; - this.StatusLabel.Size = new System.Drawing.Size(177, 17); - this.StatusLabel.Text = "Status: Waiting for command"; - // - // UsedBandwidthLabel - // - this.UsedBandwidthLabel.Name = "UsedBandwidthLabel"; - this.UsedBandwidthLabel.Size = new System.Drawing.Size(72, 17); - this.UsedBandwidthLabel.Text = "Used: 0 KB"; - this.UsedBandwidthLabel.Visible = false; - // - // DownloadSpeedLabel - // - this.DownloadSpeedLabel.Name = "DownloadSpeedLabel"; - this.DownloadSpeedLabel.Size = new System.Drawing.Size(59, 17); - this.DownloadSpeedLabel.Text = "↓: 0 KB/s"; - this.DownloadSpeedLabel.Visible = false; - // - // UploadSpeedLabel - // - this.UploadSpeedLabel.Name = "UploadSpeedLabel"; - this.UploadSpeedLabel.Size = new System.Drawing.Size(59, 17); - this.UploadSpeedLabel.Text = "↑: 0 KB/s"; - this.UploadSpeedLabel.Visible = false; - // - // ControlButton - // - this.ControlButton.Location = new System.Drawing.Point(521, 219); - this.ControlButton.Name = "ControlButton"; - this.ControlButton.Size = new System.Drawing.Size(75, 27); - this.ControlButton.TabIndex = 3; - this.ControlButton.Text = "Start"; - this.ControlButton.UseVisualStyleBackColor = true; - this.ControlButton.Click += new System.EventHandler(this.ControlButton_Click); - // - // NotifyIcon - // - this.NotifyIcon.ContextMenuStrip = this.NotifyMenu; - this.NotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIcon.Icon"))); - this.NotifyIcon.Text = "Netch"; - this.NotifyIcon.Visible = true; - this.NotifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon_MouseDoubleClick); - // - // NotifyMenu - // - this.NotifyMenu.ImageScalingSize = new System.Drawing.Size(20, 20); - this.NotifyMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.StatusStrip.Location = new System.Drawing.Point(0, 254); + this.StatusStrip.Name = "StatusStrip"; + this.StatusStrip.Size = new System.Drawing.Size(608, 22); + this.StatusStrip.SizingGrip = false; + this.StatusStrip.TabIndex = 2; + // + // StatusLabel + // + this.StatusLabel.BackColor = System.Drawing.Color.Transparent; + this.StatusLabel.Name = "StatusLabel"; + this.StatusLabel.Size = new System.Drawing.Size(177, 17); + this.StatusLabel.Text = "Status: Waiting for command"; + // + // UsedBandwidthLabel + // + this.UsedBandwidthLabel.Name = "UsedBandwidthLabel"; + this.UsedBandwidthLabel.Size = new System.Drawing.Size(72, 17); + this.UsedBandwidthLabel.Text = "Used: 0 KB"; + this.UsedBandwidthLabel.Visible = false; + // + // DownloadSpeedLabel + // + this.DownloadSpeedLabel.Name = "DownloadSpeedLabel"; + this.DownloadSpeedLabel.Size = new System.Drawing.Size(59, 17); + this.DownloadSpeedLabel.Text = "↓: 0 KB/s"; + this.DownloadSpeedLabel.Visible = false; + // + // UploadSpeedLabel + // + this.UploadSpeedLabel.Name = "UploadSpeedLabel"; + this.UploadSpeedLabel.Size = new System.Drawing.Size(59, 17); + this.UploadSpeedLabel.Text = "↑: 0 KB/s"; + this.UploadSpeedLabel.Visible = false; + // + // ControlButton + // + this.ControlButton.Location = new System.Drawing.Point(521, 219); + this.ControlButton.Name = "ControlButton"; + this.ControlButton.Size = new System.Drawing.Size(75, 27); + this.ControlButton.TabIndex = 3; + this.ControlButton.Text = "Start"; + this.ControlButton.UseVisualStyleBackColor = true; + this.ControlButton.Click += new System.EventHandler(this.ControlButton_Click); + // + // NotifyIcon + // + this.NotifyIcon.ContextMenuStrip = this.NotifyMenu; + this.NotifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIcon.Icon"))); + this.NotifyIcon.Text = "Netch"; + this.NotifyIcon.Visible = true; + this.NotifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon_MouseDoubleClick); + // + // NotifyMenu + // + this.NotifyMenu.ImageScalingSize = new System.Drawing.Size(20, 20); + this.NotifyMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ShowMainFormToolStripButton, this.ExitToolStripButton}); - this.NotifyMenu.Name = "NotifyMenu"; - this.NotifyMenu.ShowItemToolTips = false; - this.NotifyMenu.Size = new System.Drawing.Size(108, 48); - // - // ShowMainFormToolStripButton - // - this.ShowMainFormToolStripButton.Name = "ShowMainFormToolStripButton"; - this.ShowMainFormToolStripButton.Size = new System.Drawing.Size(107, 22); - this.ShowMainFormToolStripButton.Text = "Show"; - this.ShowMainFormToolStripButton.Click += new System.EventHandler(this.ShowMainFormToolStripButton_Click); - // - // ExitToolStripButton - // - this.ExitToolStripButton.Name = "ExitToolStripButton"; - this.ExitToolStripButton.Size = new System.Drawing.Size(107, 22); - this.ExitToolStripButton.Text = "Exit"; - this.ExitToolStripButton.Click += new System.EventHandler(this.ExitToolStripButton_Click); - // - // SettingsButton - // - this.SettingsButton.Location = new System.Drawing.Point(12, 219); - this.SettingsButton.Name = "SettingsButton"; - this.SettingsButton.Size = new System.Drawing.Size(72, 27); - this.SettingsButton.TabIndex = 4; - this.SettingsButton.Text = "Settings"; - this.SettingsButton.UseVisualStyleBackColor = true; - this.SettingsButton.Click += new System.EventHandler(this.SettingsButton_Click); - // - // ProfileGroupBox - // - this.ProfileGroupBox.Controls.Add(this.ProfileTable); - this.ProfileGroupBox.Location = new System.Drawing.Point(12, 147); - this.ProfileGroupBox.Name = "ProfileGroupBox"; - this.ProfileGroupBox.Size = new System.Drawing.Size(584, 65); - this.ProfileGroupBox.TabIndex = 13; - this.ProfileGroupBox.TabStop = false; - this.ProfileGroupBox.Text = "Profiles"; - // - // ProfileTable - // - this.ProfileTable.AutoSize = true; - this.ProfileTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.ProfileTable.ColumnCount = 2; - this.ProfileTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.ProfileTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.ProfileTable.Dock = System.Windows.Forms.DockStyle.Fill; - this.ProfileTable.Location = new System.Drawing.Point(3, 19); - this.ProfileTable.Name = "ProfileTable"; - this.ProfileTable.RowCount = 1; - this.ProfileTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.ProfileTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.ProfileTable.Size = new System.Drawing.Size(578, 43); - this.ProfileTable.TabIndex = 0; - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(608, 276); - this.Controls.Add(this.ProfileGroupBox); - this.Controls.Add(this.SettingsButton); - this.Controls.Add(this.ControlButton); - this.Controls.Add(this.StatusStrip); - this.Controls.Add(this.ConfigurationGroupBox); - this.Controls.Add(this.MenuStrip); - this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.MaximizeBox = false; - this.Name = "MainForm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Netch"; - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); - this.Load += new System.EventHandler(this.MainForm_Load); - this.MenuStrip.ResumeLayout(false); - this.MenuStrip.PerformLayout(); - this.ConfigurationGroupBox.ResumeLayout(false); - this.ConfigurationGroupBox.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.EditPictureBox)).EndInit(); - this.StatusStrip.ResumeLayout(false); - this.StatusStrip.PerformLayout(); - this.NotifyMenu.ResumeLayout(false); - this.ProfileGroupBox.ResumeLayout(false); - this.ProfileGroupBox.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.NotifyMenu.Name = "NotifyMenu"; + this.NotifyMenu.ShowItemToolTips = false; + this.NotifyMenu.Size = new System.Drawing.Size(108, 48); + // + // ShowMainFormToolStripButton + // + this.ShowMainFormToolStripButton.Name = "ShowMainFormToolStripButton"; + this.ShowMainFormToolStripButton.Size = new System.Drawing.Size(107, 22); + this.ShowMainFormToolStripButton.Text = "Show"; + this.ShowMainFormToolStripButton.Click += new System.EventHandler(this.ShowMainFormToolStripButton_Click); + // + // ExitToolStripButton + // + this.ExitToolStripButton.Name = "ExitToolStripButton"; + this.ExitToolStripButton.Size = new System.Drawing.Size(107, 22); + this.ExitToolStripButton.Text = "Exit"; + this.ExitToolStripButton.Click += new System.EventHandler(this.ExitToolStripButton_Click); + // + // SettingsButton + // + this.SettingsButton.Location = new System.Drawing.Point(12, 219); + this.SettingsButton.Name = "SettingsButton"; + this.SettingsButton.Size = new System.Drawing.Size(72, 27); + this.SettingsButton.TabIndex = 4; + this.SettingsButton.Text = "Settings"; + this.SettingsButton.UseVisualStyleBackColor = true; + this.SettingsButton.Click += new System.EventHandler(this.SettingsButton_Click); + // + // ProfileGroupBox + // + this.ProfileGroupBox.Controls.Add(this.ProfileTable); + this.ProfileGroupBox.Location = new System.Drawing.Point(12, 147); + this.ProfileGroupBox.Name = "ProfileGroupBox"; + this.ProfileGroupBox.Size = new System.Drawing.Size(584, 65); + this.ProfileGroupBox.TabIndex = 13; + this.ProfileGroupBox.TabStop = false; + this.ProfileGroupBox.Text = "Profiles"; + // + // ProfileTable + // + this.ProfileTable.AutoSize = true; + this.ProfileTable.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.ProfileTable.ColumnCount = 2; + this.ProfileTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.ProfileTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.ProfileTable.Dock = System.Windows.Forms.DockStyle.Fill; + this.ProfileTable.Location = new System.Drawing.Point(3, 19); + this.ProfileTable.Name = "ProfileTable"; + this.ProfileTable.RowCount = 1; + this.ProfileTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.ProfileTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.ProfileTable.Size = new System.Drawing.Size(578, 43); + this.ProfileTable.TabIndex = 0; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.ClientSize = new System.Drawing.Size(608, 276); + this.Controls.Add(this.ProfileGroupBox); + this.Controls.Add(this.SettingsButton); + this.Controls.Add(this.ControlButton); + this.Controls.Add(this.StatusStrip); + this.Controls.Add(this.ConfigurationGroupBox); + this.Controls.Add(this.MenuStrip); + this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.MaximizeBox = false; + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Netch"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); + this.MenuStrip.ResumeLayout(false); + this.MenuStrip.PerformLayout(); + this.ConfigurationGroupBox.ResumeLayout(false); + this.ConfigurationGroupBox.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.SpeedPictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.DeletePictureBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.EditPictureBox)).EndInit(); + this.StatusStrip.ResumeLayout(false); + this.StatusStrip.PerformLayout(); + this.NotifyMenu.ResumeLayout(false); + this.ProfileGroupBox.ResumeLayout(false); + this.ProfileGroupBox.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -563,5 +572,6 @@ namespace Netch.Forms private System.Windows.Forms.TextBox ProfileNameText; private System.Windows.Forms.GroupBox ProfileGroupBox; private System.Windows.Forms.TableLayoutPanel ProfileTable; + private System.Windows.Forms.ToolStripMenuItem ManageProcessModeToolStripMenuItem; } } \ No newline at end of file diff --git a/Netch/Forms/MainForm.cs b/Netch/Forms/MainForm.cs index 44ab7287..21000c16 100644 --- a/Netch/Forms/MainForm.cs +++ b/Netch/Forms/MainForm.cs @@ -1,4 +1,5 @@ -using System; +using Netch.Controllers; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Drawing; @@ -8,7 +9,6 @@ using System.ServiceProcess; using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; -using Netch.Controllers; namespace Netch.Forms { @@ -297,6 +297,7 @@ namespace Netch.Forms AddVMessServerToolStripMenuItem.Text = Utils.i18N.Translate(AddVMessServerToolStripMenuItem.Text); ModeToolStripMenuItem.Text = Utils.i18N.Translate(ModeToolStripMenuItem.Text); CreateProcessModeToolStripMenuItem.Text = Utils.i18N.Translate(CreateProcessModeToolStripMenuItem.Text); + ManageProcessModeToolStripMenuItem.Text = Utils.i18N.Translate(ManageProcessModeToolStripMenuItem.Text); SubscribeToolStripMenuItem.Text = Utils.i18N.Translate(SubscribeToolStripMenuItem.Text); ManageSubscribeLinksToolStripMenuItem.Text = Utils.i18N.Translate(ManageSubscribeLinksToolStripMenuItem.Text); UpdateServersFromSubscribeLinksToolStripMenuItem.Text = Utils.i18N.Translate(UpdateServersFromSubscribeLinksToolStripMenuItem.Text); @@ -437,6 +438,11 @@ namespace Netch.Forms Hide(); } + private void ManageProcessModeToolStripMenuItem_Click(object sender, EventArgs e) + { + Utils.Utils.OpenDir(@"mode"); + } + private void ManageSubscribeLinksToolStripMenuItem_Click(object sender, EventArgs e) { new SubscribeForm().Show(); @@ -945,7 +951,6 @@ namespace Netch.Forms Refresh(); } - private void ProfileButton_Click(object sender, EventArgs e) { var index = ProfileButtons.IndexOf((Button)sender); diff --git a/Netch/Resources/zh-CN b/Netch/Resources/zh-CN index 34e2dcbd..502ebf2a 100644 --- a/Netch/Resources/zh-CN +++ b/Netch/Resources/zh-CN @@ -29,6 +29,7 @@ "New version available": "发现新版本", "Mode": "模式", "Create Process Mode": "创建进程模式", + "Manage Process Mode": "管理进程模式", "Address": "地址", "Username": "用户名", diff --git a/Netch/Utils/Utils.cs b/Netch/Utils/Utils.cs new file mode 100644 index 00000000..f4bb0d65 --- /dev/null +++ b/Netch/Utils/Utils.cs @@ -0,0 +1,44 @@ +using System.Diagnostics; +using System.IO; + +namespace Netch.Utils +{ + public static class Utils + { + public static bool OpenUrl(string path) + { + try + { + new Process + { + StartInfo = new ProcessStartInfo(path) + { + UseShellExecute = true + } + }.Start(); + return true; + } + catch + { + return false; + } + } + + public static bool OpenDir(string dir) + { + if (Directory.Exists(dir)) + { + try + { + return OpenUrl(dir); + } + catch + { + // ignored + } + } + + return false; + } + } +}