deadmoon 2 年之前
父節點
當前提交
f55a773833

+ 0 - 53
Optimizer/Controls/MoonTip.cs

@@ -1,53 +0,0 @@
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms;
-
-namespace Optimizer
-{
-    class MoonTip : ToolTip
-    {
-        TextFormatFlags toolTipFlags = TextFormatFlags.VerticalCenter | TextFormatFlags.LeftAndRightPadding | TextFormatFlags.HorizontalCenter | TextFormatFlags.NoClipping;
-
-        Font font = new Font("Segoe UI Semibold", 10f, FontStyle.Regular);
-
-        public MoonTip()
-        {
-            this.OwnerDraw = true;
-            this.IsBalloon = false;
-            this.Popup += new PopupEventHandler(this.OnPopup);
-            this.Draw += new DrawToolTipEventHandler(this.OnDraw);
-        }
-
-        private void OnPopup(object sender, PopupEventArgs e) // use this event to set the size of the tool tip
-        {
-            string toolTipText = (sender as ToolTip).GetToolTip(e.AssociatedControl);
-            using (var g = e.AssociatedControl.CreateGraphics())
-            {
-                var textSize = Size.Add(TextRenderer.MeasureText(
-                    g, toolTipText, font, Size.Empty, toolTipFlags), new Size(10, 10));
-
-                e.ToolTipSize = textSize;
-            }
-            // e.ToolTipSize = new Size(400, 400);
-        }
-
-        private void OnDraw(object sender, DrawToolTipEventArgs e) // use this event to customise the tool tip
-        {
-            Graphics g = e.Graphics;
-
-            LinearGradientBrush b = new LinearGradientBrush(e.Bounds,
-                Color.FromArgb(25, 25, 25), Color.FromArgb(25, 25, 25), 45f);
-
-            g.FillRectangle(b, e.Bounds);
-
-            g.DrawRectangle(new Pen(Color.FromArgb(55, 55, 55), 1), new Rectangle(e.Bounds.X, e.Bounds.Y,
-                e.Bounds.Width - 1, e.Bounds.Height - 1));
-
-
-            g.DrawString(e.ToolTipText, font, Brushes.White,
-                new PointF(e.Bounds.X + 6, e.Bounds.Y + 6)); // top layer
-
-            b.Dispose();
-        }
-    }
-}

+ 4 - 0
Optimizer/Controls/ToggleCard.Designer.cs

@@ -43,6 +43,10 @@ namespace Optimizer
             this.Label.Size = new System.Drawing.Size(45, 19);
             this.Label.TabIndex = 1;
             this.Label.Text = "label1";
+            this.Label.Click += new System.EventHandler(this.Label_Click);
+            this.Label.MouseEnter += new System.EventHandler(this.Label_MouseEnter);
+            this.Label.MouseLeave += new System.EventHandler(this.Label_MouseLeave);
+            this.Label.MouseHover += new System.EventHandler(this.Label_MouseHover);
             // 
             // Panel
             // 

+ 31 - 0
Optimizer/Controls/ToggleCard.cs

@@ -7,10 +7,16 @@ namespace Optimizer
     {
         public event EventHandler ToggleClicked;
 
+        SubForm _subForm;
+
         public ToggleCard()
         {
             InitializeComponent();
 
+            this.DoubleBuffered = true;
+
+            _subForm = new SubForm();
+
             this.IsAccessible = true;
             Label.IsAccessible = true;
             Toggle.IsAccessible = true;
@@ -50,5 +56,30 @@ namespace Optimizer
         {
             if (ToggleClicked != null) ToggleClicked(sender, e);
         }
+
+        private void Label_MouseLeave(object sender, EventArgs e)
+        {
+            if (!Options.CurrentOptions.ShowHelp) return;
+            Label.Font = new System.Drawing.Font(Label.Font, System.Drawing.FontStyle.Regular);
+        }
+
+        private void Label_MouseEnter(object sender, EventArgs e)
+        {
+            if (!Options.CurrentOptions.ShowHelp) return;
+            Label.Font = new System.Drawing.Font(Label.Font, System.Drawing.FontStyle.Underline);
+        }
+
+        private void Label_Click(object sender, EventArgs e)
+        {
+            if (Label.Tag == null || !Options.CurrentOptions.ShowHelp) return;
+            _subForm.SetTip(Label.Tag.ToString());
+            _subForm.ShowDialog(this);
+        }
+
+        private void Label_MouseHover(object sender, EventArgs e)
+        {
+            if (!Options.CurrentOptions.ShowHelp) return;
+            Label.Font = new System.Drawing.Font(Label.Font, System.Drawing.FontStyle.Underline);
+        }
     }
 }

+ 1 - 1
Optimizer/Forms/FirstRunForm.Designer.cs

@@ -138,7 +138,7 @@ namespace Optimizer
             this.btnStart.Name = "btnStart";
             this.btnStart.Size = new System.Drawing.Size(289, 31);
             this.btnStart.TabIndex = 86;
-            this.btnStart.Tag = "";
+            this.btnStart.Tag = "themeable";
             this.btnStart.Text = "✓";
             this.btnStart.UseVisualStyleBackColor = false;
             this.btnStart.Click += new System.EventHandler(this.btnStart_Click);

+ 1 - 0
Optimizer/Forms/FirstRunForm.cs

@@ -8,6 +8,7 @@ namespace Optimizer
         public FirstRunForm()
         {
             InitializeComponent();
+            this.DoubleBuffered = true;
             Options.ApplyTheme(this);
         }
 

文件差異過大導致無法顯示
+ 4237 - 4304
Optimizer/Forms/MainForm.Designer.cs


+ 64 - 69
Optimizer/Forms/MainForm.cs

@@ -514,67 +514,65 @@ namespace Optimizer
             Options.CurrentOptions.TaskbarToLeft = leftTaskbarSw.ToggleChecked;
         }
 
-        private void SetHelpBoxTranslation()
-        {
-            helpBox.SetToolTip(performanceSw.Label, Options.TranslationList["performanceTip"].ToString());
-            helpBox.SetToolTip(networkSw.Label, Options.TranslationList["networkTip"].ToString());
-            helpBox.SetToolTip(defenderSw.Label, Options.TranslationList["defenderTip"].ToString());
-            helpBox.SetToolTip(smartScreenSw.Label, Options.TranslationList["smartScreenTip"].ToString());
-            helpBox.SetToolTip(systemRestoreSw.Label, Options.TranslationList["systemRestoreTip"].ToString());
-            helpBox.SetToolTip(reportingSw.Label, Options.TranslationList["reportingTip"].ToString());
-            helpBox.SetToolTip(telemetryTasksSw.Label, Options.TranslationList["telemetryTasksTip"].ToString());
-            helpBox.SetToolTip(officeTelemetrySw.Label, Options.TranslationList["officeTelemetryTip"].ToString());
-            helpBox.SetToolTip(printSw.Label, Options.TranslationList["printTip"].ToString());
-            helpBox.SetToolTip(faxSw.Label, Options.TranslationList["faxTip"].ToString());
-            helpBox.SetToolTip(mediaSharingSw.Label, Options.TranslationList["mediaSharingTip"].ToString());
-            helpBox.SetToolTip(stickySw.Label, Options.TranslationList["stickyTip"].ToString());
-            helpBox.SetToolTip(homegroupSw.Label, Options.TranslationList["homegroupTip"].ToString());
-            helpBox.SetToolTip(superfetchSw.Label, Options.TranslationList["superfetchTip"].ToString());
-            helpBox.SetToolTip(compatSw.Label, Options.TranslationList["compatTip"].ToString());
-            helpBox.SetToolTip(disableOneDriveSw.Label, Options.TranslationList["disableOneDriveTip"].ToString());
-            helpBox.SetToolTip(oldMixerSw.Label, Options.TranslationList["oldMixerTip"].ToString());
-            helpBox.SetToolTip(oldExplorerSw.Label, Options.TranslationList["oldExplorerTip"].ToString());
-            helpBox.SetToolTip(adsSw.Label, Options.TranslationList["adsTip"].ToString());
-            helpBox.SetToolTip(uODSw.Label, Options.TranslationList["uODTip"].ToString());
-            helpBox.SetToolTip(peopleSw.Label, Options.TranslationList["peopleTip"].ToString());
-            helpBox.SetToolTip(longPathsSw.Label, Options.TranslationList["longPathsTip"].ToString());
-            helpBox.SetToolTip(inkSw.Label, Options.TranslationList["inkTip"].ToString());
-            helpBox.SetToolTip(spellSw.Label, Options.TranslationList["spellTip"].ToString());
-            helpBox.SetToolTip(xboxSw.Label, Options.TranslationList["xboxTip"].ToString());
-            helpBox.SetToolTip(autoUpdatesSw.Label, Options.TranslationList["autoUpdatesTip"].ToString());
-            helpBox.SetToolTip(driversSw.Label, Options.TranslationList["driversTip"].ToString());
-            helpBox.SetToolTip(telemetryServicesSw.Label, Options.TranslationList["telemetryServicesTip"].ToString());
-            helpBox.SetToolTip(privacySw.Label, Options.TranslationList["privacyTip"].ToString());
-            helpBox.SetToolTip(ccSw.Label, Options.TranslationList["ccTip"].ToString());
-            helpBox.SetToolTip(cortanaSw.Label, Options.TranslationList["cortanaTip"].ToString());
-            helpBox.SetToolTip(sensorSw.Label, Options.TranslationList["sensorTip"].ToString());
-            helpBox.SetToolTip(castSw.Label, Options.TranslationList["castTip"].ToString());
-            helpBox.SetToolTip(gameBarSw.Label, Options.TranslationList["gameBarTip"].ToString());
-            helpBox.SetToolTip(insiderSw.Label, Options.TranslationList["insiderTip"].ToString());
-            helpBox.SetToolTip(featuresSw.Label, Options.TranslationList["featuresTip"].ToString());
-            helpBox.SetToolTip(tpmSw.Label, Options.TranslationList["tpmTip"].ToString());
-            helpBox.SetToolTip(leftTaskbarSw.Label, Options.TranslationList["leftTaskbarTip"].ToString());
-            helpBox.SetToolTip(snapAssistSw.Label, Options.TranslationList["snapAssistTip"].ToString());
-            helpBox.SetToolTip(widgetsSw.Label, Options.TranslationList["widgetsTip"].ToString());
-            helpBox.SetToolTip(chatSw.Label, Options.TranslationList["chatTip"].ToString());
-            helpBox.SetToolTip(stickersSw.Label, Options.TranslationList["stickersTip"].ToString());
-            helpBox.SetToolTip(smallerTaskbarSw.Label, Options.TranslationList["smallerTaskbarTip"].ToString());
-            helpBox.SetToolTip(classicRibbonSw.Label, Options.TranslationList["classicRibbonTip"].ToString());
-            helpBox.SetToolTip(classicContextSw.Label, Options.TranslationList["classicContextTip"].ToString());
-            helpBox.SetToolTip(picUpdate, Options.TranslationList["linkUpdate"].ToString() + "!");
-            helpBox.SetToolTip(picLab, Options.TranslationList["lblLab"].ToString());
-            helpBox.SetToolTip(picRestartNeeded, Options.TranslationList["restartAndApply"].ToString());
-            helpBox.SetToolTip(ffTelemetrySw.Label, Options.TranslationList["ffTelemetryTip"].ToString());
-            helpBox.SetToolTip(vsSw.Label, Options.TranslationList["vsTip"].ToString());
-            helpBox.SetToolTip(chromeTelemetrySw.Label, Options.TranslationList["chromeTelemetryTip"].ToString());
-            helpBox.SetToolTip(gameModeSw.Label, Options.TranslationList["gameModeTip"].ToString());
-            helpBox.SetToolTip(compactModeSw.Label, Options.TranslationList["compactModeTip"].ToString());
-            helpBox.SetToolTip(hibernateSw.Label, Options.TranslationList["hibernateTip"].ToString());
-            helpBox.SetToolTip(smb1Sw.Label, Options.TranslationList["smbTip"].ToString().Replace("{v}", "v1"));
-            helpBox.SetToolTip(smb2Sw.Label, Options.TranslationList["smbTip"].ToString().Replace("{v}", "v2"));
-            helpBox.SetToolTip(ntfsStampSw.Label, Options.TranslationList["ntfsStampTip"].ToString());
-
-            //helpBox.ToolTipTitle = Options.TranslationList["tipWhatsThis"].ToString();
+        private void TranslateTips()
+        {
+            performanceSw.Label.Tag = Options.TranslationList["performanceTip"].ToString();
+            networkSw.Label.Tag = Options.TranslationList["networkTip"].ToString();
+            defenderSw.Label.Tag = Options.TranslationList["defenderTip"].ToString();
+            smartScreenSw.Label.Tag = Options.TranslationList["smartScreenTip"].ToString();
+            systemRestoreSw.Label.Tag = Options.TranslationList["systemRestoreTip"].ToString();
+            reportingSw.Label.Tag = Options.TranslationList["reportingTip"].ToString();
+            telemetryTasksSw.Label.Tag = Options.TranslationList["telemetryTasksTip"].ToString();
+            officeTelemetrySw.Label.Tag = Options.TranslationList["officeTelemetryTip"].ToString();
+            printSw.Label.Tag = Options.TranslationList["printTip"].ToString();
+            faxSw.Label.Tag = Options.TranslationList["faxTip"].ToString();
+            mediaSharingSw.Label.Tag = Options.TranslationList["mediaSharingTip"].ToString();
+            stickySw.Label.Tag = Options.TranslationList["stickyTip"].ToString();
+            homegroupSw.Label.Tag = Options.TranslationList["homegroupTip"].ToString();
+            superfetchSw.Label.Tag = Options.TranslationList["superfetchTip"].ToString();
+            compatSw.Label.Tag = Options.TranslationList["compatTip"].ToString();
+            disableOneDriveSw.Label.Tag = Options.TranslationList["disableOneDriveTip"].ToString();
+            oldMixerSw.Label.Tag = Options.TranslationList["oldMixerTip"].ToString();
+            oldExplorerSw.Label.Tag = Options.TranslationList["oldExplorerTip"].ToString();
+            adsSw.Label.Tag = Options.TranslationList["adsTip"].ToString();
+            uODSw.Label.Tag = Options.TranslationList["uODTip"].ToString();
+            peopleSw.Label.Tag = Options.TranslationList["peopleTip"].ToString();
+            longPathsSw.Label.Tag = Options.TranslationList["longPathsTip"].ToString();
+            inkSw.Label.Tag = Options.TranslationList["inkTip"].ToString();
+            spellSw.Label.Tag = Options.TranslationList["spellTip"].ToString();
+            xboxSw.Label.Tag = Options.TranslationList["xboxTip"].ToString();
+            autoUpdatesSw.Label.Tag = Options.TranslationList["autoUpdatesTip"].ToString();
+            driversSw.Label.Tag = Options.TranslationList["driversTip"].ToString();
+            telemetryServicesSw.Label.Tag = Options.TranslationList["telemetryServicesTip"].ToString();
+            privacySw.Label.Tag = Options.TranslationList["privacyTip"].ToString();
+            ccSw.Label.Tag = Options.TranslationList["ccTip"].ToString();
+            cortanaSw.Label.Tag = Options.TranslationList["cortanaTip"].ToString();
+            sensorSw.Label.Tag = Options.TranslationList["sensorTip"].ToString();
+            castSw.Label.Tag = Options.TranslationList["castTip"].ToString();
+            gameBarSw.Label.Tag = Options.TranslationList["gameBarTip"].ToString();
+            insiderSw.Label.Tag = Options.TranslationList["insiderTip"].ToString();
+            featuresSw.Label.Tag = Options.TranslationList["featuresTip"].ToString();
+            tpmSw.Label.Tag = Options.TranslationList["tpmTip"].ToString();
+            leftTaskbarSw.Label.Tag = Options.TranslationList["leftTaskbarTip"].ToString();
+            snapAssistSw.Label.Tag = Options.TranslationList["snapAssistTip"].ToString();
+            widgetsSw.Label.Tag = Options.TranslationList["widgetsTip"].ToString();
+            chatSw.Label.Tag = Options.TranslationList["chatTip"].ToString();
+            stickersSw.Label.Tag = Options.TranslationList["stickersTip"].ToString();
+            smallerTaskbarSw.Label.Tag = Options.TranslationList["smallerTaskbarTip"].ToString();
+            classicRibbonSw.Label.Tag = Options.TranslationList["classicRibbonTip"].ToString();
+            classicContextSw.Label.Tag = Options.TranslationList["classicContextTip"].ToString();
+            picUpdate.Tag = Options.TranslationList["linkUpdate"].ToString() + "!";
+            picLab.Tag = Options.TranslationList["lblLab"].ToString();
+            picRestartNeeded.Tag = Options.TranslationList["restartAndApply"].ToString();
+            ffTelemetrySw.Label.Tag = Options.TranslationList["ffTelemetryTip"].ToString();
+            vsSw.Label.Tag = Options.TranslationList["vsTip"].ToString();
+            chromeTelemetrySw.Label.Tag = Options.TranslationList["chromeTelemetryTip"].ToString();
+            gameModeSw.Label.Tag = Options.TranslationList["gameModeTip"].ToString();
+            compactModeSw.Label.Tag = Options.TranslationList["compactModeTip"].ToString();
+            hibernateSw.Label.Tag = Options.TranslationList["hibernateTip"].ToString();
+            smb1Sw.Label.Tag = Options.TranslationList["smbTip"].ToString().Replace("{v}", "v1");
+            smb2Sw.Label.Tag = Options.TranslationList["smbTip"].ToString().Replace("{v}", "v2");
+            ntfsStampSw.Label.Tag = Options.TranslationList["ntfsStampTip"].ToString();
         }
 
         private void ToggleSwitch40_Click(object sender, EventArgs e)
@@ -743,7 +741,6 @@ namespace Optimizer
             trayUpSpeed.Visible = Options.CurrentOptions.EnableTray;
 
             // help tips
-            helpBox.Active = Options.CurrentOptions.ShowHelp;
             helpTipsToggle.ToggleChecked = Options.CurrentOptions.ShowHelp;
 
             // fix SSL/TLS error when contacting internet
@@ -1863,7 +1860,7 @@ namespace Optimizer
                 translationList["txtBitness"] = translationList["txtBitness"].Replace("{BITS}", translationList["c32"]);
             }
 
-            SetHelpBoxTranslation();
+            TranslateTips();
             TranslateIndicium();
 
             if (!skipFull)
@@ -2193,7 +2190,7 @@ namespace Optimizer
 
         private void Main_Load(object sender, EventArgs e)
         {
-
+            
         }
 
         private void GetDesktopItems()
@@ -3846,7 +3843,7 @@ namespace Optimizer
             }
         }
 
-        private void button9_Click(object sender, EventArgs e)
+        private void copyB_Click(object sender, EventArgs e)
         {
             try
             {
@@ -3855,7 +3852,7 @@ namespace Optimizer
             catch { }
         }
 
-        private void button7_Click(object sender, EventArgs e)
+        private void copyIPB_Click(object sender, EventArgs e)
         {
             try
             {
@@ -3958,7 +3955,7 @@ namespace Optimizer
             Utilities.RestartExplorer();
         }
 
-        private void button10_Click(object sender, EventArgs e)
+        private void flushCacheB_Click(object sender, EventArgs e)
         {
             if (MessageBox.Show(_flushDNSMessage, "Optimizer", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
@@ -4089,8 +4086,6 @@ namespace Optimizer
         {
             Options.CurrentOptions.ShowHelp = helpTipsToggle.ToggleChecked;
             Options.SaveSettings();
-
-            helpBox.Active = helpTipsToggle.ToggleChecked;
         }
 
         private void picUpdate_Click(object sender, EventArgs e)

+ 1 - 4
Optimizer/Forms/MainForm.resx

@@ -751,7 +751,7 @@ any application only by typing your desired keyword.</value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC0
-        GgAAAk1TRnQBSQFMAgEBCQEAAbgBCQG4AQkBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
+        GgAAAk1TRnQBSQFMAgEBCQEAAXABCwFwAQsBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
         AwABYAMAAQEBAAEgBgABwP8A/wD/AP8A/wD/AP8A/wAeAANHAYB0//8AiQADRwGAdP//AIkAAyoBQANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGA/wD/AP8A
@@ -1661,9 +1661,6 @@ any application only by typing your desired keyword.</value>
         rEHh/6xBwP+sQYB/rEEAP6xBAB+sQQQPrEGOB6xB3wOsQf+BrEH/wKxB/+CsQf/wrEH/+axB//+sQQ==
 </value>
   </data>
-  <metadata name="helpBox.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>428, 51</value>
-  </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>94</value>
   </metadata>

+ 120 - 0
Optimizer/Forms/SubForm.Designer.cs

@@ -0,0 +1,120 @@
+namespace Optimizer
+{
+    partial class SubForm
+    {
+        /// <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()
+        {
+            this.txtInfo = new System.Windows.Forms.RichTextBox();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.btnStart = new System.Windows.Forms.Button();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // txtInfo
+            // 
+            this.txtInfo.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
+            this.txtInfo.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.txtInfo.Cursor = System.Windows.Forms.Cursors.Arrow;
+            this.txtInfo.DetectUrls = false;
+            this.txtInfo.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.txtInfo.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold);
+            this.txtInfo.ForeColor = System.Drawing.Color.White;
+            this.txtInfo.Location = new System.Drawing.Point(0, 0);
+            this.txtInfo.Name = "txtInfo";
+            this.txtInfo.ReadOnly = true;
+            this.txtInfo.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
+            this.txtInfo.ShortcutsEnabled = false;
+            this.txtInfo.Size = new System.Drawing.Size(391, 203);
+            this.txtInfo.TabIndex = 0;
+            this.txtInfo.Text = "";
+            // 
+            // panel1
+            // 
+            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel1.Controls.Add(this.btnStart);
+            this.panel1.Controls.Add(this.txtInfo);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(393, 205);
+            this.panel1.TabIndex = 1;
+            // 
+            // btnStart
+            // 
+            this.btnStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnStart.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(153)))), ((int)(((byte)(102)))), ((int)(((byte)(204)))));
+            this.btnStart.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.btnStart.FlatAppearance.BorderColor = System.Drawing.Color.DarkOrchid;
+            this.btnStart.FlatAppearance.BorderSize = 0;
+            this.btnStart.FlatAppearance.MouseDownBackColor = System.Drawing.Color.DarkOrchid;
+            this.btnStart.FlatAppearance.MouseOverBackColor = System.Drawing.Color.DarkOrchid;
+            this.btnStart.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.btnStart.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.btnStart.ForeColor = System.Drawing.Color.White;
+            this.btnStart.Location = new System.Drawing.Point(314, 162);
+            this.btnStart.Margin = new System.Windows.Forms.Padding(2);
+            this.btnStart.Name = "btnStart";
+            this.btnStart.Size = new System.Drawing.Size(67, 31);
+            this.btnStart.TabIndex = 0;
+            this.btnStart.Tag = "themeable";
+            this.btnStart.Text = "✓";
+            this.btnStart.UseVisualStyleBackColor = false;
+            this.btnStart.Click += new System.EventHandler(this.btnStart_Click);
+            // 
+            // SubForm
+            // 
+            this.AcceptButton = this.btnStart;
+            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(30)))), ((int)(((byte)(30)))));
+            this.CancelButton = this.btnStart;
+            this.ClientSize = new System.Drawing.Size(393, 205);
+            this.ControlBox = false;
+            this.Controls.Add(this.panel1);
+            this.DoubleBuffered = true;
+            this.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.ForeColor = System.Drawing.Color.White;
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.MaximizeBox = false;
+            this.MinimizeBox = false;
+            this.Name = "SubForm";
+            this.ShowIcon = false;
+            this.ShowInTaskbar = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Load += new System.EventHandler(this.SubForm_Load);
+            this.panel1.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.RichTextBox txtInfo;
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.Button btnStart;
+    }
+}

+ 44 - 0
Optimizer/Forms/SubForm.cs

@@ -0,0 +1,44 @@
+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 Optimizer
+{
+    public partial class SubForm : Form
+    {
+        public SubForm()
+        {
+            InitializeComponent();
+
+            CheckForIllegalCrossThreadCalls = false;
+            this.DoubleBuffered = true;
+            Options.ApplyTheme(this);
+
+            btnStart.Focus();
+            btnStart.Select();
+        }
+
+        internal void SetTip(string tip)
+        {
+            txtInfo.Text = tip;
+            btnStart.Focus();
+            btnStart.Select();
+        }
+
+        private void btnStart_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
+
+        private void SubForm_Load(object sender, EventArgs e)
+        {
+            Options.ApplyTheme(this);
+        }
+    }
+}

+ 120 - 0
Optimizer/Forms/SubForm.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 9 - 3
Optimizer/Optimizer.csproj

@@ -96,9 +96,6 @@
       <SubType>Component</SubType>
     </Compile>
     <Compile Include="Controls\ColorOverrider.cs" />
-    <Compile Include="Controls\MoonTip.cs">
-      <SubType>Component</SubType>
-    </Compile>
     <Compile Include="Controls\MoonToggle.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -164,6 +161,12 @@
     <Compile Include="Forms\HelperForm.designer.cs">
       <DependentUpon>HelperForm.cs</DependentUpon>
     </Compile>
+    <Compile Include="Forms\SubForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Forms\SubForm.Designer.cs">
+      <DependentUpon>SubForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="Forms\UpdateForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -260,6 +263,9 @@
     <EmbeddedResource Include="Forms\MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Forms\SubForm.resx">
+      <DependentUpon>SubForm.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Forms\UpdateForm.resx">
       <DependentUpon>UpdateForm.cs</DependentUpon>
     </EmbeddedResource>

+ 26 - 18
Optimizer/Options.cs

@@ -290,24 +290,32 @@ namespace Optimizer
         internal static void LoadTranslation()
         {
             // load proper translation list
-            if (CurrentOptions.LanguageCode == LanguageCode.EN) TranslationList = JObject.Parse(Properties.Resources.EN);
-            if (CurrentOptions.LanguageCode == LanguageCode.RU) TranslationList = JObject.Parse(Properties.Resources.RU);
-            if (CurrentOptions.LanguageCode == LanguageCode.EL) TranslationList = JObject.Parse(Properties.Resources.EL);
-            if (CurrentOptions.LanguageCode == LanguageCode.TR) TranslationList = JObject.Parse(Properties.Resources.TR);
-            if (CurrentOptions.LanguageCode == LanguageCode.DE) TranslationList = JObject.Parse(Properties.Resources.DE);
-            if (CurrentOptions.LanguageCode == LanguageCode.ES) TranslationList = JObject.Parse(Properties.Resources.ES);
-            if (CurrentOptions.LanguageCode == LanguageCode.PT) TranslationList = JObject.Parse(Properties.Resources.PT);
-            if (CurrentOptions.LanguageCode == LanguageCode.FR) TranslationList = JObject.Parse(Properties.Resources.FR);
-            if (CurrentOptions.LanguageCode == LanguageCode.IT) TranslationList = JObject.Parse(Properties.Resources.IT);
-            if (CurrentOptions.LanguageCode == LanguageCode.CN) TranslationList = JObject.Parse(Properties.Resources.CN);
-            if (CurrentOptions.LanguageCode == LanguageCode.CZ) TranslationList = JObject.Parse(Properties.Resources.CZ);
-            if (CurrentOptions.LanguageCode == LanguageCode.TW) TranslationList = JObject.Parse(Properties.Resources.TW);
-            if (CurrentOptions.LanguageCode == LanguageCode.KO) TranslationList = JObject.Parse(Properties.Resources.KO);
-            if (CurrentOptions.LanguageCode == LanguageCode.PL) TranslationList = JObject.Parse(Properties.Resources.PL);
-            if (CurrentOptions.LanguageCode == LanguageCode.AR) TranslationList = JObject.Parse(Properties.Resources.AR);
-            if (CurrentOptions.LanguageCode == LanguageCode.KU) TranslationList = JObject.Parse(Properties.Resources.KU);
-            if (CurrentOptions.LanguageCode == LanguageCode.HU) TranslationList = JObject.Parse(Properties.Resources.HU);
-            if (CurrentOptions.LanguageCode == LanguageCode.RO) TranslationList = JObject.Parse(Properties.Resources.RO);
+            try
+            {
+                if (CurrentOptions.LanguageCode == LanguageCode.EN) TranslationList = JObject.Parse(Properties.Resources.EN);
+                if (CurrentOptions.LanguageCode == LanguageCode.RU) TranslationList = JObject.Parse(Properties.Resources.RU);
+                if (CurrentOptions.LanguageCode == LanguageCode.EL) TranslationList = JObject.Parse(Properties.Resources.EL);
+                if (CurrentOptions.LanguageCode == LanguageCode.TR) TranslationList = JObject.Parse(Properties.Resources.TR);
+                if (CurrentOptions.LanguageCode == LanguageCode.DE) TranslationList = JObject.Parse(Properties.Resources.DE);
+                if (CurrentOptions.LanguageCode == LanguageCode.ES) TranslationList = JObject.Parse(Properties.Resources.ES);
+                if (CurrentOptions.LanguageCode == LanguageCode.PT) TranslationList = JObject.Parse(Properties.Resources.PT);
+                if (CurrentOptions.LanguageCode == LanguageCode.FR) TranslationList = JObject.Parse(Properties.Resources.FR);
+                if (CurrentOptions.LanguageCode == LanguageCode.IT) TranslationList = JObject.Parse(Properties.Resources.IT);
+                if (CurrentOptions.LanguageCode == LanguageCode.CN) TranslationList = JObject.Parse(Properties.Resources.CN);
+                if (CurrentOptions.LanguageCode == LanguageCode.CZ) TranslationList = JObject.Parse(Properties.Resources.CZ);
+                if (CurrentOptions.LanguageCode == LanguageCode.TW) TranslationList = JObject.Parse(Properties.Resources.TW);
+                if (CurrentOptions.LanguageCode == LanguageCode.KO) TranslationList = JObject.Parse(Properties.Resources.KO);
+                if (CurrentOptions.LanguageCode == LanguageCode.PL) TranslationList = JObject.Parse(Properties.Resources.PL);
+                if (CurrentOptions.LanguageCode == LanguageCode.AR) TranslationList = JObject.Parse(Properties.Resources.AR);
+                if (CurrentOptions.LanguageCode == LanguageCode.KU) TranslationList = JObject.Parse(Properties.Resources.KU);
+                if (CurrentOptions.LanguageCode == LanguageCode.HU) TranslationList = JObject.Parse(Properties.Resources.HU);
+                if (CurrentOptions.LanguageCode == LanguageCode.RO) TranslationList = JObject.Parse(Properties.Resources.RO);
+            }
+            catch (Exception ex)
+            {
+                ErrorLogger.LogError("Options.LoadTranslation", ex.Message, ex.StackTrace);
+                TranslationList = JObject.Parse(Properties.Resources.EN);
+            }
         }
     }
 }

+ 27 - 27
Optimizer/PingerHelper.cs

@@ -137,32 +137,32 @@ namespace Optimizer
             Utilities.RunCommand("ipconfig /flushdns");
         }
 
-        internal static string PortScan(string IP, int port)
-        {
-            IPAddress ipAddress = IPAddress.Parse(IP);
-            IPEndPoint endPoint = new IPEndPoint(ipAddress, port);
-
-            try
-            {
-                Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-                IAsyncResult result = sock.BeginConnect(endPoint, null, null);
-                bool success = result.AsyncWaitHandle.WaitOne(100, true);
-                if (sock.Connected)
-                {
-                    sock.EndConnect(result);
-                    return $"{port} - [✓]";
-                }
-                else
-                {
-                    return $"{port} - [×]";
-                }
-
-                if (sock != null) sock.Close();
-            }
-            catch
-            {
-                return $"{port} - [×]";
-            }
-        }
+        //internal static string PortScan(string IP, int port)
+        //{
+        //    IPAddress ipAddress = IPAddress.Parse(IP);
+        //    IPEndPoint endPoint = new IPEndPoint(ipAddress, port);
+
+        //    try
+        //    {
+        //        Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+        //        IAsyncResult result = sock.BeginConnect(endPoint, null, null);
+        //        bool success = result.AsyncWaitHandle.WaitOne(100, true);
+        //        if (sock.Connected)
+        //        {
+        //            sock.EndConnect(result);
+        //            return $"{port} - [✓]";
+        //        }
+        //        else
+        //        {
+        //            return $"{port} - [×]";
+        //        }
+
+        //        if (sock != null) sock.Close();
+        //    }
+        //    catch
+        //    {
+        //        return $"{port} - [×]";
+        //    }
+        //}
     }
 }

+ 2 - 2
Optimizer/Resources/i18n/DE.json

@@ -396,8 +396,8 @@
 	"smbSw1": "Deaktiviere das SMBv1-Protokoll",
 	"smbSw2": "Deaktiviere das SMBv2-Protokoll",
 	"smbTip": "Das SMB{v}-Protokoll ist für die Dateifreigabe zwischen Windows-Computern verantwortlich.
-	Es wurde durch SMBv3 ersetzt, das sicherer ist.",
+Es wurde durch SMBv3 ersetzt, das sicherer ist.",
 	"ntfsStampSw": "Deaktiviere den NTFS-Zeitstempel",
 	"ntfsStampTip": "Gibt den Zeitpunkt des letzten Zugriffs auf die Datei an.
-	Durch Deaktivieren können die E/A-Vorgänge auf den Festplatten reduziert werden."
+Durch Deaktivieren können die E/A-Vorgänge auf den Festplatten reduziert werden."
 }

部分文件因文件數量過多而無法顯示