diff --git a/MsmhTools/CustomControls/CustomButton.cs b/MsmhTools/CustomControls/CustomButton.cs
deleted file mode 100644
index 76487cb..0000000
--- a/MsmhTools/CustomControls/CustomButton.cs
+++ /dev/null
@@ -1,468 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, April 19, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomButton : Button
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new FlatButtonAppearance? FlatAppearance { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new TextImageRelation? TextImageRelation { get; set; }
-
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public override Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- Invalidate();
- }
- }
- }
-
- private int mRoundedCorners = 0;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Rounded Corners")]
- public int RoundedCorners
- {
- get { return mRoundedCorners; }
- set
- {
- if (mRoundedCorners != value)
- {
- mRoundedCorners = value;
- Invalidate();
- }
- }
- }
-
- private bool ButtonMouseHover { get; set; }
- private bool ButtonMouseDown { get; set; }
- private bool ApplicationIdle = false;
- private bool once = true;
-
- public CustomButton() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- FlatStyle = FlatStyle.Flat;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomButton_HandleCreated;
- LocationChanged += CustomButton_LocationChanged;
- Move += CustomButton_Move;
- MouseDown += CustomButton_MouseDown;
- MouseUp += CustomButton_MouseUp;
- MouseEnter += CustomButton_MouseEnter;
- MouseLeave += CustomButton_MouseLeave;
- EnabledChanged += CustomButton_EnabledChanged;
- Paint += CustomButton_Paint;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Parent.BackColorChanged += Parent_BackColorChanged;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void Parent_BackColorChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomButton_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomButton_LocationChanged(object? sender, EventArgs e)
- {
- if (sender is Button button)
- {
- button.Invalidate();
- }
- }
-
- private void CustomButton_Move(object? sender, EventArgs e)
- {
- if (sender is Button button)
- {
- button.Invalidate();
- }
- }
-
- private void CustomButton_MouseDown(object? sender, MouseEventArgs e)
- {
- if (sender is Button button)
- {
- ButtonMouseDown = true;
- button.Invalidate();
- }
- }
-
- private void CustomButton_MouseUp(object? sender, MouseEventArgs e)
- {
- if (sender is Button button)
- {
- ButtonMouseDown = false;
- button.Invalidate();
- }
- }
-
- private void CustomButton_MouseEnter(object? sender, EventArgs e)
- {
- if (sender is Button button)
- {
- ButtonMouseHover = true;
- button.Invalidate();
- }
- }
-
- private void CustomButton_MouseLeave(object? sender, EventArgs e)
- {
- if (sender is Button button)
- {
- ButtonMouseHover = false;
- button.Invalidate();
- }
- }
-
- private void CustomButton_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomButton_Paint(object? sender, PaintEventArgs e)
- {
- if (ApplicationIdle == false)
- return;
-
- if (sender is Button button)
- {
- Color backColor = GetBackColor(button);
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
-
- // Paint Background
- if (Parent != null)
- {
- e.Graphics.Clear(Parent.BackColor);
- if (Parent.BackColor == Color.Transparent)
- if (Parent is TabPage tabPage)
- {
- if (tabPage.Parent is CustomTabControl customTabControl)
- e.Graphics.Clear(customTabControl.BackColor);
- else if (tabPage.Parent is TabControl tabControl)
- e.Graphics.Clear(tabControl.BackColor);
- }
- }
- else
- e.Graphics.Clear(backColor);
-
- Rectangle rect = new(0, 0, button.ClientSize.Width - 1, button.ClientSize.Height - 1);
-
- // Paint Button Background
- using SolidBrush sbBG = new(backColor);
- e.Graphics.FillRoundedRectangle(sbBG, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
-
- // Paint Hover Button Background (// MousePosition Or Cursor.Position) (Faster than rect.Contains(button.PointToClient(MousePosition)))
- if (button.PointToScreen(Point.Empty).X <= MousePosition.X
- && MousePosition.X <= (button.PointToScreen(Point.Empty).X + rect.Width)
- && button.PointToScreen(Point.Empty).Y <= MousePosition.Y
- && MousePosition.Y <= (button.PointToScreen(Point.Empty).Y + rect.Height))
- {
- if (ButtonMouseHover)
- {
- if (ButtonMouseDown)
- {
- Color mouseDownBackColor;
- if (backColor.DarkOrLight() == "Dark")
- mouseDownBackColor = backColor.ChangeBrightness(0.2f);
- else
- mouseDownBackColor = backColor.ChangeBrightness(-0.2f);
-
- using SolidBrush sbDBG = new(mouseDownBackColor);
- e.Graphics.FillRoundedRectangle(sbDBG, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- ButtonMouseDown = false; // Fix a minor bug.
- }
- else
- {
- Color mouseHoverBackColor;
- if (backColor.DarkOrLight() == "Dark")
- mouseHoverBackColor = BackColor.ChangeBrightness(0.1f);
- else
- mouseHoverBackColor = BackColor.ChangeBrightness(-0.1f);
-
- using SolidBrush sbHBG = new(mouseHoverBackColor);
- e.Graphics.FillRoundedRectangle(sbHBG, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- }
- }
- }
-
- if (button.Enabled && button.Focused)
- {
- rect.Inflate(-2, -2);
- using Pen pen = new(SelectionColor) { DashStyle = DashStyle.Dash };
- //if (RoundedCorners == 0)
- // e.Graphics.DrawRectangle(pen, rect);
- //else
- e.Graphics.DrawRoundedRectangle(pen, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- rect.Inflate(+2, +2);
- }
-
- // Paint Image
- if (Image != null)
- {
- Rectangle rectImage = new(0, 0, Image.Width, Image.Height);
- int pad = 2;
- int top = rect.Y + pad;
- int bottom = rect.Y + (rect.Height - rectImage.Height) - pad;
- int left = rect.X + pad;
- int right = rect.X + (rect.Width - rectImage.Width) - pad;
- int centerX = rect.X + ((rect.Width - rectImage.Width) / 2);
- int centerY = rect.Y + ((rect.Height - rectImage.Height) / 2);
- if (RightToLeft == RightToLeft.No)
- {
- if (ImageAlign == ContentAlignment.BottomCenter)
- rectImage.Location = new(centerX, bottom);
- else if (ImageAlign == ContentAlignment.BottomLeft)
- rectImage.Location = new(left, bottom);
- else if (ImageAlign == ContentAlignment.BottomRight)
- rectImage.Location = new(right, bottom);
- else if (ImageAlign == ContentAlignment.MiddleCenter)
- rectImage.Location = new(centerX, centerY);
- else if (ImageAlign == ContentAlignment.MiddleLeft)
- rectImage.Location = new(left, centerY);
- else if (ImageAlign == ContentAlignment.MiddleRight)
- rectImage.Location = new(right, centerY);
- else if (ImageAlign == ContentAlignment.TopCenter)
- rectImage.Location = new(centerX, top);
- else if (ImageAlign == ContentAlignment.TopLeft)
- rectImage.Location = new(left, top);
- else if (ImageAlign == ContentAlignment.TopRight)
- rectImage.Location = new(right, top);
- else
- rectImage.Location = new(centerX, centerY);
- }
- else
- {
- if (ImageAlign == ContentAlignment.BottomCenter)
- rectImage.Location = new(centerX, bottom);
- else if (ImageAlign == ContentAlignment.BottomLeft)
- rectImage.Location = new(right, bottom);
- else if (ImageAlign == ContentAlignment.BottomRight)
- rectImage.Location = new(left, bottom);
- else if (ImageAlign == ContentAlignment.MiddleCenter)
- rectImage.Location = new(centerX, centerY);
- else if (ImageAlign == ContentAlignment.MiddleLeft)
- rectImage.Location = new(right, centerY);
- else if (ImageAlign == ContentAlignment.MiddleRight)
- rectImage.Location = new(left, centerY);
- else if (ImageAlign == ContentAlignment.TopCenter)
- rectImage.Location = new(centerX, top);
- else if (ImageAlign == ContentAlignment.TopLeft)
- rectImage.Location = new(right, top);
- else if (ImageAlign == ContentAlignment.TopRight)
- rectImage.Location = new(left, top);
- else
- rectImage.Location = new(centerX, centerY);
- }
-
- e.Graphics.DrawImage(Image, rectImage);
- }
-
- // Paint Button Text
- TextFormatFlags flags;
-
- if (RightToLeft == RightToLeft.No)
- {
- if (TextAlign == ContentAlignment.BottomCenter)
- flags = TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.BottomLeft)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.BottomRight)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.MiddleCenter)
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
- else if (TextAlign == ContentAlignment.MiddleLeft)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.MiddleRight)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.TopCenter)
- flags = TextFormatFlags.Top | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.TopLeft)
- flags = TextFormatFlags.Top | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.TopRight)
- flags = TextFormatFlags.Top | TextFormatFlags.Right;
- else
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
- }
- else
- {
- if (TextAlign == ContentAlignment.BottomCenter)
- flags = TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.BottomLeft)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.BottomRight)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.MiddleCenter)
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
- else if (TextAlign == ContentAlignment.MiddleLeft)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.MiddleRight)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.TopCenter)
- flags = TextFormatFlags.Top | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.TopLeft)
- flags = TextFormatFlags.Top | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.TopRight)
- flags = TextFormatFlags.Top | TextFormatFlags.Left;
- else
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
-
- flags |= TextFormatFlags.RightToLeft;
- }
-
- TextRenderer.DrawText(e.Graphics, button.Text, button.Font, rect, foreColor, flags);
-
- // Paint Button Border
- using Pen penB = new(borderColor);
- e.Graphics.DrawRoundedRectangle(penB, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- }
- }
-
- private Color GetBackColor(Button button)
- {
- if (button.Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomCheckBox.cs b/MsmhTools/CustomControls/CustomCheckBox.cs
deleted file mode 100644
index 919a173..0000000
--- a/MsmhTools/CustomControls/CustomCheckBox.cs
+++ /dev/null
@@ -1,357 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing.Design;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, April 17, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomCheckBox : CheckBox
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Appearance Appearance { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new FlatStyle FlatStyle { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new FlatButtonAppearance? FlatAppearance { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new ContentAlignment TextAlign { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new ContentAlignment CheckAlign { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new bool AutoSize { get; set; }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mCheckColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Check Color")]
- public Color CheckColor
- {
- get { return mCheckColor; }
- set
- {
- if (mCheckColor != value)
- {
- mCheckColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- Invalidate();
- }
- }
- }
-
- private string? mText = string.Empty;
- [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0," +
- "Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Text")]
- public override string? Text
- {
- get { return mText; }
- set
- {
- if (mText != value)
- {
- mText = value;
- Invalidate();
- }
- }
- }
-
- private bool ApplicationIdle = false;
- private bool once = true;
- public CustomCheckBox() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomCheckBox_HandleCreated;
- LocationChanged += CustomCheckBox_LocationChanged;
- Move += CustomCheckBox_Move;
- EnabledChanged += CustomCheckBox_EnabledChanged;
- BackColorChanged += CustomCheckBox_BackColorChanged;
- RightToLeftChanged += CustomCheckBox_RightToLeftChanged;
- Paint += CustomCheckBox_Paint;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomCheckBox_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomCheckBox_LocationChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomCheckBox_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomCheckBox_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomCheckBox_BackColorChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomCheckBox_RightToLeftChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomCheckBox_Paint(object? sender, PaintEventArgs e)
- {
- if (ApplicationIdle == false)
- return;
-
- if (sender is CheckBox checkBox)
- {
- Color backColor = GetBackColor(checkBox);
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
- Color checkColor = GetCheckColor();
-
- e.Graphics.Clear(backColor);
- checkBox.Appearance = Appearance.Button;
- checkBox.FlatStyle = FlatStyle.Flat;
-
- checkBox.FlatAppearance.BorderSize = 0;
- checkBox.AutoSize = false;
- checkBox.UseVisualStyleBackColor = false;
- SizeF sizeF = checkBox.CreateGraphics().MeasureString(checkBox.Text, checkBox.Font);
- int rectSize = 12;
- checkBox.Height = (int)sizeF.Height;
- checkBox.Width = (int)(sizeF.Width + rectSize + 5);
- int x;
- float textX;
-
- if (checkBox.RightToLeft == RightToLeft.No)
- {
- checkBox.TextAlign = ContentAlignment.MiddleLeft;
- x = 1;
- textX = (float)(rectSize * 1.3);
- }
- else
- {
- checkBox.TextAlign = ContentAlignment.MiddleRight;
- x = checkBox.Width - rectSize - 2;
- textX = checkBox.Width - sizeF.Width - (float)(rectSize * 1.2);
- }
-
- int y = (checkBox.ClientRectangle.Y + 1 + (checkBox.ClientRectangle.Height - rectSize)) / 2;
- Point pt = new(x, y);
- Rectangle rectCheck = new(pt, new Size(rectSize, rectSize));
-
- // Draw Selection Border
- Rectangle cRect = new(checkBox.ClientRectangle.X, checkBox.ClientRectangle.Y, checkBox.ClientRectangle.Width - 1, checkBox.ClientRectangle.Height - 1);
- if (checkBox.Focused)
- {
- using Pen pen = new(SelectionColor) { DashStyle = DashStyle.Dot };
- e.Graphics.DrawRectangle(pen, cRect);
- }
-
- // Draw Text
- using SolidBrush brush1 = new(foreColor);
- e.Graphics.DrawString(checkBox.Text, checkBox.Font, brush1, textX, 0);
-
- // Fill Check Rect
- using SolidBrush brush2 = new(backColor);
- e.Graphics.FillRectangle(brush2, rectCheck);
-
- // Draw Check
- if (checkBox.Checked)
- {
- if (checkBox.CheckState == CheckState.Checked)
- {
- // Draw Check
- using Pen p = new(checkColor, 2);
- rectCheck.Inflate(-2, -2);
- e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
- e.Graphics.DrawLines(p, new Point[] { new Point(rectCheck.Left, rectCheck.Bottom - rectCheck.Height / 2), new Point(rectCheck.Left + rectCheck.Width / 3, rectCheck.Bottom), new Point(rectCheck.Right, rectCheck.Top) });
- e.Graphics.SmoothingMode = SmoothingMode.Default;
- rectCheck.Inflate(+2, +2);
- }
- else if (checkBox.CheckState == CheckState.Indeterminate)
- {
- // Draw Indeterminate
- using SolidBrush sb = new(checkColor);
- rectCheck.Inflate(-2, -2);
- e.Graphics.FillRectangle(sb, rectCheck);
- rectCheck.Inflate(+2, +2);
- }
- }
-
- // Draw Check Rect (Check Border)
- ControlPaint.DrawBorder(e.Graphics, rectCheck, borderColor, ButtonBorderStyle.Solid);
- }
- }
-
- private Color GetBackColor(CheckBox checkBox)
- {
- if (checkBox.Enabled)
- return BackColor;
- else
- {
- Color backColor = BackColor;
- if (checkBox.Parent != null)
- {
- if (checkBox.Parent.BackColor != Color.Transparent)
- {
- if (checkBox.Parent.Enabled)
- backColor = checkBox.Parent.BackColor;
- else
- backColor = GetDisabledColor(checkBox.Parent.BackColor);
- }
- else
- {
- if (checkBox.FindForm() != null)
- {
- if (checkBox.Parent.Enabled)
- backColor = checkBox.FindForm().BackColor;
- else
- backColor = GetDisabledColor(checkBox.FindForm().BackColor);
- }
- }
- }
- return backColor;
- }
-
- static Color GetDisabledColor(Color color)
- {
- if (color.DarkOrLight() == "Dark")
- return color.ChangeBrightness(0.3f);
- else
- return color.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetCheckColor()
- {
- if (Enabled)
- return CheckColor;
- else
- {
- if (CheckColor.DarkOrLight() == "Dark")
- return CheckColor.ChangeBrightness(0.3f);
- else
- return CheckColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomComboBox.cs b/MsmhTools/CustomControls/CustomComboBox.cs
deleted file mode 100644
index 79d00fa..0000000
--- a/MsmhTools/CustomControls/CustomComboBox.cs
+++ /dev/null
@@ -1,413 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-using System.Windows.Forms.Design;
-/*
- * Copyright MSasanMH, April 16, 2022.
- */
-
-namespace CustomControls
-{
- public class CustomComboBox : ComboBox
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new FlatStyle FlatStyle { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new ComboBoxStyle DropDownStyle { get; set; }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.DodgerBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- Invalidate();
- }
- }
- }
-
- private string mText = string.Empty;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Text")]
- public override string Text
- {
- get { return mText; }
- set
- {
- if (mText != value)
- {
- mText = value;
- Invalidate();
- }
- }
- }
-
- private bool ApplicationIdle = false;
- private bool once = true;
-
- public CustomComboBox() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- DrawMode = DrawMode.OwnerDrawVariable;
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- base.FlatStyle = FlatStyle.Flat;
- base.DropDownStyle = ComboBoxStyle.DropDownList;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomComboBox_HandleCreated;
- BackColorChanged += CustomComboBox_BackColorChanged;
- ForeColorChanged += CustomComboBox_ForeColorChanged;
- MouseMove += CustomComboBox_MouseMove;
- LocationChanged += CustomComboBox_LocationChanged;
- Move += CustomComboBox_Move;
- EnabledChanged += CustomComboBox_EnabledChanged;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomComboBox_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomComboBox_BackColorChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomComboBox_ForeColorChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomComboBox_MouseMove(object? sender, MouseEventArgs e)
- {
- Invalidate();
- }
-
- private void CustomComboBox_LocationChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomComboBox_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomComboBox_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- protected override void Dispose(bool disposing)
- {
- base.Dispose(disposing);
- }
-
- protected override void OnTabStopChanged(EventArgs e)
- {
- base.OnTabStopChanged(e);
- Invalidate();
- }
-
- protected override void OnTabIndexChanged(EventArgs e)
- {
- base.OnTabIndexChanged(e);
- Invalidate();
- }
-
- protected override void OnGotFocus(EventArgs e)
- {
- base.OnGotFocus(e);
- Invalidate();
- }
-
- protected override void OnLostFocus(EventArgs e)
- {
- base.OnLostFocus(e);
- Invalidate();
- }
-
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- Invalidate();
- }
-
- protected override void OnTextUpdate(EventArgs e)
- {
- base.OnTextUpdate(e);
- Invalidate();
- }
-
- protected override void OnSelectedValueChanged(EventArgs e)
- {
- base.OnSelectedValueChanged(e);
- Invalidate();
- }
-
- protected override void OnVisibleChanged(EventArgs e)
- {
- base.OnVisibleChanged(e);
- Invalidate();
- }
-
- protected override void OnInvalidated(InvalidateEventArgs e)
- {
- base.OnInvalidated(e);
- }
-
- protected override void OnResize(EventArgs e)
- {
- base.OnResize(e);
- Invalidate();
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- if (!ApplicationIdle)
- return;
-
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
- Color backColorDarker = backColor.ChangeBrightness(-0.3f);
-
- // Selected Border Color
- if (Focused && TabStop)
- borderColor = GetBorderColor();
-
- // Rectangle
- Rectangle rect = ClientRectangle;
-
- // Mouse Position
- Point mP = PointToClient(MousePosition);
-
- // Paint Background
- using SolidBrush sb = new(backColor);
- e.Graphics.FillRectangle(sb, rect);
-
- // Button X, Y, Width, Height
- int buttonX;
- if (RightToLeft == RightToLeft.No)
- buttonX = rect.Right - 15;
- else
- buttonX = rect.Left + 1;
- int buttonY = rect.Top + 1;
- int buttonWidth = 14;
- int buttonHeight = rect.Height - 2;
-
- // Button Rectangle
- Rectangle rectButton = new(buttonX, buttonY, buttonWidth, buttonHeight);
-
- // Paint Button
- using SolidBrush buttonBrush = new(backColorDarker);
- e.Graphics.FillRectangle(buttonBrush, rectButton);
-
- // Paint MouseOver Button
- if (Enabled && rectButton.Contains(mP))
- {
- Color hoverColor = backColor.DarkOrLight() == "Dark" ? backColor.ChangeBrightness(0.3f) : backColor.ChangeBrightness(-0.3f);
- using SolidBrush sbHover = new(hoverColor);
- e.Graphics.FillRectangle(sbHover, rectButton);
- }
-
- // Arrow Points
- Point center = new(rectButton.X + rectButton.Width / 2, rectButton.Y + rectButton.Height / 2);
- Point TopLeft = new(center.X - 3, center.Y - 1);
- Point TopRight = new(center.X + 4, center.Y - 1);
- Point Bottom = new(center.X, center.Y + 3);
- Point[] arrowPoints = new Point[]
- {
- TopLeft, // Top Left
- TopRight, // Top Right
- Bottom // Bottom
- };
-
- // Paint Arrow
- using SolidBrush arrowBrush = new(foreColor);
- e.Graphics.FillPolygon(arrowBrush, arrowPoints);
-
- // Text X, Y, Width, Height
- int textX;
- if (RightToLeft == RightToLeft.No)
- textX = rect.Left + 1;
- else
- textX = rect.Left + buttonWidth + 1;
- int textY = rect.Top;
- int textWidth = rect.Width - buttonWidth - 2;
- int textHeight = rect.Height;
-
- // Text Rectangle
- Rectangle rectText = new(textX, textY, textWidth, textHeight);
-
- StringFormat stringFormat = new()
- {
- LineAlignment = StringAlignment.Center,
- Alignment = StringAlignment.Near,
- FormatFlags = StringFormatFlags.NoWrap,
- Trimming = StringTrimming.EllipsisCharacter
- };
-
- // Paint Text
- string text = SelectedItem != null ? SelectedItem.ToString() : Text;
- using SolidBrush textBrush = new(foreColor);
- e.Graphics.DrawString(text, Font, textBrush, rectText, stringFormat);
-
- // Paint Border
- ControlPaint.DrawBorder(e.Graphics, rect, borderColor, ButtonBorderStyle.Solid);
-
- // ComboBox Height
- Size textSize = TextRenderer.MeasureText(text, Font);
- if (textSize.Height == 0)
- ItemHeight = 17;
- else
- ItemHeight = textSize.Height + 2;
- base.OnPaint(e);
- }
-
- protected override void OnDrawItem(DrawItemEventArgs e)
- {
- Graphics g = e.Graphics;
- Rectangle rect = e.Bounds;
-
- Color textColor = ForeColor;
- Color fillColor = BackColor;
-
- if ((e.State & DrawItemState.Selected) == DrawItemState.Selected ||
- (e.State & DrawItemState.Focus) == DrawItemState.Focus)
- fillColor = SelectionColor;
-
- using SolidBrush sb = new(fillColor);
- g.FillRectangle(sb, rect);
-
- if (e.Index >= 0 && e.Index < Items.Count)
- {
- var text = Items[e.Index].ToString();
-
- using SolidBrush b = new(textColor);
- var padding = 2;
-
- Rectangle modRect = new(rect.Left + padding,
- rect.Top + padding,
- rect.Width - (padding * 2),
- rect.Height - (padding * 2));
-
- var stringFormat = new StringFormat
- {
- LineAlignment = StringAlignment.Center,
- Alignment = StringAlignment.Near,
- FormatFlags = StringFormatFlags.NoWrap,
- Trimming = StringTrimming.EllipsisCharacter
- };
-
- g.DrawString(text, Font, b, modRect, stringFormat);
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomContextMenuStrip.cs b/MsmhTools/CustomControls/CustomContextMenuStrip.cs
deleted file mode 100644
index aadbdc5..0000000
--- a/MsmhTools/CustomControls/CustomContextMenuStrip.cs
+++ /dev/null
@@ -1,233 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 20, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomContextMenuStrip : ContextMenuStrip
- {
- private readonly CustomToolStripRenderer MyRenderer = new();
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- BorderColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- SelectionColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- private bool mSameColorForSubItems = true;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Same Color For Sub Items")]
- public bool SameColorForSubItems
- {
- get { return mSameColorForSubItems; }
- set
- {
- if (mSameColorForSubItems != value)
- {
- mSameColorForSubItems = value;
- SameColorForSubItemsChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Action"), Description("Same Color For Sub Items Changed Event")]
- public event EventHandler? SameColorForSubItemsChanged;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Border Color Changed Event")]
- public event EventHandler? BorderColorChanged;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Selection Color Changed Event")]
- public event EventHandler? SelectionColorChanged;
-
- public CustomContextMenuStrip() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
- BorderColor = Color.Blue;
- SelectionColor = Color.LightBlue;
-
- MyRenderer.BackColor = GetBackColor();
- MyRenderer.ForeColor = GetForeColor();
- MyRenderer.BorderColor = GetBorderColor();
- MyRenderer.SelectionColor = SelectionColor;
- Renderer = MyRenderer;
-
- BackColorChanged += CustomContextMenuStrip_BackColorChanged;
- ForeColorChanged += CustomContextMenuStrip_ForeColorChanged;
- BorderColorChanged += CustomContextMenuStrip_BorderColorChanged;
- SelectionColorChanged += CustomContextMenuStrip_SelectionColorChanged;
- SameColorForSubItemsChanged += CustomContextMenuStrip_SameColorForSubItemsChanged;
- ItemAdded += CustomContextMenuStrip_ItemAdded;
- Paint += CustomContextMenuStrip_Paint;
-
- var timer = new System.Windows.Forms.Timer();
- timer.Interval = 100;
- timer.Tick += (s, e) =>
- {
- if (SameColorForSubItems)
- ColorForSubItems();
- };
- timer.Start();
- }
-
- private void ColorForSubItems()
- {
- for (int a = 0; a < Items.Count; a++)
- {
- ToolStripItem toolStripItem = Items[a];
- var toolStripItems = Controllers.GetAllToolStripItems(toolStripItem);
- for (int b = 0; b < toolStripItems.Count(); b++)
- {
- ToolStripItem? tsi = toolStripItems.ToList()[b];
- if (tsi is ToolStripMenuItem)
- {
- if (tsi is ToolStripMenuItem tsmi)
- {
- tsmi.BackColor = GetBackColor();
- tsmi.ForeColor = GetForeColor();
- }
- }
- else if (tsi is ToolStripSeparator)
- {
- if (tsi is ToolStripSeparator tss)
- {
- tss.BackColor = GetBackColor();
- tss.ForeColor = BorderColor;
- }
- }
- }
- }
- }
-
- private void CustomContextMenuStrip_BackColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BackColor = GetBackColor();
- Invalidate();
- }
-
- private void CustomContextMenuStrip_ForeColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.ForeColor = GetForeColor();
- Invalidate();
- }
-
- private void CustomContextMenuStrip_BorderColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BorderColor = GetBorderColor();
- Invalidate();
- }
-
- private void CustomContextMenuStrip_SelectionColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.SelectionColor = SelectionColor;
- Invalidate();
- }
-
- private void CustomContextMenuStrip_SameColorForSubItemsChanged(object? sender, EventArgs e)
- {
- if (SameColorForSubItems)
- ColorForSubItems();
- }
-
- private void CustomContextMenuStrip_ItemAdded(object? sender, ToolStripItemEventArgs e)
- {
- if (SameColorForSubItems)
- ColorForSubItems();
- Invalidate();
- }
-
- private void CustomContextMenuStrip_Paint(object? sender, PaintEventArgs e)
- {
- Color borderColor = GetBorderColor();
- ControlPaint.DrawBorder(e.Graphics, ClientRectangle, borderColor, ButtonBorderStyle.Solid);
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.2f);
- else
- return BackColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomDataGridView.cs b/MsmhTools/CustomControls/CustomDataGridView.cs
deleted file mode 100644
index a75f8ca..0000000
--- a/MsmhTools/CustomControls/CustomDataGridView.cs
+++ /dev/null
@@ -1,772 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing.Drawing2D;
-using System.Runtime.InteropServices;
-using System.Windows.Forms.Design;
-
-namespace CustomControls
-{
- public class CustomDataGridView : DataGridView
- {
- private static class Methods
- {
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- private extern static int SetWindowTheme(IntPtr controlHandle, string appName, string? idList);
- internal static void SetDarkControl(Control control)
- {
- _ = SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
- foreach (Control c in control.Controls)
- {
- _ = SetWindowTheme(c.Handle, "DarkMode_Explorer", null);
- }
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Color BackgroundColor { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new bool EnableHeadersVisualStyles { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new DataGridViewHeaderBorderStyle ColumnHeadersBorderStyle { get; set; }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Column Headers Border")]
- public bool ColumnHeadersBorder { get; set; }
-
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public override Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.DodgerBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mGridColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Grid Lines Color")]
- public new Color GridColor
- {
- get { return mGridColor; }
- set
- {
- if (mGridColor != value)
- {
- mGridColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mCheckColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Check Color for CheckBox Cell Type")]
- public Color CheckColor
- {
- get { return mCheckColor; }
- set
- {
- if (mCheckColor != value)
- {
- mCheckColor = value;
- Invalidate();
- }
- }
- }
-
- private bool mSelectionModeFocus = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Set Focus On Full Row\nWorks on SelectionMode = FullRowSelect")]
- public bool SelectionModeFocus
- {
- get { return mSelectionModeFocus; }
- set
- {
- if (mSelectionModeFocus != value)
- {
- mSelectionModeFocus = value;
- Invalidate();
- }
- }
- }
-
- private Color BackColorDarker { get; set; }
- public Color SelectionUnfocused { get; private set; }
-
- private bool ApplicationIdle = false;
- private bool once = true;
-
- public CustomDataGridView() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- BorderStyle = BorderStyle.FixedSingle;
- EnableHeadersVisualStyles = false;
- ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
-
- ColumnHeadersBorder = true;
- Application.Idle += Application_Idle;
- RowsAdded += CustomDataGridView_RowsAdded;
- GotFocus += CustomDataGridView_GotFocus;
- LostFocus += CustomDataGridView_LostFocus;
- HandleCreated += DataGridView_HandleCreated;
- Invalidated += CustomDataGridView_Invalidated;
- MouseEnter += CustomDataGridView_MouseEnter;
- MouseUp += CustomDataGridView_MouseUp;
- MouseDown += CustomDataGridView_MouseDown;
- MouseMove += CustomDataGridView_MouseMove;
- LocationChanged += CustomDataGridView_LocationChanged;
- Move += CustomDataGridView_Move;
- Scroll += DataGridView_Scroll;
- GotFocus += DataGridView_GotFocus;
- LostFocus += DataGridView_LostFocus;
- EnabledChanged += DataGridView_EnabledChanged;
- CellClick -= DataGridView_CellClick;
- CellClick += DataGridView_CellClick;
- CellPainting += DataGridView_CellPainting;
- Paint += DataGridView_Paint;
- EditingControlShowing += CustomDataGridView_EditingControlShowing;
-
- KeyDown += CustomDataGridView_KeyDown;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomDataGridView_RowsAdded(object? sender, DataGridViewRowsAddedEventArgs e)
- {
- if (sender is CustomDataGridView gv)
- DataGridViewColor(gv);
- }
-
- private void CustomDataGridView_GotFocus(object? sender, EventArgs e)
- {
- if (sender is CustomDataGridView gv)
- DataGridViewColor(gv);
- }
-
- private void CustomDataGridView_LostFocus(object? sender, EventArgs e)
- {
- if (sender is CustomDataGridView gv)
- DataGridViewColor(gv);
- }
-
- private void DataGridView_HandleCreated(object? sender, EventArgs e)
- {
- if (sender is null || e is null)
- return;
- BackColorDarker = mBackColor.ChangeBrightness(-0.3f);
- SelectionUnfocused = mSelectionColor.ChangeBrightness(0.3f);
- var gv = sender as DataGridView;
- DataGridViewColor(gv);
- gv.Invalidate();
- }
-
- private void CustomDataGridView_Invalidated(object? sender, InvalidateEventArgs e)
- {
- if (BackColor.DarkOrLight() == "Dark")
- Methods.SetDarkControl(this);
- }
-
- private void CustomDataGridView_MouseEnter(object? sender, EventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void CustomDataGridView_MouseUp(object? sender, MouseEventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void CustomDataGridView_MouseDown(object? sender, MouseEventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void CustomDataGridView_MouseMove(object? sender, MouseEventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void CustomDataGridView_LocationChanged(object? sender, EventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void CustomDataGridView_Move(object? sender, EventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void DataGridView_Scroll(object? sender, ScrollEventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void DataGridView_GotFocus(object? sender, EventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void DataGridView_LostFocus(object? sender, EventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void DataGridView_EnabledChanged(object? sender, EventArgs e)
- {
- var gv = sender as DataGridView;
- gv.Invalidate();
- }
-
- private void DataGridViewColor(DataGridView? gv)
- {
- // Update Colors
- BackColorDarker = GetBackColor().ChangeBrightness(-0.3f);
- SelectionUnfocused = GetSelectionColor().ChangeBrightness(0.3f);
- //OriginalColors = new Color[] { BackColor, ForeColor, BorderColor, SelectionColor, GridColor, CheckColor, BackColorDarker, SelectionUnfocused };
-
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color gridColor = GetGridColor();
- Color backColorDarker = BackColorDarker;
-
- gv.BackgroundColor = backColor;
- gv.GridColor = gridColor;
- gv.ColumnHeadersDefaultCellStyle.BackColor = backColorDarker;
- gv.ColumnHeadersDefaultCellStyle.SelectionBackColor = backColorDarker;
- gv.ColumnHeadersDefaultCellStyle.ForeColor = foreColor;
- gv.ColumnHeadersDefaultCellStyle.SelectionForeColor = foreColor;
- gv.DefaultCellStyle.BackColor = backColor;
- gv.DefaultCellStyle.ForeColor = foreColor;
- if (gv.Focused)
- gv.DefaultCellStyle.SelectionBackColor = SelectionColor;
- else
- gv.DefaultCellStyle.SelectionBackColor = SelectionUnfocused;
- gv.DefaultCellStyle.SelectionForeColor = foreColor;
- gv.EnableHeadersVisualStyles = false;
- if (ColumnHeadersBorder)
- gv.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
- else
- gv.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.None;
- }
- private static void DataGridView_CellClick(object? sender, DataGridViewCellEventArgs e)
- {
- var gv = sender as DataGridView;
- if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
- {
- var cell = gv[e.ColumnIndex, e.RowIndex];
- if (cell.Value == DBNull.Value)
- return;
-
- // DataGridViewCheckBoxCell
- if (cell.GetType().ToString().Contains("CheckBox", StringComparison.OrdinalIgnoreCase))
- {
- var checkBox = cell as DataGridViewCheckBoxCell;
- if (cell.GetType().ToString().Contains("CheckBox", StringComparison.OrdinalIgnoreCase))
- {
- if (checkBox.ThreeState)
- {
- if (cell.Value is null or "null")
- {
- cell.Value = false;
- gv.UpdateCellValue(e.ColumnIndex, e.RowIndex);
- gv.EndEdit();
- gv.InvalidateCell(cell);
- }
- else
- {
- bool cellValue = Convert.ToBoolean(cell.Value);
- if (cellValue == true)
- {
- cell.Value = "null";
- gv.UpdateCellValue(e.ColumnIndex, e.RowIndex);
- gv.EndEdit();
- gv.InvalidateCell(cell);
- }
- else
- {
- cell.Value = true;
- gv.UpdateCellValue(e.ColumnIndex, e.RowIndex);
- gv.EndEdit();
- gv.InvalidateCell(cell);
- }
- }
- }
- else
- {
- if (cell.Value is null)
- cell.Value = false;
-
- if (cell.Value is not null)
- {
- bool cellValue = Convert.ToBoolean(cell.Value);
- if (cellValue == true)
- {
- cell.Value = false;
- gv.UpdateCellValue(e.ColumnIndex, e.RowIndex);
- gv.EndEdit();
- gv.InvalidateCell(cell);
- }
- else
- {
- cell.Value = true;
- gv.UpdateCellValue(e.ColumnIndex, e.RowIndex);
- gv.EndEdit();
- gv.InvalidateCell(cell);
- }
- }
- }
- }
- }
- else
- {
- if (cell.Value is null or DBNull)
- cell.Value = string.Empty;
- }
-
- //// DataGridViewComboBoxCell
- //if (cell.GetType().ToString().Contains("ComboBox", StringComparison.OrdinalIgnoreCase))
- //{
-
- //}
-
- }
- }
-
- private void DataGridView_CellPainting(object? sender, DataGridViewCellPaintingEventArgs e)
- {
- var gv = sender as DataGridView;
- // Update Colors
- DataGridViewColor(gv);
-
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
- Color gridColor = GetGridColor();
- Color checkColor = GetCheckColor();
- Color backColorDarker = BackColorDarker;
-
- if (ApplicationIdle == false)
- return;
-
- if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
- {
- var cell = gv[e.ColumnIndex, e.RowIndex];
-
- // DataGridViewCheckBoxCell
- if (cell.GetType().ToString().Contains("CheckBox", StringComparison.OrdinalIgnoreCase))
- {
- if (cell.Value is DBNull)
- cell.Value = false;
-
- Rectangle rectCell = gv.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
- var checkBox = cell as DataGridViewCheckBoxCell;
- e.Handled = true;
- e.PaintBackground(rectCell, true);
-
- rectCell = new(rectCell.X, rectCell.Y, rectCell.Width - 2, rectCell.Height - 2);
- int checkSize = 13;
- checkSize = Math.Min(checkSize, rectCell.Width);
- checkSize = Math.Min(checkSize, rectCell.Height);
- int centerX = rectCell.X + rectCell.Width / 2 - checkSize / 2;
- int centerY = rectCell.Y + rectCell.Height / 2 - checkSize / 2;
-
- rectCell = new(centerX, centerY, checkSize, checkSize);
-
- // Fill Check Rect
- using SolidBrush brush1 = new(backColor);
- e.Graphics.FillRectangle(brush1, rectCell);
-
- // Draw Check
- if (cell.Value != DBNull.Value)
- {
- int rectCheck = rectCell.Height - 1;
- if (rectCheck <= 0)
- rectCheck = 1;
-
- if (rectCheck > 1)
- {
- if (cell.Value is null or "null")
- {
- if (checkBox.ThreeState)
- {
- // Draw Indeterminate
- using SolidBrush sb = new(checkColor);
- rectCell.Inflate(-2, -2);
- e.Graphics.FillRectangle(sb, rectCell);
- rectCell.Inflate(+2, +2);
- }
- }
- else
- {
- if (cell.Value is null)
- cell.Value = false;
-
- if (cell.Value is not null)
- {
- if (Convert.ToBoolean(cell.Value) == true)
- {
- // Draw Check
- using var p = new Pen(checkColor, 2);
- rectCell.Inflate(-2, -2);
- e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
- e.Graphics.DrawLines(p, new Point[] { new Point(rectCell.Left, rectCell.Bottom - rectCell.Height / 2), new Point(rectCell.Left + rectCell.Width / 3, rectCell.Bottom), new Point(rectCell.Right, rectCell.Top) });
- e.Graphics.SmoothingMode = SmoothingMode.Default;
- rectCell.Inflate(+2, +2);
- }
- }
- }
- }
- }
-
- // Draw Check Rect (Check Border)
- ControlPaint.DrawBorder(e.Graphics, rectCell, borderColor, ButtonBorderStyle.Solid);
- }
-
- // DataGridViewComboBoxCell
- if (cell.GetType().ToString().Contains("ComboBox", StringComparison.OrdinalIgnoreCase))
- {
- Rectangle rectCell = gv.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
- var comboBox = cell as DataGridViewComboBoxCell;
- int myPadding = 10;
- e.Handled = true;
- e.PaintBackground(rectCell, true);
- rectCell = new(rectCell.X, rectCell.Y, rectCell.Width - 1, rectCell.Height - 1);
-
- // Fill Background
- using SolidBrush sb = new(backColor);
- e.Graphics.FillRectangle(sb, rectCell);
-
- // Draw Border
- using Pen p = new(gridColor, 1);
- Rectangle modRect1 = new(rectCell.Left, rectCell.Top, rectCell.Width - 1, rectCell.Height - 1);
- e.Graphics.DrawRectangle(p, modRect1);
-
- // Fill Arrow Button Back Color
- using SolidBrush sb2 = new(backColorDarker);
- rectCell = new(rectCell.X + 1, rectCell.Y, rectCell.Width - 1, rectCell.Height);
- int x = (rectCell.X + rectCell.Width) - 15;
- int y = rectCell.Y + 1;
- int buttonWidth = (rectCell.X + rectCell.Width) - x - 1;
- int buttonHeight = rectCell.Height - 2;
- Rectangle modRect2 = new(x, y, buttonWidth, buttonHeight);
- e.Graphics.FillRectangle(sb2, modRect2);
-
- // Draw Arrow Button Icon
- var pth = new GraphicsPath();
- var TopLeft = new PointF(x + buttonWidth * 1 / 5, y + buttonHeight * 2 / 5);
- var TopRight = new PointF(x + buttonWidth * 4 / 5, y + buttonHeight * 2 / 5);
- var Bottom = new PointF(x + buttonWidth / 2, y + buttonHeight * 3 / 5);
- pth.AddLine(TopLeft, TopRight);
- pth.AddLine(TopRight, Bottom);
- // Determine the Arrow's Color.
- using SolidBrush arrowBrush = new(foreColor);
- // Draw the Arrow
- e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
- e.Graphics.FillPath(arrowBrush, pth);
- e.Graphics.SmoothingMode = SmoothingMode.Default;
-
- var text = comboBox.Value != null ? comboBox.Value.ToString() : Text;
-
- using SolidBrush b = new(foreColor);
- int padding = 2;
- int arrowWidth = (int)(TopRight.X - TopLeft.X);
- Rectangle modRect3 = new(rectCell.Left + padding,
- rectCell.Top + padding,
- rectCell.Width - arrowWidth - (myPadding / 2) - (padding * 2),
- rectCell.Height - (padding * 2));
-
- var stringFormat = new StringFormat
- {
- LineAlignment = StringAlignment.Center,
- Alignment = StringAlignment.Near,
- FormatFlags = StringFormatFlags.NoWrap,
- Trimming = StringTrimming.EllipsisCharacter
- };
- e.Graphics.DrawString(text, Font, b, modRect3, stringFormat);
- }
-
- }
- }
-
- private void DataGridView_Paint(object? sender, PaintEventArgs e)
- {
- var gv = sender as DataGridView;
- // Update Colors
- DataGridViewColor(gv);
-
- if (ApplicationIdle == false)
- return;
-
- Rectangle rectGv = new(0, 0, ClientSize.Width, ClientSize.Height);
-
- Color borderColor = GetBorderColor();
-
- if (BorderStyle == BorderStyle.FixedSingle)
- ControlPaint.DrawBorder(e.Graphics, rectGv, borderColor, ButtonBorderStyle.Solid);
- else if (BorderStyle == BorderStyle.Fixed3D)
- {
- Color secondBorderColor;
- if (borderColor.DarkOrLight() == "Dark")
- secondBorderColor = borderColor.ChangeBrightness(0.6f);
- else
- secondBorderColor = borderColor.ChangeBrightness(-0.6f);
-
- Rectangle rect3D = rectGv;
- ControlPaint.DrawBorder(e.Graphics, rect3D, secondBorderColor, ButtonBorderStyle.Solid);
-
- rect3D = new(rectGv.X + 1, rectGv.Y + 1, rectGv.Width - 1, rectGv.Height - 1);
- ControlPaint.DrawBorder(e.Graphics, rect3D, secondBorderColor, ButtonBorderStyle.Solid);
-
- rect3D = new(rectGv.X, rectGv.Y, rectGv.Width - 1, rectGv.Height - 1);
- ControlPaint.DrawBorder(e.Graphics, rect3D, borderColor, ButtonBorderStyle.Solid);
- }
- }
-
- private void CustomDataGridView_EditingControlShowing(object? sender, DataGridViewEditingControlShowingEventArgs e)
- {
- //if (sender is CheckBox checkBox)
- //{
- // if (checkBox.CheckState == CheckState.Indeterminate)
-
- //}
- }
-
- private void CustomDataGridView_KeyDown(object? sender, KeyEventArgs e)
- {
- var dgv = sender as DataGridView;
- if (SelectionModeFocus && SelectionMode == DataGridViewSelectionMode.FullRowSelect)
- {
- if (dgv.Rows.Count == 0) return;
- int currentRow = dgv.CurrentCell.RowIndex;
-
- if (e.KeyCode == Keys.Tab)
- {
- if (currentRow + 1 < dgv.Rows.Count && dgv.Rows[currentRow].Cells.Count > 0)
- {
- e.SuppressKeyPress = true;
-
- currentRow++;
- dgv.Rows[currentRow].Cells[0].Selected = true;
- dgv.Rows[currentRow].Selected = true;
- }
- else
- {
- Control ctl;
- ctl = (Control)sender;
- ctl.SelectNextControl(GetNextControl(ctl, true), true, false, true, true);
- }
- }
-
- if (e.KeyCode == Keys.Space || e.KeyCode == Keys.Right || e.KeyCode == Keys.Left)
- {
- if (dgv.Rows[currentRow].Cells.Count > 0)
- {
- e.SuppressKeyPress = true;
- int cellN = 0;
- for (int n = 0; n < dgv.Rows[currentRow].Cells.Count; n++)
- {
- var cell = dgv.Rows[currentRow].Cells[n];
- if (cell.GetType().ToString().Contains("CheckBox", StringComparison.OrdinalIgnoreCase))
- {
- cellN = n;
- cell.Selected = true;
- dgv.Rows[currentRow].Selected = true;
- }
- }
- dgv.Rows[currentRow].Cells[cellN].Selected = true;
- dgv.Rows[currentRow].Selected = true;
- }
- }
-
-
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetSelectionColor()
- {
- if (Enabled)
- return SelectionColor;
- else
- {
- if (SelectionColor.DarkOrLight() == "Dark")
- return SelectionColor.ChangeBrightness(0.3f);
- else
- return SelectionColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetGridColor()
- {
- if (Enabled)
- return GridColor;
- else
- {
- if (GridColor.DarkOrLight() == "Dark")
- return GridColor.ChangeBrightness(0.3f);
- else
- return GridColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetCheckColor()
- {
- if (Enabled)
- return CheckColor;
- else
- {
- if (CheckColor.DarkOrLight() == "Dark")
- return CheckColor.ChangeBrightness(0.3f);
- else
- return CheckColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomGroupBox.cs b/MsmhTools/CustomControls/CustomGroupBox.cs
deleted file mode 100644
index e0b8a34..0000000
--- a/MsmhTools/CustomControls/CustomGroupBox.cs
+++ /dev/null
@@ -1,322 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, May 01, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomGroupBox : GroupBox
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new FlatStyle FlatStyle { get; set; }
-
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public override Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool ApplicationIdle = false;
- private bool once = true;
-
- private Point GetPoint = new(0, 0);
- private string GetName = string.Empty;
-
- public CustomGroupBox() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- FlatStyle = FlatStyle.Flat;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomGroupBox_HandleCreated;
- LocationChanged += CustomGroupBox_LocationChanged;
- Move += CustomGroupBox_Move;
- ControlAdded += CustomGroupBox_ControlAdded;
- ControlRemoved += CustomGroupBox_ControlRemoved;
- Enter += CustomGroupBox_Enter;
- MouseEnter += CustomGroupBox_MouseEnter;
- MouseLeave += CustomGroupBox_MouseLeave;
- ParentChanged += CustomGroupBox_ParentChanged;
- Resize += CustomGroupBox_Resize;
- SizeChanged += CustomGroupBox_SizeChanged;
- EnabledChanged += CustomGroupBox_EnabledChanged;
- Paint += CustomGroupBox_Paint;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null && !DesignMode)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- if (GetPoint != PointToScreen(Location) && GetName == Name)
- {
- if (Parent != null)
- {
- Control topParent = FindForm();
- if (topParent.Visible && Visible)
- {
- Debug.WriteLine("Top Parent of " + Name + " is " + topParent.Name);
- topParent.Refresh(); // Needed when there are many GroupBoxes.
- }
- }
- }
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomGroupBox_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomGroupBox_LocationChanged(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_Move(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_ControlAdded(object? sender, ControlEventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_ControlRemoved(object? sender, ControlEventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_Enter(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_MouseEnter(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_MouseLeave(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_ParentChanged(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_Resize(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_SizeChanged(object? sender, EventArgs e)
- {
- if (sender is GroupBox groupBox)
- groupBox.Invalidate();
- }
-
- private void CustomGroupBox_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomGroupBox_Paint(object? sender, PaintEventArgs e)
- {
- if (ApplicationIdle == false)
- return;
-
- GetPoint = PointToScreen(Location);
- GetName = Name;
-
- if (sender is GroupBox box)
- {
- Color backColor = GetBackColor(box);
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
-
- SizeF strSize = e.Graphics.MeasureString(box.Text, box.Font);
- Rectangle rect = new(box.ClientRectangle.X,
- box.ClientRectangle.Y + (int)(strSize.Height / 2),
- box.ClientRectangle.Width - 1,
- box.ClientRectangle.Height - (int)(strSize.Height / 2) - 1);
-
- e.Graphics.Clear(backColor);
-
- // Draw Text
- using SolidBrush sbForeColor = new(foreColor);
- // Draw Border
- using Pen penBorder = new(borderColor);
-
- if (box.RightToLeft == RightToLeft.Yes)
- {
- // Draw Text
- e.Graphics.DrawString(box.Text, box.Font, sbForeColor, box.Width - (box.Padding.Left + 1) - strSize.Width, 0);
- // Draw Border TopLeft
- e.Graphics.DrawLine(penBorder, new Point(rect.X, rect.Y), new Point((rect.X + rect.Width) - (box.Padding.Left + 1) - (int)strSize.Width, rect.Y));
- // Draw Border TopRight
- e.Graphics.DrawLine(penBorder, new Point((rect.X + rect.Width) - (box.Padding.Left + 1), rect.Y), new Point(rect.X + rect.Width, rect.Y));
- }
- else
- {
- // Draw Text
- e.Graphics.DrawString(box.Text, box.Font, sbForeColor, (box.Padding.Left + 1), 0);
- // Draw Border TopLeft
- e.Graphics.DrawLine(penBorder, new Point(rect.X, rect.Y), new Point(rect.X + (box.Padding.Left + 1), rect.Y));
- // Draw Border TopRight
- e.Graphics.DrawLine(penBorder, new Point(rect.X + (box.Padding.Left + 1) + (int)strSize.Width, rect.Y), new Point(rect.X + rect.Width, rect.Y));
- }
-
- // Draw Border Left
- e.Graphics.DrawLine(penBorder, rect.Location, new Point(rect.X, rect.Y + rect.Height));
- // Draw Border Bottom
- e.Graphics.DrawLine(penBorder, new Point(rect.X, rect.Y + rect.Height), new Point(rect.X + rect.Width, rect.Y + rect.Height));
- // Draw Border Right
- e.Graphics.DrawLine(penBorder, new Point(rect.X + rect.Width, rect.Y), new Point(rect.X + rect.Width, rect.Y + rect.Height));
-
- }
- }
-
- private Color GetBackColor(GroupBox groupBox)
- {
- if (groupBox.Enabled)
- return BackColor;
- else
- {
- if (groupBox.Parent != null)
- {
- if (groupBox.Parent.Enabled == false)
- return GetDisabledColor();
- else
- return GetDisabledColor();
- }
- else
- {
- return GetDisabledColor();
- }
-
- Color GetDisabledColor()
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomInputBox.cs b/MsmhTools/CustomControls/CustomInputBox.cs
deleted file mode 100644
index ed1f2b6..0000000
--- a/MsmhTools/CustomControls/CustomInputBox.cs
+++ /dev/null
@@ -1,772 +0,0 @@
-using MsmhTools;
-using System.Runtime.InteropServices;
-/*
- * Copyright MSasanMH, May 13, 2022.
- * Needs CustomButton.
- */
-
-namespace CustomControls
-{
- public class CustomInputBox : Form
- {
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- private extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string? pszSubIdList);
-
- // Make CustomInputBox movable.
- private const int WM_NCLBUTTONDOWN = 0xA1;
- private const int HT_CAPTION = 0x2;
- [DllImport("user32.dll")]
- private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
- [DllImport("user32.dll")]
- private static extern bool ReleaseCapture();
-
- static CustomTextBox inputTextBox = new();
- static DialogResult dialogResult;
- public new static Color BackColor { get; set; }
- public new static Color ForeColor { get; set; }
- public static Color BorderColor { get; set; }
-
- private static int ImageBox(int iconOffset, Icon icon, Panel textPanel)
- {
- PictureBox pb = new();
- pb.Image = icon.ToBitmap();
- pb.Size = icon.Size;
- pb.Location = new(iconOffset, textPanel.Height / 2 - pb.Height / 2);
- textPanel.Controls.Add(pb);
- return pb.Height;
- }
-
- public CustomInputBox(ref string input, string text, bool multiline, string? caption, MessageBoxIcon? icon, int? addWidth, int? addHeight) : base()
- {
- MessageBoxButtons buttons = MessageBoxButtons.OKCancel;
-
- if (addWidth == null)
- addWidth = 0;
- if (addHeight == null)
- addHeight = 0;
-
- FormBorderStyle = FormBorderStyle.None;
- ShowInTaskbar = false;
- StartPosition = FormStartPosition.CenterParent;
- int iconOffset = 5;
- int buttonOffset = 5;
- int testLabelOffset = iconOffset;
- Rectangle screen = Screen.FromControl(this).Bounds;
-
- // Box Size (Auto)
- ////// Box Width
- AutoSize = false;
- int maxWidth = 400;
- int minWidth = 140; // Shouldn't be smaller than 140.
- Size computeSize = TextRenderer.MeasureText(text, DefaultFont);
- int mWidth = computeSize.Width + 30;
- int iconWidth = 32;
- if (icon != null && icon != MessageBoxIcon.None)
- {
- mWidth += iconWidth + iconOffset;
- testLabelOffset = iconWidth - iconOffset * 2;
- }
- int buttonWidth = 75;
- if (buttons == MessageBoxButtons.OK)
- {
- int previousWidth = mWidth;
- mWidth = buttonWidth + buttonOffset * 2;
- mWidth = Math.Max(previousWidth, mWidth);
- mWidth += buttonOffset;
- }
- else if (buttons == MessageBoxButtons.OKCancel || buttons == MessageBoxButtons.YesNo || buttons == MessageBoxButtons.RetryCancel)
- {
- int previousWidth = mWidth;
- mWidth = buttonWidth * 2 + buttonOffset * 3;
- mWidth = Math.Max(previousWidth, mWidth);
- mWidth += buttonOffset;
- }
- else if (buttons == MessageBoxButtons.AbortRetryIgnore || buttons == MessageBoxButtons.YesNoCancel || buttons == MessageBoxButtons.CancelTryContinue)
- {
- int previousWidth = mWidth;
- mWidth = buttonWidth * 3 + buttonOffset * 4;
- mWidth = Math.Max(previousWidth, mWidth);
- mWidth += buttonOffset;
- }
- mWidth = Math.Min(maxWidth, mWidth);
- mWidth = Math.Max(minWidth, mWidth);
-
- ////// Box Height
- int minHeight = 130;
- int maxHeight = screen.Height - 50;
- Label testLabel = new();
- testLabel.AutoSize = true;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabel.TextAlign = ContentAlignment.MiddleLeft;
- testLabel.Text = text;
- Size testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- int iconHeight;
- if (icon == null || icon == MessageBoxIcon.None)
- iconHeight = 0;
- else
- iconHeight = 32;
- int mHeight;
- if (multiline)
- mHeight = testLabelSize.Height * 5 + 100 + iconHeight;
- else
- mHeight = testLabelSize.Height * 3 / 2 + 110;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- if (multiline)
- mHeight = testLabelSize.Height * 5 + 100 + iconHeight;
- else
- mHeight = testLabelSize.Height * 3 / 2 + 110;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- if (multiline)
- mHeight = testLabelSize.Height * 5 + 100 + iconHeight;
- else
- mHeight = testLabelSize.Height * 3 / 2 + 110;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- if (multiline)
- mHeight = testLabelSize.Height * 5 + 100 + iconHeight;
- else
- mHeight = testLabelSize.Height * 3 / 2 + 110;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- if (multiline)
- mHeight = testLabelSize.Height * 5 + 100 + iconHeight;
- else
- mHeight = testLabelSize.Height * 3 / 2 + 110;
- mHeight = Math.Max(minHeight, mHeight);
- if (mWidth > screen.Width)
- {
- mWidth = screen.Width;
- mHeight = maxHeight;
- }
- }
- }
- }
- }
- Size = new(mWidth + (int)addWidth, mHeight + (int)addHeight);
-
- // Rectangle
- Rectangle rect = new(ClientRectangle.X + 1, ClientRectangle.Y + 1, ClientRectangle.Width - 2, ClientRectangle.Height - 2);
- int buttonPanelHeight = 30;
- int titlePanelHeight = 25;
- Paint += CustomMessageBox_Paint;
- MouseDown += CustomMessageBox_MouseDown;
- Move += CustomMessageBox_Move;
-
- // Title (Caption)
- if (caption != null)
- {
- Label titleLabel = new();
- titleLabel.AutoSize = true;
- titleLabel.TextAlign = ContentAlignment.MiddleLeft;
- titleLabel.Text = caption;
- titleLabel.BackColor = BackColor;
- titleLabel.ForeColor = ForeColor;
- titleLabel.Location = new(2, rect.Y + titlePanelHeight / 2 - titleLabel.GetPreferredSize(Size.Empty).Height / 2);
- Controls.Add(titleLabel);
- }
-
- // Text Body Panel
- Panel textPanel = new();
- textPanel.BackColor = BackColor;
- textPanel.ForeColor = ForeColor;
- textPanel.BorderStyle = BorderStyle.None;
- textPanel.Margin = new Padding(0);
- textPanel.Location = new(rect.X, titlePanelHeight);
- if (multiline)
- {
- if (icon == null || icon == MessageBoxIcon.None)
- textPanel.Size = new(rect.Width, (rect.Height - titlePanelHeight - buttonPanelHeight) / 5);
- else
- textPanel.Size = new(rect.Width, (rect.Height - titlePanelHeight - buttonPanelHeight) / 4);
- }
- else
- textPanel.Size = new(rect.Width, (rect.Height - titlePanelHeight - buttonPanelHeight) * 2 / 3);
- textPanel.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
- Controls.Add(textPanel);
-
- // Input Panel
- Panel inputPanel = new();
- inputPanel.BackColor = BackColor;
- inputPanel.ForeColor = ForeColor;
- inputPanel.BorderStyle = BorderStyle.None;
- inputPanel.Margin = new Padding(0);
- inputPanel.Location = new(rect.X, titlePanelHeight + textPanel.Height);
- if (multiline)
- {
- if (icon == null || icon == MessageBoxIcon.None)
- inputPanel.Size = new(rect.Width, (rect.Height - titlePanelHeight - buttonPanelHeight) * 4 / 5);
- else
- inputPanel.Size = new(rect.Width, (rect.Height - titlePanelHeight - buttonPanelHeight) * 3 / 4);
- }
- else
- inputPanel.Size = new(rect.Width, (rect.Height - titlePanelHeight - buttonPanelHeight) / 3);
- inputPanel.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
- Controls.Add(inputPanel);
-
- // Enum MessageBoxIcon
- if (icon != null)
- {
- iconOffset = 5;
- if (icon == MessageBoxIcon.Asterisk)
- {
- Icon ic = new(SystemIcons.Asterisk, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Error)
- {
- Icon ic = new(SystemIcons.Error, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Exclamation)
- {
- Icon ic = new(SystemIcons.Exclamation, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Hand)
- {
- Icon ic = new(SystemIcons.Hand, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Information)
- {
- Icon ic = new(SystemIcons.Information, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.None)
- {
- // Do Nothing
- }
- else if (icon == MessageBoxIcon.Question)
- {
- Icon ic = new(SystemIcons.Question, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Stop)
- {
- Icon ic = new(SystemIcons.Error, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Warning)
- {
- Icon ic = new(SystemIcons.Warning, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- }
-
- // Text Body Label
- Label textLabel = new();
- textLabel.AutoSize = true;
- textLabel.MaximumSize = new Size(rect.Width - iconOffset, 0);
- textLabel.TextAlign = ContentAlignment.MiddleLeft;
- textLabel.Text = text;
- Size textLabelSize = textLabel.GetPreferredSize(Size.Empty);
- textLabel.Location = new(iconOffset, textPanel.Height / 2 - textLabelSize.Height / 2);
- textPanel.Controls.Add(textLabel);
-
- // Input Label
- inputTextBox = new();
- inputTextBox.Text = input;
- if (multiline == false)
- {
- inputTextBox.Size = new Size(rect.Width - (5 * 2), inputTextBox.Height);
- inputTextBox.MaximumSize = new Size(rect.Width - (5 * 2), 0);
- Size inputLabelSize = inputTextBox.GetPreferredSize(Size.Empty);
- inputTextBox.Location = new(5, inputPanel.Height / 2 - inputLabelSize.Height / 2);
- }
- else
- {
- inputTextBox.Multiline = true;
- inputTextBox.ScrollBars = ScrollBars.Vertical;
- inputTextBox.Size = new Size(rect.Width - (5 * 2), inputPanel.Height);
- inputTextBox.MaximumSize = new Size(rect.Width - (5 * 2), inputPanel.Height);
- inputTextBox.Location = new(5, 0);
- }
- inputPanel.Controls.Add(inputTextBox);
-
- // Button
- Panel buttonPanel = new();
- buttonPanel.BackColor = BackColor.ChangeBrightness(-0.2f);
- buttonPanel.ForeColor = ForeColor;
- buttonPanel.BorderStyle = BorderStyle.None;
- buttonPanel.Margin = new Padding(0);
- buttonPanel.Location = new(rect.X, Height - buttonPanelHeight - 1); // 1 is bottom border
- buttonPanel.Size = new(rect.Width, buttonPanelHeight);
- buttonPanel.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
- Controls.Add(buttonPanel);
-
- // Enum DialogResult
- if (buttons == MessageBoxButtons.AbortRetryIgnore)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
- CustomButton btn3 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Abort";
- btn1.DialogResult = DialogResult.Abort;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Abort;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Retry";
- btn2.DialogResult = DialogResult.Retry;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Retry;
- };
- buttonPanel.Controls.Add(btn2);
-
- btn3.Location = new(rect.Width - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn3.Height / 2);
- btn3.Text = "Ignore";
- btn3.DialogResult = DialogResult.Ignore;
- btn3.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Ignore;
- };
- buttonPanel.Controls.Add(btn3);
-
- if (multiline == false)
- {
- AcceptButton = btn2;
- CancelButton = btn1;
- }
- }
- else if (buttons == MessageBoxButtons.CancelTryContinue)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
- CustomButton btn3 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Cancel";
- btn1.DialogResult = DialogResult.Cancel;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Try Again";
- btn2.DialogResult = DialogResult.TryAgain;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.TryAgain;
- };
- buttonPanel.Controls.Add(btn2);
-
- btn3.Location = new(rect.Width - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn3.Height / 2);
- btn3.Text = "Continue";
- btn3.DialogResult = DialogResult.Continue;
- btn3.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Continue;
- };
- buttonPanel.Controls.Add(btn3);
-
- if (multiline == false)
- {
- AcceptButton = btn2;
- CancelButton = btn1;
- }
- }
- else if (buttons == MessageBoxButtons.OK)
- {
- CustomButton btn1 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "OK";
- btn1.DialogResult = DialogResult.OK;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.OK;
- };
- buttonPanel.Controls.Add(btn1);
-
- if (multiline == false)
- {
- AcceptButton = btn1;
- }
- }
- else if (buttons == MessageBoxButtons.OKCancel)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "OK";
- btn1.DialogResult = DialogResult.OK;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.OK;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Cancel";
- btn2.DialogResult = DialogResult.Cancel;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn2);
-
- if (multiline == false)
- {
- AcceptButton = btn1;
- CancelButton = btn2;
- }
- }
- else if (buttons == MessageBoxButtons.RetryCancel)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Retry";
- btn1.DialogResult = DialogResult.Retry;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Retry;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Cancel";
- btn2.DialogResult = DialogResult.Cancel;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn2);
-
- if (multiline == false)
- {
- AcceptButton = btn1;
- CancelButton = btn2;
- }
- }
- else if (buttons == MessageBoxButtons.YesNo)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Yes";
- btn1.DialogResult = DialogResult.Yes;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Yes;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "No";
- btn2.DialogResult = DialogResult.No;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.No;
- };
- buttonPanel.Controls.Add(btn2);
-
- if (multiline == false)
- {
- AcceptButton = btn1;
- CancelButton = btn2;
- }
- }
- else if (buttons == MessageBoxButtons.YesNoCancel)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
- CustomButton btn3 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Yes";
- btn1.DialogResult = DialogResult.Yes;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Yes;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "No";
- btn2.DialogResult = DialogResult.No;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.No;
- };
- buttonPanel.Controls.Add(btn2);
-
- btn3.Location = new(rect.Width - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn3.Height / 2);
- btn3.Text = "Cancel";
- btn3.DialogResult = DialogResult.Cancel;
- btn3.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn3);
-
- if (multiline == false)
- {
- AcceptButton = btn1;
- CancelButton = btn3;
- }
- }
-
- // Set CustomTextBox and CustomButton Colors
- var cs = Controllers.GetAllControls(this);
- foreach (Control c in cs)
- {
- if (c is CustomTextBox customTextBox)
- {
- if (BackColor.DarkOrLight() == "Dark")
- {
- _ = SetWindowTheme(customTextBox.Handle, "DarkMode_Explorer", null);
- foreach (Control ctb in customTextBox.Controls)
- {
- _ = SetWindowTheme(ctb.Handle, "DarkMode_Explorer", null);
- }
- }
- customTextBox.BackColor = BackColor;
- customTextBox.ForeColor = ForeColor;
- customTextBox.BorderColor = BorderColor;
- customTextBox.Invalidate();
- }
- else if (c is CustomButton customButton)
- {
- customButton.BackColor = BackColor;
- customButton.ForeColor = ForeColor;
- customButton.BorderColor = BorderColor;
- customButton.SelectionColor = BorderColor;
- customButton.Invalidate();
- }
- }
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, null, null, null, null);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// Add amount to width.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, int addWidth)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, null, null, addWidth, null);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// Add amount to width.
- /// Add amount to height.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, int addWidth, int addHeight)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, null, null, addWidth, addHeight);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// The text to display in the title bar of the input box.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, string caption)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, caption, null, null, null);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// The text to display in the title bar of the input box.
- /// Add amount to width.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, string caption, int addWidth)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, caption, null, addWidth, null);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// The text to display in the title bar of the input box.
- /// Add amount to width.
- /// Add amount to height.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, string caption, int addWidth, int addHeight)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, caption, null, addWidth, addHeight);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// The text to display in the title bar of the input box.
- /// One of the System.Windows.Forms.MessageBoxIcon values that specifies which icon to display in the input box.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, string caption, MessageBoxIcon icon)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, caption, icon, null, null);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// The text to display in the title bar of the input box.
- /// One of the System.Windows.Forms.MessageBoxIcon values that specifies which icon to display in the input box.
- /// Add amount to width.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, string caption, MessageBoxIcon icon, int addWidth)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, caption, icon, addWidth, null);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- /// Displays a prompt in a dialog box, waits for the user to input text or click a button.
- ///
- /// Update a String containing the contents of the text box.
- /// The text to display in the input box.
- /// TextBox multiline.
- /// The text to display in the title bar of the input box.
- /// One of the System.Windows.Forms.MessageBoxIcon values that specifies which icon to display in the input box.
- /// Add amount to width.
- /// Add amount to height.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(ref string input, string text, bool multiline, string caption, MessageBoxIcon icon, int addWidth, int addHeight)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomInputBox form = new(ref input, text, multiline, caption, icon, addWidth, addHeight);
- form.ShowDialog();
- input = inputTextBox.Text;
- return dialogResult;
- }
-
- private void CustomMessageBox_Paint(object? sender, PaintEventArgs e)
- {
- Rectangle rect = new(e.ClipRectangle.X, e.ClipRectangle.Y, e.ClipRectangle.Width - 1, e.ClipRectangle.Height - 1);
- Graphics g = e.Graphics;
-
- // Fill BackColor (Static)
- using SolidBrush sb = new(BackColor);
- g.FillRectangle(sb, rect);
-
- // Draw Border
- using Pen pen = new(BorderColor);
- g.DrawRectangle(pen, rect);
- }
-
- private void CustomMessageBox_MouseDown(object? sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- ReleaseCapture();
- _ = SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
- Invalidate();
- }
- }
-
- private void CustomMessageBox_Move(object? sender, EventArgs e)
- {
- Invalidate();
- var cs = Controllers.GetAllControls(this);
- foreach (Control c in cs)
- c.Invalidate();
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomInputBox.resx b/MsmhTools/CustomControls/CustomInputBox.resx
deleted file mode 100644
index 1af7de1..0000000
--- a/MsmhTools/CustomControls/CustomInputBox.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/MsmhTools/CustomControls/CustomLabel.cs b/MsmhTools/CustomControls/CustomLabel.cs
deleted file mode 100644
index 027b57f..0000000
--- a/MsmhTools/CustomControls/CustomLabel.cs
+++ /dev/null
@@ -1,382 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-
-namespace CustomControls
-{
- public class CustomLabel : Label
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override BorderStyle BorderStyle { get; set; }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool mBorder = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border")]
- public bool Border
- {
- get { return mBorder; }
- set
- {
- if (mBorder != value)
- {
- mBorder = value;
- Invalidate();
- }
- }
- }
-
- private int mRoundedCorners = 0;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Rounded Corners")]
- public int RoundedCorners
- {
- get { return mRoundedCorners; }
- set
- {
- if (mRoundedCorners != value)
- {
- mRoundedCorners = value;
- Invalidate();
- }
- }
- }
-
- private bool once = true;
-
- public CustomLabel() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- // Default
- FlatStyle = FlatStyle.Flat;
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomLabel_HandleCreated;
- RightToLeftChanged += CustomLabel_RightToLeftChanged;
- LocationChanged += CustomLabel_LocationChanged;
- Move += CustomLabel_Move;
- EnabledChanged += CustomLabel_EnabledChanged;
- Paint += CustomLabel_Paint;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Parent.BackColorChanged += Parent_BackColorChanged;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void Parent_BackColorChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomLabel_HandleCreated(object? sender, EventArgs e)
- {
- if (sender is Label label)
- label.Invalidate();
- }
-
- private void CustomLabel_RightToLeftChanged(object? sender, EventArgs e)
- {
- if (sender is Label label)
- label.Refresh();
- }
-
- private void CustomLabel_LocationChanged(object? sender, EventArgs e)
- {
- if (sender is Label label)
- label.Invalidate();
- }
-
- private void CustomLabel_Move(object? sender, EventArgs e)
- {
- if (sender is Label label)
- label.Invalidate();
- }
-
- private void CustomLabel_EnabledChanged(object? sender, EventArgs e)
- {
- if (sender is Label label)
- label.Invalidate();
- }
-
- private void CustomLabel_Paint(object? sender, PaintEventArgs e)
- {
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
- BorderStyle = BorderStyle.FixedSingle;
-
- // Paint Background
- if (Parent != null)
- {
- e.Graphics.Clear(Parent.BackColor);
- if (Parent.BackColor == Color.Transparent)
- if (Parent is TabPage tabPage)
- {
- if (tabPage.Parent is CustomTabControl customTabControl)
- {
- e.Graphics.Clear(customTabControl.BackColor);
- }
- else if (tabPage.Parent is TabControl tabControl)
- {
- e.Graphics.Clear(tabControl.BackColor);
- }
- }
- }
- else
- e.Graphics.Clear(backColor);
-
-
- if (AutoSize)
- Size = e.Graphics.MeasureString(Text, Font).ToSize();
-
- Rectangle rect = new(0, 0, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
-
- // Paint Label Background
- using SolidBrush sbBG = new(backColor);
- e.Graphics.FillRoundedRectangle(sbBG, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
-
- // Paint Image
- if (Image != null)
- {
- Rectangle rectImage = new(0, 0, Image.Width, Image.Height);
- int pad = 2;
- int top = rect.Y + pad;
- int bottom = rect.Y + (rect.Height - rectImage.Height) - pad;
- int left = rect.X + pad;
- int right = rect.X + (rect.Width - rectImage.Width) - pad;
- int centerX = rect.X + ((rect.Width - rectImage.Width) / 2);
- int centerY = rect.Y + ((rect.Height - rectImage.Height) / 2);
- if (RightToLeft == RightToLeft.No)
- {
- if (ImageAlign == ContentAlignment.BottomCenter)
- rectImage.Location = new(centerX, bottom);
- else if (ImageAlign == ContentAlignment.BottomLeft)
- rectImage.Location = new(left, bottom);
- else if (ImageAlign == ContentAlignment.BottomRight)
- rectImage.Location = new(right, bottom);
- else if (ImageAlign == ContentAlignment.MiddleCenter)
- rectImage.Location = new(centerX, centerY);
- else if (ImageAlign == ContentAlignment.MiddleLeft)
- rectImage.Location = new(left, centerY);
- else if (ImageAlign == ContentAlignment.MiddleRight)
- rectImage.Location = new(right, centerY);
- else if (ImageAlign == ContentAlignment.TopCenter)
- rectImage.Location = new(centerX, top);
- else if (ImageAlign == ContentAlignment.TopLeft)
- rectImage.Location = new(left, top);
- else if (ImageAlign == ContentAlignment.TopRight)
- rectImage.Location = new(right, top);
- else
- rectImage.Location = new(centerX, centerY);
- }
- else
- {
- if (ImageAlign == ContentAlignment.BottomCenter)
- rectImage.Location = new(centerX, bottom);
- else if (ImageAlign == ContentAlignment.BottomLeft)
- rectImage.Location = new(right, bottom);
- else if (ImageAlign == ContentAlignment.BottomRight)
- rectImage.Location = new(left, bottom);
- else if (ImageAlign == ContentAlignment.MiddleCenter)
- rectImage.Location = new(centerX, centerY);
- else if (ImageAlign == ContentAlignment.MiddleLeft)
- rectImage.Location = new(right, centerY);
- else if (ImageAlign == ContentAlignment.MiddleRight)
- rectImage.Location = new(left, centerY);
- else if (ImageAlign == ContentAlignment.TopCenter)
- rectImage.Location = new(centerX, top);
- else if (ImageAlign == ContentAlignment.TopLeft)
- rectImage.Location = new(right, top);
- else if (ImageAlign == ContentAlignment.TopRight)
- rectImage.Location = new(left, top);
- else
- rectImage.Location = new(centerX, centerY);
- }
-
- e.Graphics.DrawImage(Image, rectImage);
- }
-
- // Paint Label Text
- TextFormatFlags flags;
-
- if (RightToLeft == RightToLeft.No)
- {
- if (TextAlign == ContentAlignment.BottomCenter)
- flags = TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.BottomLeft)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.BottomRight)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.MiddleCenter)
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
- else if (TextAlign == ContentAlignment.MiddleLeft)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.MiddleRight)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.TopCenter)
- flags = TextFormatFlags.Top | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.TopLeft)
- flags = TextFormatFlags.Top | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.TopRight)
- flags = TextFormatFlags.Top | TextFormatFlags.Right;
- else
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
- }
- else
- {
- if (TextAlign == ContentAlignment.BottomCenter)
- flags = TextFormatFlags.Bottom | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.BottomLeft)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.BottomRight)
- flags = TextFormatFlags.Bottom | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.MiddleCenter)
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
- else if (TextAlign == ContentAlignment.MiddleLeft)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.MiddleRight)
- flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Left;
- else if (TextAlign == ContentAlignment.TopCenter)
- flags = TextFormatFlags.Top | TextFormatFlags.HorizontalCenter;
- else if (TextAlign == ContentAlignment.TopLeft)
- flags = TextFormatFlags.Top | TextFormatFlags.Right;
- else if (TextAlign == ContentAlignment.TopRight)
- flags = TextFormatFlags.Top | TextFormatFlags.Left;
- else
- flags = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter;
-
- flags |= TextFormatFlags.RightToLeft;
- }
-
- TextRenderer.DrawText(e.Graphics, Text, Font, rect, foreColor, flags);
-
- // Paint Label Border
- using Pen penB = new(borderColor);
- using Pen penNB = new(backColor);
- if (Border)
- e.Graphics.DrawRoundedRectangle(penB, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- else if (!Border)
- e.Graphics.DrawRoundedRectangle(penNB, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- Color backColor = BackColor;
- if (Parent != null)
- {
- if (Parent.BackColor != Color.Transparent)
- {
- if (Parent.Enabled)
- backColor = Parent.BackColor;
- else
- backColor = GetDisabledColor(Parent.BackColor);
- }
- else
- {
- if (FindForm() != null)
- {
- if (Parent.Enabled)
- backColor = FindForm().BackColor;
- else
- backColor = GetDisabledColor(FindForm().BackColor);
- }
- }
- }
- return backColor;
- }
-
- static Color GetDisabledColor(Color color)
- {
- if (color.DarkOrLight() == "Dark")
- return color.ChangeBrightness(0.3f);
- else
- return color.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomMenuStrip.cs b/MsmhTools/CustomControls/CustomMenuStrip.cs
deleted file mode 100644
index 931d158..0000000
--- a/MsmhTools/CustomControls/CustomMenuStrip.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 20, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomMenuStrip : MenuStrip
- {
- private readonly CustomToolStripRenderer MyRenderer = new();
-
- private bool mBorder = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border")]
- public bool Border
- {
- get { return mBorder; }
- set
- {
- if (mBorder != value)
- {
- mBorder = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- BorderColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- SelectionColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- private bool mSameColorForSubItems = true;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Same Color For Sub Items")]
- public bool SameColorForSubItems
- {
- get { return mSameColorForSubItems; }
- set
- {
- if (mSameColorForSubItems != value)
- {
- mSameColorForSubItems = value;
- SameColorForSubItemsChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Action"), Description("Same Color For Sub Items Changed Event")]
- public event EventHandler? SameColorForSubItemsChanged;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Border Color Changed Event")]
- public event EventHandler? BorderColorChanged;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Selection Color Changed Event")]
- public event EventHandler? SelectionColorChanged;
-
- public CustomMenuStrip() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- MyRenderer.BackColor = GetBackColor();
- MyRenderer.ForeColor = GetForeColor();
- MyRenderer.BorderColor = GetBorderColor();
- MyRenderer.SelectionColor = SelectionColor;
- Renderer = MyRenderer;
-
- BackColorChanged += CustomMenuStrip_BackColorChanged;
- ForeColorChanged += CustomMenuStrip_ForeColorChanged;
- BorderColorChanged += CustomMenuStrip_BorderColorChanged;
- SelectionColorChanged += CustomMenuStrip_SelectionColorChanged;
- SameColorForSubItemsChanged += CustomMenuStrip_SameColorForSubItemsChanged;
- ItemAdded += CustomMenuStrip_ItemAdded;
- Paint += CustomMenuStrip_Paint;
-
- var timer = new System.Windows.Forms.Timer();
- timer.Interval = 500;
- timer.Tick += (s, e) =>
- {
- if (SameColorForSubItems)
- ColorForSubItems();
- };
- timer.Start();
- }
-
- private void ColorForSubItems()
- {
- for (int a = 0; a < Items.Count; a++)
- {
- ToolStripItem toolStripItem = Items[a];
- var toolStripItems = Controllers.GetAllToolStripItems(toolStripItem);
- for (int b = 0; b < toolStripItems.Count(); b++)
- {
- ToolStripItem? tsi = toolStripItems.ToList()[b];
- if (tsi is ToolStripMenuItem)
- {
- if (tsi is ToolStripMenuItem tsmi)
- {
- tsmi.BackColor = GetBackColor();
- tsmi.ForeColor = GetForeColor();
- }
- }
- else if (tsi is ToolStripSeparator)
- {
- if (tsi is ToolStripSeparator tss)
- {
- tss.BackColor = GetBackColor();
- tss.ForeColor = BorderColor;
- }
- }
- }
- }
-
- }
-
- private void CustomMenuStrip_BackColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BackColor = GetBackColor();
- Invalidate();
- }
-
- private void CustomMenuStrip_ForeColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.ForeColor = GetForeColor();
- Invalidate();
- }
-
- private void CustomMenuStrip_BorderColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BorderColor = GetBorderColor();
- Invalidate();
- }
-
- private void CustomMenuStrip_SelectionColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.SelectionColor = SelectionColor;
- Invalidate();
- }
-
- private void CustomMenuStrip_SameColorForSubItemsChanged(object? sender, EventArgs e)
- {
- if (SameColorForSubItems)
- ColorForSubItems();
- }
-
- private void CustomMenuStrip_ItemAdded(object? sender, ToolStripItemEventArgs e)
- {
- if (SameColorForSubItems)
- ColorForSubItems();
- Invalidate();
- }
-
- private void CustomMenuStrip_Paint(object? sender, PaintEventArgs e)
- {
- if (Border)
- {
- Color borderColor = GetBorderColor();
- ControlPaint.DrawBorder(e.Graphics, ClientRectangle, borderColor, ButtonBorderStyle.Solid);
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.2f);
- else
- return BackColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomMessageBox.cs b/MsmhTools/CustomControls/CustomMessageBox.cs
deleted file mode 100644
index cee6aef..0000000
--- a/MsmhTools/CustomControls/CustomMessageBox.cs
+++ /dev/null
@@ -1,578 +0,0 @@
-using MsmhTools;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-/*
- * Copyright MSasanMH, April 14, 2022.
- * Needs CustomButton.
- */
-
-namespace CustomControls
-{
- public class CustomMessageBox : Form
- {
- // Make CustomMessageBox movable.
- private const int WM_NCLBUTTONDOWN = 0xA1;
- private const int HT_CAPTION = 0x2;
- [DllImport("user32.dll")]
- private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
- [DllImport("user32.dll")]
- private static extern bool ReleaseCapture();
-
- static DialogResult dialogResult;
- public static Form? SetParent { get; set; }
- public new static Color BackColor { get; set; }
- public new static Color ForeColor { get; set; }
- public static Color BorderColor { get; set; }
-
- private static int ImageBox(int iconOffset, Icon icon, Panel textPanel)
- {
- PictureBox pb = new();
- pb.Image = icon.ToBitmap();
- pb.Size = icon.Size;
- pb.Location = new(iconOffset, textPanel.Height / 2 - pb.Height / 2);
- textPanel.Controls.Add(pb);
- return pb.Height;
- }
- public CustomMessageBox(string text, string? caption, MessageBoxButtons? buttons, MessageBoxIcon? icon) : base()
- {
- FormBorderStyle = FormBorderStyle.None;
- ShowInTaskbar = true;
- TopMost = true;
-
- int iconOffset = 5;
- int buttonOffset = 5;
- int testLabelOffset = iconOffset;
- Rectangle screen = Screen.FromControl(this).Bounds;
-
- // Box Size (Auto)
- ////// Box Width
- AutoSize = false;
- int maxWidth = 400;
- int minWidth = 140; // Shouldn't be smaller than 140.
- Size computeSize = TextRenderer.MeasureText(text, DefaultFont);
- int mWidth = computeSize.Width + 30;
- int iconWidth = 32;
- if (icon != null && icon != MessageBoxIcon.None)
- {
- mWidth += iconWidth + iconOffset;
- testLabelOffset = iconWidth - iconOffset * 2;
- }
- int buttonWidth = 75;
- if (buttons == null || buttons == MessageBoxButtons.OK)
- {
- int previousWidth = mWidth;
- mWidth = buttonWidth + buttonOffset * 2;
- mWidth = Math.Max(previousWidth, mWidth);
- mWidth += buttonOffset;
- }
- else if (buttons == MessageBoxButtons.OKCancel || buttons == MessageBoxButtons.YesNo || buttons == MessageBoxButtons.RetryCancel)
- {
- int previousWidth = mWidth;
- mWidth = buttonWidth * 2 + buttonOffset * 3;
- mWidth = Math.Max(previousWidth, mWidth);
- mWidth += buttonOffset;
- }
- else if (buttons == MessageBoxButtons.AbortRetryIgnore || buttons == MessageBoxButtons.YesNoCancel || buttons == MessageBoxButtons.CancelTryContinue)
- {
- int previousWidth = mWidth;
- mWidth = buttonWidth * 3 + buttonOffset * 4;
- mWidth = Math.Max(previousWidth, mWidth);
- mWidth += buttonOffset;
- }
- mWidth = Math.Min(maxWidth, mWidth);
- mWidth = Math.Max(minWidth, mWidth);
-
- ////// Box Height
- int minHeight = 130;
- int maxHeight = screen.Height - 50;
- Label testLabel = new();
- testLabel.AutoSize = true;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabel.TextAlign = ContentAlignment.MiddleLeft;
- testLabel.Text = text;
- Size testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- int mHeight = testLabelSize.Height + 100;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- mHeight = testLabelSize.Height + 100;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- mHeight = testLabelSize.Height + 100;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- mHeight = testLabelSize.Height + 100;
- mHeight = Math.Max(minHeight, mHeight);
- if (mHeight > maxHeight)
- {
- mWidth += maxWidth;
- testLabel.MaximumSize = new Size(mWidth - 2 - testLabelOffset, 0);
- testLabelSize = testLabel.GetPreferredSize(Size.Empty);
- mHeight = testLabelSize.Height + 100;
- mHeight = Math.Max(minHeight, mHeight);
- if (mWidth > screen.Width)
- {
- mWidth = screen.Width;
- mHeight = maxHeight;
- }
- }
- }
- }
- }
- Size = new(mWidth, mHeight);
-
- // Rectangle
- Rectangle rect = new(ClientRectangle.X + 1, ClientRectangle.Y + 1, ClientRectangle.Width - 2, ClientRectangle.Height - 2);
- int buttonPanelHeight = 30;
- int titlePanelHeight = 25;
- Paint += CustomMessageBox_Paint;
- MouseDown += CustomMessageBox_MouseDown;
- Move += CustomMessageBox_Move;
-
- // Title (Caption)
- if (caption != null)
- {
- Label titleLabel = new();
- titleLabel.AutoSize = true;
- titleLabel.TextAlign = ContentAlignment.MiddleLeft;
- titleLabel.Text = caption;
- titleLabel.BackColor = BackColor;
- titleLabel.ForeColor = ForeColor;
- titleLabel.Location = new(2, rect.Y + titlePanelHeight / 2 - titleLabel.GetPreferredSize(Size.Empty).Height / 2);
- Controls.Add(titleLabel);
- }
-
- // Text Body
- Panel textPanel = new();
- textPanel.BackColor = BackColor;
- textPanel.ForeColor = ForeColor;
- textPanel.BorderStyle = BorderStyle.None;
- textPanel.Margin = new Padding(0);
- textPanel.Location = new(rect.X, titlePanelHeight);
- textPanel.Size = new(rect.Width, rect.Height - titlePanelHeight - buttonPanelHeight);
- textPanel.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
- Controls.Add(textPanel);
-
- // Enum MessageBoxIcon
- if (icon != null)
- {
- iconOffset = 5;
- if (icon == MessageBoxIcon.Asterisk)
- {
- Icon ic = new(SystemIcons.Asterisk, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Error)
- {
- Icon ic = new(SystemIcons.Error, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Exclamation)
- {
- Icon ic = new(SystemIcons.Exclamation, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Hand)
- {
- Icon ic = new(SystemIcons.Hand, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Information)
- {
- Icon ic = new(SystemIcons.Information, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.None)
- {
- // Do Nothing
- }
- else if (icon == MessageBoxIcon.Question)
- {
- Icon ic = new(SystemIcons.Question, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Stop)
- {
- Icon ic = new(SystemIcons.Error, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- else if (icon == MessageBoxIcon.Warning)
- {
- Icon ic = new(SystemIcons.Warning, 32, 32);
- int pbWidth = ImageBox(iconOffset, ic, textPanel);
- iconOffset = iconOffset + pbWidth + iconOffset;
- }
- }
-
- Label textLabel = new();
- textLabel.AutoSize = true;
- textLabel.MaximumSize = new Size(rect.Width - iconOffset, 0);
- textLabel.TextAlign = ContentAlignment.MiddleLeft;
- textLabel.Text = text;
- Size textLabelSize = textLabel.GetPreferredSize(Size.Empty);
- textLabel.Location = new(iconOffset, textPanel.Height / 2 - textLabelSize.Height / 2);
- textPanel.Controls.Add(textLabel);
-
- // Button
- Panel buttonPanel = new();
- buttonPanel.BackColor = BackColor.ChangeBrightness(-0.2f);
- buttonPanel.ForeColor = ForeColor;
- buttonPanel.BorderStyle = BorderStyle.None;
- buttonPanel.Margin = new Padding(0);
- buttonPanel.Location = new(rect.X, Height - buttonPanelHeight - 1); // 1 is bottom border
- buttonPanel.Size = new(rect.Width, buttonPanelHeight);
- buttonPanel.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
- Controls.Add(buttonPanel);
-
- // Enum DialogResult
- if (buttons == null)
- buttons = MessageBoxButtons.OK;
- if (buttons == MessageBoxButtons.AbortRetryIgnore)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
- CustomButton btn3 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Abort";
- btn1.DialogResult = DialogResult.Abort;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Abort;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Retry";
- btn2.DialogResult = DialogResult.Retry;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Retry;
- };
- buttonPanel.Controls.Add(btn2);
-
- btn3.Location = new(rect.Width - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn3.Height / 2);
- btn3.Text = "Ignore";
- btn3.DialogResult = DialogResult.Ignore;
- btn3.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Ignore;
- };
- buttonPanel.Controls.Add(btn3);
-
- AcceptButton = btn2;
- CancelButton = btn1;
- }
- else if (buttons == MessageBoxButtons.CancelTryContinue)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
- CustomButton btn3 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Cancel";
- btn1.DialogResult = DialogResult.Cancel;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Try Again";
- btn2.DialogResult = DialogResult.TryAgain;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.TryAgain;
- };
- buttonPanel.Controls.Add(btn2);
-
- btn3.Location = new(rect.Width - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn3.Height / 2);
- btn3.Text = "Continue";
- btn3.DialogResult = DialogResult.Continue;
- btn3.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Continue;
- };
- buttonPanel.Controls.Add(btn3);
-
- AcceptButton = btn2;
- CancelButton = btn1;
- }
- else if (buttons == MessageBoxButtons.OK)
- {
- CustomButton btn1 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "OK";
- btn1.DialogResult = DialogResult.OK;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.OK;
- };
- buttonPanel.Controls.Add(btn1);
-
- AcceptButton = btn1;
- }
- else if (buttons == MessageBoxButtons.OKCancel)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "OK";
- btn1.DialogResult = DialogResult.OK;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.OK;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Cancel";
- btn2.DialogResult = DialogResult.Cancel;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn2);
-
- AcceptButton = btn1;
- CancelButton = btn2;
- }
- else if (buttons == MessageBoxButtons.RetryCancel)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Retry";
- btn1.DialogResult = DialogResult.Retry;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Retry;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "Cancel";
- btn2.DialogResult = DialogResult.Cancel;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn2);
-
- AcceptButton = btn1;
- CancelButton = btn2;
- }
- else if (buttons == MessageBoxButtons.YesNo)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Yes";
- btn1.DialogResult = DialogResult.Yes;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Yes;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "No";
- btn2.DialogResult = DialogResult.No;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.No;
- };
- buttonPanel.Controls.Add(btn2);
-
- AcceptButton = btn1;
- CancelButton = btn2;
- }
- else if (buttons == MessageBoxButtons.YesNoCancel)
- {
- CustomButton btn1 = new();
- CustomButton btn2 = new();
- CustomButton btn3 = new();
-
- btn1.Location = new(rect.Width - btn1.Width - buttonOffset - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn1.Height / 2);
- btn1.Text = "Yes";
- btn1.DialogResult = DialogResult.Yes;
- btn1.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Yes;
- };
- buttonPanel.Controls.Add(btn1);
-
- btn2.Location = new(rect.Width - btn2.Width - buttonOffset - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn2.Height / 2);
- btn2.Text = "No";
- btn2.DialogResult = DialogResult.No;
- btn2.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.No;
- };
- buttonPanel.Controls.Add(btn2);
-
- btn3.Location = new(rect.Width - btn3.Width - buttonOffset, buttonPanel.Height / 2 - btn3.Height / 2);
- btn3.Text = "Cancel";
- btn3.DialogResult = DialogResult.Cancel;
- btn3.Click += (object? sender, EventArgs e) =>
- {
- dialogResult = DialogResult.Cancel;
- };
- buttonPanel.Controls.Add(btn3);
-
- AcceptButton = btn1;
- CancelButton = btn3;
- }
-
- // Workaround CenterParent
- if (SetParent != null)
- {
- int x = SetParent.Location.X + (SetParent.Width / 2) - (Width / 2);
- int y = SetParent.Location.Y + (SetParent.Height / 2) - (Height / 2);
- if (x > 0 && y > 0)
- {
- StartPosition = FormStartPosition.Manual;
- Location = new Point(x, y);
- Debug.WriteLine(SetParent.Location.X + SetParent.Width / 2);
- Debug.WriteLine("X: " + x + " Y: " + y);
- }
- else
- {
- StartPosition = FormStartPosition.CenterScreen;
- }
- }
- else
- {
- StartPosition = FormStartPosition.CenterScreen;
- }
-
- // Set CustomButton Colors
- var cs = Controllers.GetAllControls(this);
- foreach (Control c in cs)
- if (c is CustomButton customButton)
- {
- customButton.BackColor = BackColor;
- customButton.ForeColor = ForeColor;
- customButton.BorderColor = BorderColor;
- customButton.SelectionColor = BorderColor;
- customButton.Invalidate();
- }
-
- BringToFront();
- }
-
- /// Displays a message box with specified text.
- ///
- /// The text to display in the message box.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(string text)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomMessageBox form = new(text, null, null, null);
- form.ShowDialog();
- return dialogResult;
- }
-
- /// Displays a message box with specified text.
- ///
- /// The text to display in the message box.
- /// The text to display in the title bar of the message box.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(string text, string caption)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomMessageBox form = new(text, caption, null, null);
- form.ShowDialog();
- return dialogResult;
- }
-
- /// Displays a message box with specified text.
- ///
- /// The text to display in the message box.
- /// The text to display in the title bar of the message box.
- /// One of the System.Windows.Forms.MessageBoxButtons values that specifies which buttons to display in the message box.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomMessageBox form = new(text, caption, buttons, null);
- form.ShowDialog();
- return dialogResult;
- }
-
- /// Displays a message box with specified text.
- ///
- /// The text to display in the message box.
- /// The text to display in the title bar of the message box.
- /// One of the System.Windows.Forms.MessageBoxButtons values that specifies which buttons to display in the message box.
- /// One of the System.Windows.Forms.MessageBoxIcon values that specifies which icon to display in the message box.
- ///
- /// One of the System.Windows.Forms.DialogResult values.
- public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
- {
- // using construct ensures the resources are freed when form is closed.
- using CustomMessageBox form = new(text, caption, buttons, icon);
- form.ShowDialog();
- return dialogResult;
- }
-
- private void CustomMessageBox_Paint(object? sender, PaintEventArgs e)
- {
- Rectangle rect = new(e.ClipRectangle.X, e.ClipRectangle.Y, e.ClipRectangle.Width - 1, e.ClipRectangle.Height - 1);
- Graphics g = e.Graphics;
-
- // Fill BackColor (Static)
- using SolidBrush sb = new(BackColor);
- g.FillRectangle(sb, rect);
-
- // Draw Border
- using Pen pen = new(BorderColor);
- g.DrawRectangle(pen, rect);
- }
-
- private void CustomMessageBox_MouseDown(object? sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- ReleaseCapture();
- _ = SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
- Invalidate();
- }
- }
-
- private void CustomMessageBox_Move(object? sender, EventArgs e)
- {
- Invalidate();
- var cs = Controllers.GetAllControls(this);
- foreach (Control c in cs)
- c.Invalidate();
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomMessageBox.resx b/MsmhTools/CustomControls/CustomMessageBox.resx
deleted file mode 100644
index 1af7de1..0000000
--- a/MsmhTools/CustomControls/CustomMessageBox.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/MsmhTools/CustomControls/CustomNumericUpDown.cs b/MsmhTools/CustomControls/CustomNumericUpDown.cs
deleted file mode 100644
index 2bea17e..0000000
--- a/MsmhTools/CustomControls/CustomNumericUpDown.cs
+++ /dev/null
@@ -1,361 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing.Drawing2D;
-using System.Text;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 02, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomNumericUpDown : NumericUpDown
- {
- protected override CreateParams CreateParams // Fixes Flickers
- {
- get
- {
- CreateParams cp = base.CreateParams;
- cp.ExStyle |= 0x02000000; // WS_EX_COMPOSITED
- return cp;
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private Color? enabledBackColor;
- private bool enabledBackColorBool = true;
- private bool once = true;
-
- public CustomNumericUpDown() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- // Default Back Color
- BackColor = Color.DimGray;
- if (Enabled)
- enabledBackColor = BackColor;
-
- // Default BorderStyle
- BorderStyle = BorderStyle.FixedSingle;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomNumericUpDown_HandleCreated;
- LocationChanged += CustomNumericUpDown_LocationChanged;
- Move += CustomNumericUpDown_Move;
- EnabledChanged += CustomNumericUpDown_EnabledChanged;
- ForeColorChanged += CustomNumericUpDown_ForeColorChanged;
- Invalidated += CustomNumericUpDown_Invalidated;
-
- Control UpDown = Controls[0];
- UpDown.Paint += UpDown_Paint;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomNumericUpDown_HandleCreated(object? sender, EventArgs e)
- {
- if (Enabled)
- enabledBackColor = BackColor;
- Invalidate();
- }
-
- private void CustomNumericUpDown_LocationChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomNumericUpDown_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomNumericUpDown_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomNumericUpDown_ForeColorChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomNumericUpDown_Invalidated(object? sender, InvalidateEventArgs e)
- {
- InvalidateSubControls();
- }
-
- private void InvalidateSubControls()
- {
- for (int n = 0; n < Controls.Count; n++)
- {
- Control c = Controls[n];
- c.ForeColor = ForeColor;
- if (n == 1)
- c.BackColor = GetBackColor();
- c.Invalidate();
- }
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
-
- Rectangle rect = ClientRectangle;
- Color borderColor = GetBorderColor();
-
- if (BorderStyle == BorderStyle.FixedSingle)
- {
- ControlPaint.DrawBorder(e.Graphics, rect, borderColor, ButtonBorderStyle.Solid);
- }
- else if (BorderStyle == BorderStyle.Fixed3D)
- {
- Color secondBorderColor;
- if (borderColor.DarkOrLight() == "Dark")
- secondBorderColor = borderColor.ChangeBrightness(0.5f);
- else
- secondBorderColor = borderColor.ChangeBrightness(-0.5f);
-
- Rectangle rect3DBorder;
-
- rect3DBorder = new(rect.X, rect.Y, rect.Width, rect.Height);
- ControlPaint.DrawBorder(e.Graphics, rect3DBorder, secondBorderColor, ButtonBorderStyle.Solid);
-
- rect3DBorder = new(rect.X + 1, rect.Y + 1, rect.Width - 1, rect.Height - 1);
- ControlPaint.DrawBorder(e.Graphics, rect3DBorder, secondBorderColor, ButtonBorderStyle.Solid);
-
- rect3DBorder = new(rect.X, rect.Y, rect.Width - 1, rect.Height - 1);
- ControlPaint.DrawBorder(e.Graphics, rect3DBorder, borderColor, ButtonBorderStyle.Solid);
- }
-
- }
-
- private void UpDown_Paint(object? sender, PaintEventArgs e)
- {
- Control UpDown = sender as Control;
-
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
-
- // UpDown Rectangle
- Rectangle rectUpDown = UpDown.ClientRectangle;
-
- // Up Rectangle
- Rectangle rectUp = new(0, 0, rectUpDown.Width, rectUpDown.Height / 2);
-
- // Down Rectangle
- Rectangle rectDown = new(0, rectUpDown.Height / 2, rectUpDown.Width, rectUpDown.Height / 2 + 1);
-
- // Mouse Position
- Point mP = UpDown.PointToClient(MousePosition);
-
- // Paint UpDown Background
- e.Graphics.Clear(backColor.ChangeBrightness(-0.3f));
-
- // Paint UpDown Border
- using Pen arrowButtonsBorderPen = new(borderColor);
- Point[] arrowButtonsBorderPointsRight = new[]
- {
- new Point(0, 0),
- new Point(0, rectUpDown.Height),
- new Point(0, rectUpDown.Height / 2),
- new Point(rectUpDown.Width, rectUpDown.Height / 2)
- };
- Point[] arrowButtonsBorderPointsLeft = new[]
- {
- new Point(rectUpDown.Width - 1, 0),
- new Point(rectUpDown.Width - 1, rectUpDown.Height),
- new Point(rectUpDown.Width - 1, rectUpDown.Height / 2),
- new Point(0, rectUpDown.Height / 2)
- };
- if (BorderStyle != BorderStyle.None)
- {
- if (RightToLeft == RightToLeft.No && UpDownAlign == LeftRightAlignment.Right ||
- RightToLeft == RightToLeft.Yes && UpDownAlign == LeftRightAlignment.Left)
- {
- e.Graphics.DrawLines(arrowButtonsBorderPen, arrowButtonsBorderPointsRight);
- }
- else
- e.Graphics.DrawLines(arrowButtonsBorderPen, arrowButtonsBorderPointsLeft);
- }
-
- // MouseOver Background and Border
- if (Enabled && rectUpDown.Contains(mP))
- {
- // Paint UpDown Background Hover
- Color hoverColor = backColor.DarkOrLight() == "Dark" ? backColor.ChangeBrightness(0.3f) : backColor.ChangeBrightness(-0.3f);
- using SolidBrush sb = new(hoverColor);
- if (rectUp.Contains(mP))
- e.Graphics.FillRectangle(sb, rectUp);
- else
- e.Graphics.FillRectangle(sb, rectDown);
-
- // Paint UpDown Border
- if (BorderStyle != BorderStyle.None)
- {
- if (RightToLeft == RightToLeft.No && UpDownAlign == LeftRightAlignment.Right ||
- RightToLeft == RightToLeft.Yes && UpDownAlign == LeftRightAlignment.Left)
- {
- e.Graphics.DrawLines(arrowButtonsBorderPen, arrowButtonsBorderPointsRight);
- }
- else
- e.Graphics.DrawLines(arrowButtonsBorderPen, arrowButtonsBorderPointsLeft);
- }
- }
-
- // Paint Arrows
- using SolidBrush arrowBrush = new(foreColor);
-
- // UpArrow Points
- Point upArrowCenter;
- if (RightToLeft == RightToLeft.No && UpDownAlign == LeftRightAlignment.Right ||
- RightToLeft == RightToLeft.Yes && UpDownAlign == LeftRightAlignment.Left)
- {
- upArrowCenter = new(rectUp.Left + rectUp.Width / 2, rectUp.Top + rectUp.Height / 2);
- }
- else
- upArrowCenter = new((rectUp.Left + rectUp.Width / 2) - 1, rectUp.Top + rectUp.Height / 2);
- Point[] upArrowPoints = new Point[]
- {
- new Point(upArrowCenter.X - 4, upArrowCenter.Y + 2), // Bottom Left
- new Point(upArrowCenter.X + 4, upArrowCenter.Y + 2), // Bottom Right
- new Point(upArrowCenter.X, upArrowCenter.Y - 3) // Top
- };
-
- // DownArrow Points
- Point downArrowCenter;
- if (RightToLeft == RightToLeft.No && UpDownAlign == LeftRightAlignment.Right ||
- RightToLeft == RightToLeft.Yes && UpDownAlign == LeftRightAlignment.Left)
- {
- downArrowCenter = new Point(rectDown.Left + rectDown.Width / 2, rectDown.Top + rectDown.Height / 2);
- }
- else
- downArrowCenter = new Point((rectDown.Left + rectDown.Width / 2) - 1, rectDown.Top + rectDown.Height / 2);
- Point[] downArrowPoints = new Point[]
- {
- new Point(downArrowCenter.X - 3, downArrowCenter.Y - 1), // Top Left
- new Point(downArrowCenter.X + 4, downArrowCenter.Y - 1), // Top Right
- new Point(downArrowCenter.X, downArrowCenter.Y + 3) // Bottom
- };
-
- // Paint UpArrow
- e.Graphics.FillPolygon(arrowBrush, upArrowPoints);
-
- // Paint DownArrow
- e.Graphics.FillPolygon(arrowBrush, downArrowPoints);
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- {
- if (enabledBackColor != null)
- return (Color)(!enabledBackColorBool ? enabledBackColor : BackColor);
- else
- return BackColor;
- }
- else
- {
- if (enabledBackColorBool)
- {
- enabledBackColor = BackColor;
- enabledBackColorBool = false;
- }
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomPanel.cs b/MsmhTools/CustomControls/CustomPanel.cs
deleted file mode 100644
index e6416be..0000000
--- a/MsmhTools/CustomControls/CustomPanel.cs
+++ /dev/null
@@ -1,495 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, May 16, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomPanel : Panel
- {
- private static class Methods
- {
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- private extern static int SetWindowTheme(IntPtr controlHandle, string appName, string? idList);
- internal static void SetDarkControl(Control control)
- {
- _ = SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
- foreach (Control c in control.Controls)
- {
- _ = SetWindowTheme(c.Handle, "DarkMode_Explorer", null);
- }
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new BorderStyle BorderStyle { get; set; }
-
- private BorderStyle mBorder = BorderStyle.FixedSingle;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border Style")]
- public BorderStyle Border
- {
- get { return mBorder; }
- set
- {
- mBorder = value;
- Invalidate();
- }
- }
-
- private ButtonBorderStyle mButtonBorderStyle = ButtonBorderStyle.Solid;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Button Border Style")]
- public ButtonBorderStyle ButtonBorderStyle
- {
- get { return mButtonBorderStyle; }
- set
- {
- if (mButtonBorderStyle != value)
- {
- mButtonBorderStyle = value;
- Invalidate();
- }
- }
- }
-
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public override Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Red;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool ApplicationIdle = false;
- private bool once = true;
-
- private readonly Panel innerPanel = new();
-
- // Events Action
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Action"), Description("Click")]
- public new event EventHandler? Click;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Action"), Description("Double Click")]
- public new event EventHandler? DoubleClick;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Action"), Description("Mouse Click")]
- public new event MouseEventHandler? MouseClick;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Action"), Description("Mouse Double Click")]
- public new event MouseEventHandler? MouseDoubleClick;
-
- // Events Focus
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Focus"), Description("Enter")]
- public new event EventHandler? Enter;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Focus"), Description("Leave")]
- public new event EventHandler? Leave;
-
- // Events Mouse
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Mouse"), Description("Mouse Down")]
- public new event MouseEventHandler? MouseDown;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Mouse"), Description("Mouse Enter")]
- public new event EventHandler? MouseEnter;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Mouse"), Description("Mouse Hover")]
- public new event EventHandler? MouseHover;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Mouse"), Description("Mouse Leave")]
- public new event EventHandler? MouseLeave;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Mouse"), Description("Mouse Move")]
- public new event MouseEventHandler? MouseMove;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Mouse"), Description("Mouse Up")]
- public new event MouseEventHandler? MouseUp;
-
- public CustomPanel() : base()
- {
- SetStyle(ControlStyles.DoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.OptimizedDoubleBuffer, false); // Fixes Flickers
-
- BorderStyle = BorderStyle.None;
- ButtonBorderStyle = ButtonBorderStyle.Solid;
-
- // Events Action
- innerPanel.Click += (object? sender, EventArgs e) => { Click?.Invoke(sender, e); };
- innerPanel.DoubleClick += (object? sender, EventArgs e) => { DoubleClick?.Invoke(sender, e); };
- innerPanel.MouseClick += (object? sender, MouseEventArgs e) => { MouseClick?.Invoke(sender, e); };
- innerPanel.MouseDoubleClick += (object? sender, MouseEventArgs e) => { MouseDoubleClick?.Invoke(sender, e); };
-
- // Events Focus
- innerPanel.Enter += (object? sender, EventArgs e) => { Enter?.Invoke(sender, e); };
- innerPanel.Leave += (object? sender, EventArgs e) => { Leave?.Invoke(sender, e); };
-
- // Events Mouse
- innerPanel.MouseDown += (object? sender, MouseEventArgs e) => { MouseDown?.Invoke(sender, e); };
- innerPanel.MouseEnter += (object? sender, EventArgs e) => { MouseEnter?.Invoke(sender, e); };
- innerPanel.MouseHover += (object? sender, EventArgs e) => { MouseHover?.Invoke(sender, e); };
- innerPanel.MouseLeave += (object? sender, EventArgs e) => { MouseLeave?.Invoke(sender, e); };
- innerPanel.MouseMove += (object? sender, MouseEventArgs e) => { MouseMove?.Invoke(sender, e); };
- innerPanel.MouseUp += (object? sender, MouseEventArgs e) => { MouseUp?.Invoke(sender, e); };
-
- Controls.Add(innerPanel);
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomPanel_HandleCreated;
- Paint += CustomPanel_Paint;
- BackgroundImageChanged += CustomPanel_BackgroundImageChanged;
- EnabledChanged += CustomPanel_EnabledChanged;
- Invalidated += CustomPanel_Invalidated;
- ControlAdded += CustomPanel_ControlAdded;
- ControlRemoved += CustomPanel_ControlRemoved;
- Enter += CustomPanel_Enter;
- MouseDown += CustomPanel_MouseDown;
- MouseEnter += CustomPanel_MouseEnter;
- MouseLeave += CustomPanel_MouseLeave;
- MouseWheel += CustomPanel_MouseWheel;
- ParentChanged += CustomPanel_ParentChanged;
- Resize += CustomPanel_Resize;
- Scroll += CustomPanel_Scroll;
- SizeChanged += CustomPanel_SizeChanged;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomPanel_HandleCreated(object? sender, EventArgs e)
- {
- foreach (Control c in Controls)
- {
- if (c is not Panel)
- c.BringToFront();
- foreach (Control c2 in c.Controls)
- {
- if (c2 is not Panel)
- c2.BringToFront();
- }
- }
-
- // Timer is needed in some rare cases.
- var p = sender as Panel;
- int totalTime = 500;
- int elapsedTime = 0;
- var t = new System.Windows.Forms.Timer();
- t.Interval = 100;
- t.Tick += (s, e) =>
- {
- p.Invalidate();
- elapsedTime += t.Interval;
- if (elapsedTime > totalTime)
- t.Stop();
- };
- t.Start();
- }
-
- private void CustomPanel_Paint(object? sender, PaintEventArgs e)
- {
- if (ApplicationIdle == false)
- return;
-
- Rectangle rect = new(0, 0, ClientRectangle.Width, ClientRectangle.Height);
-
- if (sender is Panel)
- {
- if (DesignMode)
- BorderStyle = BorderStyle.FixedSingle;
- else
- BorderStyle = BorderStyle.None;
-
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
-
- ForeColor = foreColor;
- innerPanel.BackColor = backColor;
- innerPanel.ForeColor = foreColor;
-
- // Fill Background
- e.Graphics.Clear(backColor);
-
- // Draw Border
- //ControlPaint.DrawBorder(e.Graphics, rect, borderColor, ButtonBorderStyle);
-
- if (Border == BorderStyle.FixedSingle)
- ControlPaint.DrawBorder(e.Graphics, rect, borderColor, ButtonBorderStyle);
- else if (Border == BorderStyle.Fixed3D)
- {
- Color secondBorderColor;
- if (borderColor.DarkOrLight() == "Dark")
- secondBorderColor = borderColor.ChangeBrightness(0.5f);
- else
- secondBorderColor = borderColor.ChangeBrightness(-0.5f);
-
- Rectangle rect3DBorder;
-
- rect3DBorder = new(rect.X, rect.Y, rect.Width, rect.Height);
- ControlPaint.DrawBorder(e.Graphics, rect3DBorder, secondBorderColor, ButtonBorderStyle);
-
- rect3DBorder = new(rect.X + 1, rect.Y + 1, rect.Width - 1, rect.Height - 1);
- ControlPaint.DrawBorder(e.Graphics, rect3DBorder, secondBorderColor, ButtonBorderStyle);
-
- rect3DBorder = new(rect.X, rect.Y, rect.Width - 1, rect.Height - 1);
- ControlPaint.DrawBorder(e.Graphics, rect3DBorder, borderColor, ButtonBorderStyle);
- }
- }
- }
-
- private void CustomPanel_BackgroundImageChanged(object? sender, EventArgs e)
- {
- innerPanel.BackgroundImage = BackgroundImage;
- }
-
- private void CustomPanel_EnabledChanged(object? sender, EventArgs e)
- {
- var p = sender as Panel;
- if (p.Enabled)
- innerPanel.Enabled = true;
- else
- innerPanel.Enabled = false;
- p.Invalidate();
- }
-
- private void CustomPanel_Invalidated(object? sender, InvalidateEventArgs e)
- {
- var p = sender as Panel;
-
- if (!DesignMode && AutoScroll)
- {
- innerPanel.AutoScroll = true;
- AutoScroll = false;
- }
-
- innerPanel.AutoScrollMargin = p.AutoScrollMargin;
- innerPanel.AutoScrollMinSize = p.AutoScrollMinSize;
- innerPanel.AutoScrollOffset = p.AutoScrollOffset;
-
- if (Border == BorderStyle.FixedSingle)
- {
- innerPanel.Location = new(1, 1);
- innerPanel.Width = ClientRectangle.Width - 2;
- innerPanel.Height = ClientRectangle.Height - 2;
- }
- else if (Border == BorderStyle.Fixed3D)
- {
- innerPanel.Location = new(2, 2);
- innerPanel.Width = ClientRectangle.Width - 4;
- innerPanel.Height = ClientRectangle.Height - 4;
- }
- else
- {
- innerPanel.Location = new(0, 0);
- innerPanel.Width = ClientRectangle.Width;
- innerPanel.Height = ClientRectangle.Height;
- }
-
- if (BackColor.DarkOrLight() == "Dark")
- Methods.SetDarkControl(innerPanel);
-
- foreach (Control c in p.Controls)
- c.Invalidate();
- }
-
- private void CustomPanel_ControlAdded(object? sender, ControlEventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- if (!DesignMode)
- {
- p.Controls.Remove(e.Control);
- innerPanel.Controls.Add(e.Control);
- e.Control.BringToFront(); // Makes Arrow Keys Work Correctly.
- }
- }
-
- private void CustomPanel_ControlRemoved(object? sender, ControlEventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- if (!DesignMode)
- innerPanel.Controls.Remove(e.Control);
- }
-
- private void CustomPanel_Enter(object? sender, EventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_MouseDown(object? sender, MouseEventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_MouseEnter(object? sender, EventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_MouseLeave(object? sender, EventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_MouseWheel(object? sender, MouseEventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_ParentChanged(object? sender, EventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_Resize(object? sender, EventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_Scroll(object? sender, ScrollEventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private void CustomPanel_SizeChanged(object? sender, EventArgs e)
- {
- var p = sender as Panel;
- p.Invalidate();
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomProgressBar.cs b/MsmhTools/CustomControls/CustomProgressBar.cs
deleted file mode 100644
index 73ea2f6..0000000
--- a/MsmhTools/CustomControls/CustomProgressBar.cs
+++ /dev/null
@@ -1,369 +0,0 @@
-using MsmhTools;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing.Drawing2D;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, May 10, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomProgressBar : ProgressBar
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new bool? RightToLeftLayout { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new event EventHandler? RightToLeftLayoutChanged;
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private int mRoundedCorners = 0;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Rounded Corners")]
- public int RoundedCorners
- {
- get { return mRoundedCorners; }
- set
- {
- if (mRoundedCorners != value)
- {
- mRoundedCorners = value;
- Invalidate();
- }
- }
- }
-
- private Color mChunksColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Chunks Color")]
- public Color ChunksColor
- {
- get { return mChunksColor; }
- set
- {
- if (mChunksColor != value)
- {
- mChunksColor = value;
- Invalidate();
- }
- }
- }
-
- private string mCustomText = string.Empty;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Custom Text")]
- public string CustomText
- {
- get { return mCustomText; }
- set
- {
- if (mCustomText != value)
- {
- mCustomText = value;
- Invalidate();
- }
- }
- }
-
- private Font mFont = DefaultFont;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Text Font")]
- public override Font Font
- {
- get { return mFont; }
- set
- {
- if (mFont != value)
- {
- mFont = value;
- Invalidate();
- }
- }
- }
-
- public bool StopTimer { get; set; } = false;
-
- private readonly Stopwatch StopWatch = new();
- private static bool ApplicationIdle = false;
- private string ElapsedTimeString = string.Empty;
- private bool onceIV = true;
-
- public CustomProgressBar() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomProgressBar_HandleCreated;
- EnabledChanged += CustomProgressBar_EnabledChanged;
- RightToLeftChanged += CustomProgressBar_RightToLeftChanged;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (onceIV)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- onceIV = false;
- }
- }
- RightToLeftLayout = false;
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomProgressBar_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomProgressBar_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomProgressBar_RightToLeftChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- if (!ApplicationIdle)
- return;
-
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
- Color chunksColor = GetChunksColor();
- Color chunksColorGradient;
-
- if (chunksColor.DarkOrLight() == "Dark")
- chunksColorGradient = chunksColor.ChangeBrightness(0.5f);
- else
- chunksColorGradient = chunksColor.ChangeBrightness(-0.5f);
-
- //Rectangle rect = ClientRectangle;
- Rectangle rect = new(0, 0, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
- Graphics g = e.Graphics;
- // Draw horizontal bar (Background and Border) With Default System Color:
- //ProgressBarRenderer.DrawHorizontalBar(g, rect);
-
- // Draw horizontal bar (Background and Border) With Custom Color:
- // Fill Background
- using SolidBrush bgBrush = new(backColor);
- g.FillRoundedRectangle(bgBrush, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
-
- // Draw Border
- using Pen penB = new(borderColor);
- g.DrawRoundedRectangle(penB, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
-
- // Min
- if (Value == Minimum)
- {
- if (!StopWatch.IsRunning) StopWatch.Start();
- StopWatch.Restart();
- return;
- }
-
- // Padding
- if (Value > 0)
- {
- // Draw Chunks By Default Color (Green):
- //Rectangle clip = new(rect.X, rect.Y, (int)Math.Round((float)Value / Maximum * rect.Width), rect.Height);
- //ProgressBarRenderer.DrawHorizontalChunks(g, clip);
-
- // Draw Chunks By Custom Color:
- // The Following Is The Width Of The Bar. This Will Vary With Each Value.
- int fillWidth = rect.Width * Value / (Maximum - Minimum);
-
- // GDI+ Doesn't Like Rectangles 0px Wide or Height
- if (fillWidth == 0)
- {
- // Draw Only Border And Exit
- g.DrawRoundedRectangle(penB, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- return;
- }
- // Rectangles For Upper And Lower Half Of Bar
- int y = Value < 2 ? 1 : 0;
- Rectangle topRect = new(0, y, fillWidth, (rect.Height / 2) + 1 - y); // +1 to avoid "having a dark line in the middle of the bar"
- Rectangle buttomRect = new(0, (rect.Height / 2) - y, fillWidth, (rect.Height / 2) - y);
-
- // Paint Upper Half
- int right = Value < RoundedCorners ? Value : RoundedCorners;
- using LinearGradientBrush gbUH = new(new Point(topRect.X, topRect.Y), new Point(topRect.X, topRect.Height), chunksColorGradient, chunksColor);
- g.FillRoundedRectangle(gbUH, topRect, RoundedCorners, right, 0, 0);
-
- // Paint Lower Half
- // -1 to avoid "out of memory exception"
- using LinearGradientBrush gbLH = new(new Point(buttomRect.X, buttomRect.Y - 1), new Point(buttomRect.X, buttomRect.Height), chunksColor, chunksColorGradient);
- g.FillRoundedRectangle(gbLH, buttomRect, 0, 0, right, RoundedCorners);
-
- // Paint Border
- g.DrawRoundedRectangle(penB, rect, RoundedCorners, RoundedCorners, RoundedCorners, RoundedCorners);
- }
-
- // Compute Percent
- int percent = (int)(Value / (double)Maximum * 100);
- string textPercent;
- if (Value > 0)
- textPercent = percent.ToString() + '%';
- else
- {
- // If Value Is Zero Don't Write Anything
- textPercent = string.Empty;
- if (!DesignMode)
- CustomText = string.Empty;
- }
-
- // Brush For Writing CustomText And Persentage On Progressbar
- using SolidBrush brush = new(foreColor);
-
- // Percent
- SizeF lenPercent = g.MeasureString(textPercent, Font);
- Point locationPercentCenter = new(Convert.ToInt32((Width / 2) - lenPercent.Width / 2), Convert.ToInt32((Height / 2) - lenPercent.Height / 2));
- g.DrawString(textPercent, Font, brush, locationPercentCenter);
-
- // Custom Text
- if (!string.IsNullOrEmpty(CustomText))
- {
- SizeF lenCustomText = g.MeasureString(CustomText, Font);
- if (RightToLeft == RightToLeft.No)
- {
- Point locationCustomTextLeft = new(5, Convert.ToInt32((Height / 2) - lenCustomText.Height / 2));
- g.DrawString(CustomText, Font, brush, locationCustomTextLeft);
- }
- else
- {
- Point locationCustomTextRight = new(Convert.ToInt32(Width - lenCustomText.Width - 5), Convert.ToInt32((Height / 2) - lenCustomText.Height / 2));
- g.DrawString(CustomText, Font, brush, locationCustomTextRight);
- }
- }
-
- // Compute Elapsed Time
- if (StopTimer && StopWatch.IsRunning) StopWatch.Stop();
-
- ElapsedTimeString = timer();
-
- // Max
- if (Value == Maximum)
- {
- if (StopWatch.IsRunning) StopWatch.Stop();
- }
-
- string timer()
- {
- TimeSpan eTime = StopWatch.Elapsed;
- eTime = TimeSpan.FromMilliseconds(Math.Round(eTime.TotalMilliseconds, 1));
- return $"Time: {eTime:hh\\:mm\\:ss\\.f}";
- }
-
- SizeF lenElapsedTime = g.MeasureString(ElapsedTimeString, Font);
- if (RightToLeft == RightToLeft.No)
- {
- Point locationElapsedTimeRight = new(Convert.ToInt32(Width - lenElapsedTime.Width - 5), Convert.ToInt32((Height / 2) - lenElapsedTime.Height / 2));
- g.DrawString(ElapsedTimeString, Font, brush, locationElapsedTimeRight);
- }
- else
- {
- Point locationElapsedTimeLeft = new(5, Convert.ToInt32((Height / 2) - lenElapsedTime.Height / 2));
- g.DrawString(ElapsedTimeString, Font, brush, locationElapsedTimeLeft);
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetChunksColor()
- {
- if (Enabled)
- return ChunksColor;
- else
- {
- if (ChunksColor.DarkOrLight() == "Dark")
- return ChunksColor.ChangeBrightness(0.3f);
- else
- return ChunksColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomRadioButton.cs b/MsmhTools/CustomControls/CustomRadioButton.cs
deleted file mode 100644
index a4180a6..0000000
--- a/MsmhTools/CustomControls/CustomRadioButton.cs
+++ /dev/null
@@ -1,354 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing.Design;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-
-namespace CustomControls
-{
- public class CustomRadioButton : RadioButton
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Appearance Appearance { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new FlatStyle FlatStyle { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new FlatButtonAppearance? FlatAppearance { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new ContentAlignment TextAlign { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new ContentAlignment CheckAlign { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new bool AutoSize { get; set; }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mCheckColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Check Color")]
- public Color CheckColor
- {
- get { return mCheckColor; }
- set
- {
- if (mCheckColor != value)
- {
- mCheckColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- Invalidate();
- }
- }
- }
-
- private string? mText = string.Empty;
- [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0," +
- "Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Text")]
- public override string? Text
- {
- get { return mText; }
- set
- {
- if (mText != value)
- {
- mText = value;
- Invalidate();
- }
- }
- }
-
- private bool ApplicationIdle = false;
- private bool once = true;
- public CustomRadioButton() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomRadioButton_HandleCreated;
- LocationChanged += CustomRadioButton_LocationChanged;
- Move += CustomRadioButton_Move;
- EnabledChanged += CustomRadioButton_EnabledChanged;
- BackColorChanged += CustomRadioButton_BackColorChanged;
- RightToLeftChanged += CustomRadioButton_RightToLeftChanged;
- Paint += CustomRadioButton_Paint;
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRadioButton_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRadioButton_LocationChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRadioButton_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRadioButton_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRadioButton_BackColorChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRadioButton_RightToLeftChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRadioButton_Paint(object? sender, PaintEventArgs e)
- {
- if (ApplicationIdle == false)
- return;
-
- if (sender is RadioButton rb)
- {
- Color backColor = GetBackColor(rb);
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
- Color checkColor = GetCheckColor();
-
- e.Graphics.Clear(backColor);
- rb.Appearance = Appearance.Button;
- rb.FlatStyle = FlatStyle.Flat;
-
- rb.FlatAppearance.BorderSize = 0;
- rb.AutoSize = false;
- rb.UseVisualStyleBackColor = false;
- SizeF sizeF = rb.CreateGraphics().MeasureString(rb.Text, rb.Font);
- int rectSize = 12;
- rb.Height = (int)sizeF.Height;
- rb.Width = (int)(sizeF.Width + rectSize + 5);
- int x;
- float textX;
-
- if (rb.RightToLeft == RightToLeft.No)
- {
- rb.TextAlign = ContentAlignment.MiddleLeft;
- x = 1;
- textX = (float)(rectSize * 1.3);
- }
- else
- {
- rb.TextAlign = ContentAlignment.MiddleRight;
- x = rb.Width - rectSize - 2;
- textX = rb.Width - sizeF.Width - (float)(rectSize * 1.2);
- }
-
- int y = (rb.ClientRectangle.Y + (rb.ClientRectangle.Height - rectSize)) / 2;
- Point pt = new(x, y);
- Rectangle rectCheck = new(pt, new Size(rectSize, rectSize));
-
- // Draw Selection Border
- Rectangle cRect = new(rb.ClientRectangle.X, rb.ClientRectangle.Y, rb.ClientRectangle.Width - 1, rb.ClientRectangle.Height - 1);
- if (rb.Focused)
- {
- using Pen pen = new(SelectionColor) { DashStyle = DashStyle.Dot };
- e.Graphics.DrawRectangle(pen, cRect);
- }
-
- // Draw Text
- using SolidBrush brush1 = new(foreColor);
- e.Graphics.DrawString(rb.Text, rb.Font, brush1, textX, 0);
-
- // Fill Check Rect
- using SolidBrush brush2 = new(backColor);
- e.Graphics.FillRectangle(brush2, rectCheck);
-
- e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
-
- // Set Points
- float centerX = rectCheck.X + (rectCheck.Width / 2);
- float centerY = rectCheck.Y + (rectCheck.Height / 2);
- float radius = rectCheck.Width / 2;
-
- // Draw Check
- if (rb.Checked)
- {
- // Draw Check
- using SolidBrush brushCheck = new(checkColor);
- rectCheck.Inflate(-2, -2);
- float radiusC = rectCheck.Width / 2;
- e.Graphics.FillEllipse(brushCheck, centerX - radiusC, centerY - radiusC, radiusC + radiusC, radiusC + radiusC);
- rectCheck.Inflate(+2, +2);
- }
-
- // Draw Check Rect (Check Border)
- using Pen penBorder = new(borderColor);
- e.Graphics.DrawEllipse(penBorder, centerX - radius, centerY - radius, radius + radius, radius + radius);
-
- e.Graphics.SmoothingMode = SmoothingMode.Default;
- }
- }
-
- private Color GetBackColor(RadioButton radioButton)
- {
- if (radioButton.Enabled)
- return BackColor;
- else
- {
- Color backColor = BackColor;
- if (radioButton.Parent != null)
- {
- if (radioButton.Parent.BackColor != Color.Transparent)
- {
- if (radioButton.Parent.Enabled)
- backColor = radioButton.Parent.BackColor;
- else
- backColor = GetDisabledColor(radioButton.Parent.BackColor);
- }
- else
- {
- if (radioButton.FindForm() != null)
- {
- if (radioButton.Parent.Enabled)
- backColor = radioButton.FindForm().BackColor;
- else
- backColor = GetDisabledColor(radioButton.FindForm().BackColor);
- }
- }
- }
- return backColor;
- }
-
- static Color GetDisabledColor(Color color)
- {
- if (color.DarkOrLight() == "Dark")
- return color.ChangeBrightness(0.3f);
- else
- return color.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetCheckColor()
- {
- if (Enabled)
- return CheckColor;
- else
- {
- if (CheckColor.DarkOrLight() == "Dark")
- return CheckColor.ChangeBrightness(0.3f);
- else
- return CheckColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomRichTextBox.cs b/MsmhTools/CustomControls/CustomRichTextBox.cs
deleted file mode 100644
index 8c9c825..0000000
--- a/MsmhTools/CustomControls/CustomRichTextBox.cs
+++ /dev/null
@@ -1,794 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Drawing.Design;
-using System.Runtime.InteropServices;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, January 27, 2023.
-*/
-
-namespace CustomControls
-{
- [DefaultEvent("TextChanged")]
- public class CustomRichTextBox : UserControl
- {
- private static class Methods
- {
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- private extern static int SetWindowTheme(IntPtr controlHandle, string appName, string? idList);
- internal static void SetDarkControl(Control control)
- {
- _ = SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
- foreach (Control c in control.Controls)
- {
- _ = SetWindowTheme(c.Handle, "DarkMode_Explorer", null);
- }
- }
-
- [DllImport("user32.dll", EntryPoint = "ShowCaret")]
- internal static extern long ShowCaret(IntPtr hwnd);
- [DllImport("user32.dll", EntryPoint = "HideCaret")]
- internal static extern long HideCaret(IntPtr hwnd);
- }
-
- // Disable
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Padding Padding { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoSizeMode AutoSizeMode { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoValidate AutoValidate { get; set; }
-
- private readonly RichTextBox richTextBox = new();
- private bool isFocused = false;
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool mBorder = true;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border")]
- public bool Border
- {
- get { return mBorder; }
- set
- {
- if (mBorder != value)
- {
- mBorder = value;
- Invalidate();
- }
- }
- }
-
- private int mBorderSize = 1;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border Size")]
- public int BorderSize
- {
- get { return mBorderSize; }
- set
- {
- if (mBorderSize != value)
- {
- mBorderSize = value;
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Cursor")]
- public override Cursor Cursor
- {
- get { return base.Cursor; }
- set
- {
- base.Cursor = value;
- richTextBox.Cursor = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Font")]
- public override Font Font
- {
- get { return base.Font; }
- set
- {
- base.Font = value;
- richTextBox.Font = value;
- if (DesignMode)
- UpdateControlSize();
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("ScrollBar")]
- public ScrollBars ScrollBars
- {
- get { return (ScrollBars)richTextBox.ScrollBars; }
- set { richTextBox.ScrollBars = (RichTextBoxScrollBars)value; }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override string Text
- {
- get { return richTextBox.Text; }
- set
- {
- base.Text = value;
- richTextBox.Text = value;
- }
- }
-
- [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0," +
- "Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Texts")]
- public string Texts
- {
- get { return richTextBox.Text; }
- set { richTextBox.Text = value; }
- }
-
- private bool mUnderlinedStyle = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border Underlined Style")]
- public bool UnderlinedStyle
- {
- get { return mUnderlinedStyle; }
- set
- {
- if (mUnderlinedStyle != value)
- {
- mUnderlinedStyle = value;
- Invalidate();
- }
- }
- }
-
- // Scroll to the bottom
- private bool mScrollToBottom = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Scrolls to the bottom of the CustomRichTextBox on Text Changed.")]
- public bool ScrollToBottom
- {
- get { return mScrollToBottom; }
- set
- {
- if (mScrollToBottom != value)
- {
- mScrollToBottom = value;
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Accepts Tab")]
- public bool AcceptsTab
- {
- get { return richTextBox.AcceptsTab; }
- set { richTextBox.AcceptsTab = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Allow Drop")]
- public override bool AllowDrop
- {
- get { return base.AllowDrop; }
- set
- {
- base.AllowDrop = value;
- richTextBox.AllowDrop = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Auto Word Selection")]
- public bool AutoWordSelection
- {
- get { return richTextBox.AutoWordSelection; }
- set { richTextBox.AutoWordSelection = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Bullet Indent")]
- public int BulletIndent
- {
- get { return richTextBox.BulletIndent; }
- set { richTextBox.BulletIndent = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Context Menu Strip")]
- public override ContextMenuStrip ContextMenuStrip
- {
- get { return base.ContextMenuStrip; }
- set
- {
- base.ContextMenuStrip = value;
- richTextBox.ContextMenuStrip = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Detect Urls")]
- public bool DetectUrls
- {
- get { return richTextBox.DetectUrls; }
- set { richTextBox.DetectUrls = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Enable Auto Drag Drop")]
- public bool EnableAutoDragDrop
- {
- get { return richTextBox.EnableAutoDragDrop; }
- set { richTextBox.EnableAutoDragDrop = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Hide Selection")]
- public bool HideSelection
- {
- get { return richTextBox.HideSelection; }
- set { richTextBox.HideSelection = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Input Method Editor")]
- public new ImeMode ImeMode
- {
- get { return richTextBox.ImeMode; }
- set { richTextBox.ImeMode = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Max Length")]
- public int MaxLength
- {
- get { return richTextBox.MaxLength; }
- set { richTextBox.MaxLength = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Multiline Style")]
- public bool Multiline
- {
- get { return richTextBox.Multiline; }
- set
- {
- richTextBox.Multiline = value;
- if (DesignMode)
- UpdateControlSize();
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Read Only")]
- public bool ReadOnly
- {
- get { return richTextBox.ReadOnly; }
- set { richTextBox.ReadOnly = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Right Margin")]
- public int RightMargin
- {
- get { return richTextBox.RightMargin; }
- set { richTextBox.RightMargin = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Shortcuts Enabled")]
- public bool ShortcutsEnabled
- {
- get { return richTextBox.ShortcutsEnabled; }
- set { richTextBox.ShortcutsEnabled = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Tab Index")]
- public new int TabIndex
- {
- get { return richTextBox.TabIndex; }
- set { richTextBox.TabIndex = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Tab Stop")]
- public new bool TabStop
- {
- get { return richTextBox.TabStop; }
- set { richTextBox.TabStop = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Word Wrap Style")]
- public bool WordWrap
- {
- get { return richTextBox.WordWrap; }
- set { richTextBox.WordWrap = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Zoom Factor")]
- public float ZoomFactor
- {
- get { return richTextBox.ZoomFactor; }
- set { richTextBox.ZoomFactor = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(false)]
- public Color SelectionColor
- {
- get { return richTextBox.SelectionColor; }
- set { richTextBox.SelectionColor = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(false)]
- public int SelectionLength
- {
- get { return richTextBox.SelectionLength; }
- set { richTextBox.SelectionLength = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(false)]
- public int SelectionStart
- {
- get { return richTextBox.SelectionStart; }
- set { richTextBox.SelectionStart = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(false)]
- public int TextLength
- {
- get { return richTextBox.TextLength; }
- }
-
- public override void ResetText()
- {
- richTextBox.ResetText();
- }
-
- private bool ApplicationIdle = false;
- private bool once = true;
-
- public void AppendText(string text)
- {
- richTextBox.AppendText(text);
- richTextBox.Refresh();
- }
-
- public void AppendText(string text, Color color)
- {
- richTextBox.SelectionStart = richTextBox.TextLength;
- richTextBox.SelectionLength = 0;
- richTextBox.SelectionColor = color;
- richTextBox.AppendText(text);
- richTextBox.SelectionColor = richTextBox.ForeColor;
- richTextBox.Refresh();
- }
-
- public CustomRichTextBox() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- Font = new("Segoe UI", 9);
- AutoScaleMode = AutoScaleMode.None;
- Padding = new(0);
- Size = new(100, 23);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
- AutoScroll = false;
- AutoScrollMargin = new(0, 0);
- AutoScrollMinSize = new(0, 0);
- AutoSize = false;
-
- // Disabled
- AutoSizeMode = AutoSizeMode.GrowOnly;
- AutoValidate = AutoValidate.EnablePreventFocusChange;
-
- Controls.Add(richTextBox);
- richTextBox.BackColor = GetBackColor();
- richTextBox.ForeColor = GetForeColor();
-
- //richTextBox.Dock = DockStyle.Fill;
- richTextBox.BorderStyle = BorderStyle.None;
-
- // Events
- Application.Idle += Application_Idle;
- EnabledChanged += CustomRichTextBox_EnabledChanged;
- BackColorChanged += CustomRichTextBox_BackColorChanged;
- ForeColorChanged += CustomRichTextBox_ForeColorChanged;
- richTextBox.Click += RichTextBox_Click;
- richTextBox.MouseClick += RichTextBox_MouseClick;
- richTextBox.MouseDoubleClick += RichTextBox_MouseDoubleClick;
- richTextBox.MouseEnter += RichTextBox_MouseEnter;
- richTextBox.MouseLeave += RichTextBox_MouseLeave;
- richTextBox.KeyPress += RichTextBox_KeyPress;
- richTextBox.Enter += RichTextBox_Enter;
- richTextBox.Leave += RichTextBox_Leave;
- richTextBox.Invalidated += RichTextBox_Invalidated;
- richTextBox.AcceptsTabChanged += RichTextBox_AcceptsTabChanged;
- richTextBox.GotFocus += RichTextBox_GotFocus;
- richTextBox.HideSelectionChanged += RichTextBox_HideSelectionChanged;
- richTextBox.ModifiedChanged += RichTextBox_ModifiedChanged;
- richTextBox.MultilineChanged += RichTextBox_MultilineChanged;
- richTextBox.ReadOnlyChanged += RichTextBox_ReadOnlyChanged;
- richTextBox.SelectionChanged += RichTextBox_SelectionChanged;
- richTextBox.TextChanged += RichTextBox_TextChanged;
- }
-
- // Events
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? Scroll;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? Load;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? PaddingChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? AutoSizeChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? AutoValidateChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? BackgroundImageChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? BackgroundImageLayoutChanged;
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomRichTextBox_EnabledChanged(object? sender, EventArgs e)
- {
- richTextBox.Enabled = Enabled;
- Invalidate();
- richTextBox.Invalidate();
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Accepts Tab Changed")]
- public event EventHandler? AcceptsTabChanged;
- private void RichTextBox_AcceptsTabChanged(object? sender, EventArgs e)
- {
- AcceptsTabChanged?.Invoke(sender, e);
- }
-
- private void RichTextBox_GotFocus(object? sender, EventArgs e)
- {
- OnGotFocus(e);
- if (HideSelection)
- Methods.HideCaret(richTextBox.Handle);
- else
- Methods.ShowCaret(richTextBox.Handle);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Hide Selection Changed")]
- public event EventHandler? HideSelectionChanged;
- private void RichTextBox_HideSelectionChanged(object? sender, EventArgs e)
- {
- HideSelectionChanged?.Invoke(sender, e);
- if (HideSelection)
- Methods.HideCaret(richTextBox.Handle);
- else
- Methods.ShowCaret(richTextBox.Handle);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Modified Changed")]
- public event EventHandler? ModifiedChanged;
- private void RichTextBox_ModifiedChanged(object? sender, EventArgs e)
- {
- ModifiedChanged?.Invoke(sender, e);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Multiline Changed")]
- public event EventHandler? MultilineChanged;
- private bool MultilineChangedBool = false;
- private void RichTextBox_MultilineChanged(object? sender, EventArgs e)
- {
- if (MultilineChanged != null && ApplicationIdle == true)
- {
- MultilineChanged.Invoke(sender, e);
- MultilineChangedBool = true;
- UpdateControlSize();
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Read Only Changed")]
- public event EventHandler? ReadOnlyChanged;
- private void RichTextBox_ReadOnlyChanged(object? sender, EventArgs e)
- {
- ReadOnlyChanged?.Invoke(sender, e);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Selection Changed")]
- public event EventHandler? SelectionChanged;
- private void RichTextBox_SelectionChanged(object? sender, EventArgs e)
- {
- SelectionChanged?.Invoke(sender, e);
- if (HideSelection)
- {
- richTextBox.SelectionLength = 0;
- Methods.HideCaret(richTextBox.Handle);
- }
- else
- Methods.ShowCaret(richTextBox.Handle);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Text Changed")]
- public new event EventHandler? TextChanged;
- private void RichTextBox_TextChanged(object? sender, EventArgs e)
- {
- TextChanged?.Invoke(sender, e);
- richTextBox.BackColor = GetBackColor();
- richTextBox.ForeColor = GetForeColor();
- if (ScrollToBottom)
- {
- richTextBox.SelectionStart = richTextBox.TextLength;
- richTextBox.SelectionLength = 0;
- richTextBox.ScrollToCaret();
- }
- }
-
- private void CustomRichTextBox_BackColorChanged(object? sender, EventArgs e)
- {
- richTextBox.BackColor = GetBackColor();
- Invalidate();
- }
-
- private void CustomRichTextBox_ForeColorChanged(object? sender, EventArgs e)
- {
- richTextBox.ForeColor = GetForeColor();
- Invalidate();
- }
-
- private void RichTextBox_Click(object? sender, EventArgs e)
- {
- OnClick(e);
- }
-
- private void RichTextBox_MouseClick(object? sender, MouseEventArgs e)
- {
- OnMouseClick(e);
- }
-
- private void RichTextBox_MouseDoubleClick(object? sender, MouseEventArgs e)
- {
- OnMouseDoubleClick(e);
- }
-
- private void RichTextBox_MouseEnter(object? sender, EventArgs e)
- {
- OnMouseEnter(e);
- }
-
- private void RichTextBox_MouseLeave(object? sender, EventArgs e)
- {
- OnMouseLeave(e);
- }
-
- private void RichTextBox_KeyPress(object? sender, KeyPressEventArgs e)
- {
- OnKeyPress(e);
- }
-
- private void RichTextBox_Enter(object? sender, EventArgs e)
- {
- isFocused = true;
- Invalidate();
- }
-
- private void RichTextBox_Leave(object? sender, EventArgs e)
- {
- isFocused = false;
- Invalidate();
- }
-
- private void RichTextBox_Invalidated(object? sender, InvalidateEventArgs e)
- {
- if (BackColor.DarkOrLight() == "Dark")
- Methods.SetDarkControl(richTextBox);
- richTextBox.Enabled = Enabled;
- richTextBox.BackColor = GetBackColor();
- richTextBox.ForeColor = GetForeColor();
- }
-
- // Overridden Methods
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
-
- Color borderColor = GetBorderColor();
-
- e.Graphics.Clear(GetBackColor());
-
- //Draw border
- using Pen penBorder = new(borderColor, mBorderSize);
- penBorder.Alignment = System.Drawing.Drawing2D.PenAlignment.Inset;
-
- if (Border)
- {
- if (mUnderlinedStyle) // Line Style
- e.Graphics.DrawLine(penBorder, 0, Height - 1, Width, Height - 1);
- else //Normal Style
- e.Graphics.DrawRectangle(penBorder, 0, 0, Width - 0.5F, Height - 0.5F);
- }
- }
-
- protected override void OnResize(EventArgs e)
- {
- base.OnResize(e);
- Invalidate();
- UpdateControlSize();
- }
-
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- UpdateControlSize();
- }
-
- private void UpdateControlSize()
- {
- if (richTextBox.Multiline == false)
- {
- int txtHeight = TextRenderer.MeasureText("Text", Font).Height + 2;
- int padding = 6;
- if (!MultilineChangedBool)
- {
- richTextBox.Multiline = true;
- richTextBox.MinimumSize = new Size(0, txtHeight);
- richTextBox.Multiline = false;
- }
- else
- MultilineChangedBool = false;
- richTextBox.Height = txtHeight;
- richTextBox.Width = Width - padding;
- Height = richTextBox.Height + padding;
- richTextBox.Location = new(padding / 2, padding / 2);
- }
- else
- {
- int txtHeight = TextRenderer.MeasureText("Text", Font).Height + 2;
- int padding = 6;
- richTextBox.MinimumSize = new Size(0, txtHeight);
- MinimumSize = new Size(0, txtHeight + padding);
- richTextBox.Height = Height - padding;
- richTextBox.Width = Width - padding;
- richTextBox.Location = new(padding / 2, padding / 2);
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- {
- if (isFocused)
- {
- // Focused Border Color
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.4f);
- else
- return BorderColor.ChangeBrightness(-0.4f);
- }
- else
- return BorderColor;
- }
- else
- {
- // Disabled Border Color
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomStatusStrip.cs b/MsmhTools/CustomControls/CustomStatusStrip.cs
deleted file mode 100644
index 27ec493..0000000
--- a/MsmhTools/CustomControls/CustomStatusStrip.cs
+++ /dev/null
@@ -1,175 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 20, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomStatusStrip : StatusStrip
- {
- private readonly CustomToolStripRenderer MyRenderer = new();
-
- private bool mBorder = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border")]
- public bool Border
- {
- get { return mBorder; }
- set
- {
- if (mBorder != value)
- {
- mBorder = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- BorderColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- SelectionColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Border Color Changed Event")]
- public event EventHandler? BorderColorChanged;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Selection Color Changed Event")]
- public event EventHandler? SelectionColorChanged;
-
- public CustomStatusStrip() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- MyRenderer.BackColor = GetBackColor();
- MyRenderer.ForeColor = GetForeColor();
- MyRenderer.BorderColor = GetBorderColor();
- MyRenderer.SelectionColor = SelectionColor;
- Renderer = MyRenderer;
-
- BackColorChanged += CustomStatusStrip_BackColorChanged;
- ForeColorChanged += CustomStatusStrip_ForeColorChanged;
- BorderColorChanged += CustomStatusStrip_BorderColorChanged;
- SelectionColorChanged += CustomStatusStrip_SelectionColorChanged;
- Paint += CustomStatusStrip_Paint;
- }
-
- private void CustomStatusStrip_BackColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BackColor = GetBackColor();
- Invalidate();
- }
-
- private void CustomStatusStrip_ForeColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.ForeColor = GetForeColor();
- Invalidate();
- }
-
- private void CustomStatusStrip_BorderColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BorderColor = GetBorderColor();
- Invalidate();
- }
-
- private void CustomStatusStrip_SelectionColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.SelectionColor = SelectionColor;
- Invalidate();
- }
-
- private void CustomStatusStrip_Paint(object? sender, PaintEventArgs e)
- {
- if (Border)
- {
- Color borderColor = GetBorderColor();
- ControlPaint.DrawBorder(e.Graphics, ClientRectangle, borderColor, ButtonBorderStyle.Solid);
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.2f);
- else
- return BackColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomTabControl.cs b/MsmhTools/CustomControls/CustomTabControl.cs
deleted file mode 100644
index a1b93fa..0000000
--- a/MsmhTools/CustomControls/CustomTabControl.cs
+++ /dev/null
@@ -1,484 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 01, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomTabControl : TabControl
- {
- private static class Methods
- {
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- private extern static int SetWindowTheme(IntPtr controlHandle, string appName, string? idList);
- internal static void SetDarkControl(Control control)
- {
- _ = SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
- foreach (Control c in control.Controls)
- {
- _ = SetWindowTheme(c.Handle, "DarkMode_Explorer", null);
- }
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new TabAppearance Appearance { get; set; }
-
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public new Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public new Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool mHideTabHeader = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Hide Tab Header")]
- public bool HideTabHeader
- {
- get { return mHideTabHeader; }
- set
- {
- if (mHideTabHeader != value)
- {
- mHideTabHeader = value;
- HideTabHeaderChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("HideTabHeader Changed Event")]
- public event EventHandler? HideTabHeaderChanged;
-
- private bool ControlEnabled = true;
- private bool once = true;
-
- public CustomTabControl() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.Opaque, true);
-
- ControlEnabled = Enabled;
- Appearance = TabAppearance.Normal;
-
- HideTabHeaderChanged += CustomTabControl_HideTabHeaderChanged;
-
- ControlAdded += CustomTabControl_ControlAdded;
- ControlRemoved += CustomTabControl_ControlRemoved;
- Application.Idle += Application_Idle;
- HandleCreated += CustomTabControl_HandleCreated;
- LocationChanged += CustomTabControl_LocationChanged;
- Move += CustomTabControl_Move;
- SizeChanged += CustomTabControl_SizeChanged;
- EnabledChanged += CustomTabControl_EnabledChanged;
- Invalidated += CustomTabControl_Invalidated;
- Paint += CustomTabControl_Paint;
- }
-
- private void CustomTabControl_HideTabHeaderChanged(object? sender, EventArgs e)
- {
- if (mHideTabHeader)
- {
- Appearance = TabAppearance.Buttons;
- ItemSize = new(0, 1);
- SizeMode = TabSizeMode.Fixed;
- }
- else
- {
- Appearance = TabAppearance.Normal;
- ItemSize = Size.Empty;
- SizeMode = TabSizeMode.FillToRight;
- }
- }
-
- private void SearchTabPages()
- {
- for (int n = 0; n < TabPages.Count; n++)
- {
- TabPage tabPage = TabPages[n];
- tabPage.Tag = n;
- tabPage.Paint -= TabPage_Paint;
- tabPage.Paint += TabPage_Paint;
- }
- }
-
- private void CustomTabControl_ControlAdded(object? sender, ControlEventArgs e)
- {
- if (e.Control is TabPage)
- SearchTabPages();
- Invalidate();
- }
-
- private void CustomTabControl_ControlRemoved(object? sender, ControlEventArgs e)
- {
- if (e.Control is TabPage)
- SearchTabPages();
- Invalidate();
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- SearchTabPages();
-
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TabPage_Paint(object? sender, PaintEventArgs e)
- {
- TabPage tabPage = sender as TabPage;
-
- Color tabPageColor;
- if (Enabled)
- tabPageColor = tabPage.BackColor;
- else
- {
- if (tabPage.BackColor.DarkOrLight() == "Dark")
- tabPageColor = tabPage.BackColor.ChangeBrightness(0.3f);
- else
- tabPageColor = tabPage.BackColor.ChangeBrightness(-0.3f);
- }
-
- using SolidBrush sb = new(tabPageColor);
- e.Graphics.FillRectangle(sb, e.ClipRectangle);
-
- Control tabControl = tabPage.Parent;
- tabControl.Tag = tabPage.Tag;
- tabControl.Paint -= TabControl_Paint;
- tabControl.Paint += TabControl_Paint;
- }
-
- private void TabControl_Paint(object? sender, PaintEventArgs e)
- {
- // Selected Tab Can Be Paint Also Here
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTabControl_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTabControl_LocationChanged(object? sender, EventArgs e)
- {
- if (sender is TabControl tabControl)
- tabControl.Invalidate();
- }
-
- private void CustomTabControl_Move(object? sender, EventArgs e)
- {
- if (sender is TabControl tabControl)
- tabControl.Invalidate();
- }
-
- private void CustomTabControl_SizeChanged(object? sender, EventArgs e)
- {
- if (sender is TabControl tabControl)
- tabControl.Invalidate();
- }
-
- private void CustomTabControl_EnabledChanged(object? sender, EventArgs e)
- {
- ControlEnabled = Enabled;
- }
-
- private void CustomTabControl_Invalidated(object? sender, InvalidateEventArgs e)
- {
- if (BackColor.DarkOrLight() == "Dark")
- Methods.SetDarkControl(this);
- }
-
- private void CustomTabControl_Paint(object? sender, PaintEventArgs e)
- {
- if (sender is TabControl tc)
- {
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
- Color borderColor = GetBorderColor();
-
- // Paint Background
- e.Graphics.Clear(backColor);
-
- for (int n = 0; n < TabPages.Count; n++)
- {
- TabPage tabPage = TabPages[n];
- TabPage selectedTabPage = TabPages[tc.SelectedIndex];
- int index = n;
- Rectangle rectTab = GetTabRect(index);
- using Pen pen = new(borderColor);
- using SolidBrush brush = new(backColor);
-
- // Mouse Position
- Point mP = tc.PointToClient(MousePosition);
-
- // Selected tab Rectangle
- Rectangle rectSelectedTab = GetTabRect(tc.SelectedIndex);
- if (Alignment == TabAlignment.Top)
- {
- if (RightToLeft == RightToLeft.No || RightToLeft == RightToLeft.Yes && !RightToLeftLayout)
- rectSelectedTab = Rectangle.FromLTRB(rectSelectedTab.Left - 2, rectSelectedTab.Top - 2, rectSelectedTab.Right + 1, rectSelectedTab.Bottom);
- else if (RightToLeft == RightToLeft.Yes && RightToLeftLayout)
- rectSelectedTab = Rectangle.FromLTRB(rectSelectedTab.Left - 1, rectSelectedTab.Top - 2, rectSelectedTab.Right, rectSelectedTab.Bottom);
- }
-
- if (!mHideTabHeader)
- {
- // Paint Non-Selected Tab
- if (tc.SelectedIndex != n)
- {
- e.Graphics.FillRectangle(brush, rectTab);
-
- if (!DesignMode && Enabled && rectTab.Contains(mP))
- {
- Color colorHover;
- if (backColor.DarkOrLight() == "Dark")
- colorHover = backColor.ChangeBrightness(0.2f);
- else
- colorHover = backColor.ChangeBrightness(-0.2f);
- using SolidBrush brushHover = new(colorHover);
- e.Graphics.FillRectangle(brushHover, rectTab);
- }
-
- int tabImageIndex = tabPage.ImageIndex;
- string tabImageKey = tabPage.ImageKey;
-
- if (tabImageIndex != -1 && tc.ImageList != null)
- {
- Image tabImage = tc.ImageList.Images[tabImageIndex];
- PaintImageText(e.Graphics, tc, tabPage, rectTab, tabImage, Font, foreColor);
- }
- else if (tabImageKey != null && tc.ImageList != null)
- {
- Image tabImage = tc.ImageList.Images[tabImageKey];
- PaintImageText(e.Graphics, tc, tabPage, rectTab, tabImage, Font, foreColor);
- }
- else
- {
- TextRenderer.DrawText(e.Graphics, tabPage.Text, Font, rectTab, foreColor);
- }
-
- e.Graphics.DrawRectangle(pen, rectTab);
- }
-
- // Paint Selected Tab
- using SolidBrush brushST = new(backColor.ChangeBrightness(-0.3f));
- e.Graphics.FillRectangle(brushST, rectSelectedTab);
-
- int selectedTabImageIndex = selectedTabPage.ImageIndex;
- string selectedTabImageKey = selectedTabPage.ImageKey;
-
- if (selectedTabImageIndex != -1 && tc.ImageList != null)
- {
- Image tabImage = tc.ImageList.Images[selectedTabImageIndex];
- PaintImageText(e.Graphics, tc, selectedTabPage, rectSelectedTab, tabImage, Font, foreColor);
- }
- else if (selectedTabImageKey != null && tc.ImageList != null)
- {
- Image tabImage = tc.ImageList.Images[selectedTabImageKey];
- PaintImageText(e.Graphics, tc, selectedTabPage, rectSelectedTab, tabImage, Font, foreColor);
- }
- else
- {
- TextRenderer.DrawText(e.Graphics, selectedTabPage.Text, Font, rectSelectedTab, foreColor);
- }
-
- e.Graphics.DrawRectangle(pen, rectSelectedTab);
-
- // Paint Main Control Border
- Rectangle rectPage = ClientRectangle;
- if (Alignment == TabAlignment.Top)
- {
- rectPage = Rectangle.FromLTRB(ClientRectangle.Left, rectSelectedTab.Bottom, ClientRectangle.Right, ClientRectangle.Bottom);
- if (RightToLeft == RightToLeft.Yes && RightToLeftLayout)
- rectPage = Rectangle.FromLTRB(ClientRectangle.Left, rectSelectedTab.Bottom, ClientRectangle.Right - 1, ClientRectangle.Bottom);
- }
- else if (Alignment == TabAlignment.Bottom)
- {
- rectPage = Rectangle.FromLTRB(ClientRectangle.Left, ClientRectangle.Top, ClientRectangle.Right, rectSelectedTab.Top + 1);
- }
- else if (Alignment == TabAlignment.Left)
- {
- rectPage = Rectangle.FromLTRB(rectSelectedTab.Right, ClientRectangle.Top, ClientRectangle.Right, ClientRectangle.Bottom);
- }
- else if (Alignment == TabAlignment.Right)
- {
- rectPage = Rectangle.FromLTRB(ClientRectangle.Left, ClientRectangle.Top, rectSelectedTab.Left + 1, ClientRectangle.Bottom);
- }
-
- ControlPaint.DrawBorder(e.Graphics, rectPage, borderColor, ButtonBorderStyle.Solid);
-
- if (Alignment == TabAlignment.Top)
- {
- // to overlap selected tab bottom line
- using Pen penLine = new(backColor.ChangeBrightness(-0.3f));
- e.Graphics.DrawLine(penLine, rectSelectedTab.Left + 1, rectSelectedTab.Bottom, rectSelectedTab.Right - 1, rectSelectedTab.Bottom);
- }
- else if (Alignment == TabAlignment.Bottom)
- {
- // to overlap selected tab top line
- using Pen penLine = new(backColor.ChangeBrightness(-0.3f));
- e.Graphics.DrawLine(penLine, rectSelectedTab.Left + 1, rectSelectedTab.Top, rectSelectedTab.Right - 1, rectSelectedTab.Top);
- }
- else if (Alignment == TabAlignment.Left)
- {
- // to overlap selected tab right line
- using Pen penLine = new(backColor.ChangeBrightness(-0.3f));
- e.Graphics.DrawLine(penLine, rectSelectedTab.Right, rectSelectedTab.Top + 1, rectSelectedTab.Right, rectSelectedTab.Bottom - 1);
- }
- else if (Alignment == TabAlignment.Right)
- {
- // to overlap selected tab left line
- using Pen penLine = new(backColor.ChangeBrightness(-0.3f));
- e.Graphics.DrawLine(penLine, rectSelectedTab.Left, rectSelectedTab.Top + 1, rectSelectedTab.Left, rectSelectedTab.Bottom - 1);
- }
- }
- else
- {
- // Paint Main Control Border
- ControlPaint.DrawBorder(e.Graphics, ClientRectangle, borderColor, ButtonBorderStyle.Solid);
- }
- }
- }
- }
-
- private void PaintImageText(Graphics graphics, TabControl tc, TabPage tabPage, Rectangle rectTab, Image? tabImage, Font font, Color foreColor)
- {
- if (HideTabHeader)
- return;
- if (tabImage != null)
- {
- Rectangle rectImage = new(rectTab.X + tc.Padding.X, rectTab.Y + tc.Padding.Y, tabImage.Width, tabImage.Height);
- rectImage.Location = new(rectImage.X, rectTab.Y + (rectTab.Height - rectImage.Height) / 2);
- graphics.DrawImage(tabImage, rectImage);
- Rectangle rectText = new(rectTab.X + rectImage.Width, rectTab.Y, rectTab.Width - rectImage.Width, rectTab.Height);
- TextRenderer.DrawText(graphics, tabPage.Text, font, rectText, foreColor);
- }
- else
- TextRenderer.DrawText(graphics, tabPage.Text, font, rectTab, foreColor);
- }
-
- private Color GetBackColor()
- {
- if (ControlEnabled)
- return BackColor;
- else
- {
- Color disabledBackColor;
- if (BackColor.DarkOrLight() == "Dark")
- disabledBackColor = BackColor.ChangeBrightness(0.3f);
- else
- disabledBackColor = BackColor.ChangeBrightness(-0.3f);
- return disabledBackColor;
- }
- }
-
- private Color GetForeColor()
- {
- if (ControlEnabled)
- return ForeColor;
- else
- {
- Color disabledForeColor;
- if (ForeColor.DarkOrLight() == "Dark")
- disabledForeColor = ForeColor.ChangeBrightness(0.2f);
- else
- disabledForeColor = ForeColor.ChangeBrightness(-0.2f);
- return disabledForeColor;
- }
- }
-
- private Color GetBorderColor()
- {
- if (ControlEnabled)
- return BorderColor;
- else
- {
- Color disabledBorderColor;
- if (BorderColor.DarkOrLight() == "Dark")
- disabledBorderColor = BorderColor.ChangeBrightness(0.3f);
- else
- disabledBorderColor = BorderColor.ChangeBrightness(-0.3f);
- return disabledBorderColor;
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomTextBox.cs b/MsmhTools/CustomControls/CustomTextBox.cs
deleted file mode 100644
index 8905e86..0000000
--- a/MsmhTools/CustomControls/CustomTextBox.cs
+++ /dev/null
@@ -1,646 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Drawing.Design;
-using System.Runtime.InteropServices;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, May 10, 2022.
-*/
-
-namespace CustomControls
-{
- [DefaultEvent("TextChanged")]
- public class CustomTextBox : UserControl
- {
- private static class Methods
- {
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- private extern static int SetWindowTheme(IntPtr controlHandle, string appName, string? idList);
- internal static void SetDarkControl(Control control)
- {
- _ = SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
- foreach (Control c in control.Controls)
- {
- _ = SetWindowTheme(c.Handle, "DarkMode_Explorer", null);
- }
- }
- }
-
- // Disable
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Padding Padding { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoSizeMode AutoSizeMode { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoValidate AutoValidate { get; set; }
-
- private readonly TextBox textBox = new();
- private bool isFocused = false;
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool mBorder = true;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border")]
- public bool Border
- {
- get { return mBorder; }
- set
- {
- if (mBorder != value)
- {
- mBorder = value;
- Invalidate();
- }
- }
- }
-
- private int mBorderSize = 1;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border Size")]
- public int BorderSize
- {
- get { return mBorderSize; }
- set
- {
- if (mBorderSize != value)
- {
- mBorderSize = value;
- Invalidate();
- }
- }
- }
-
- [Category("Appearance"), Description("Font")]
- public override Font Font
- {
- get { return base.Font; }
- set
- {
- base.Font = value;
- textBox.Font = value;
- if (DesignMode)
- UpdateControlSize();
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("ScrollBar")]
- public ScrollBars ScrollBars
- {
- get { return textBox.ScrollBars; }
- set { textBox.ScrollBars = value; }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public override string Text
- {
- get { return textBox.Text; }
- set
- {
- base.Text = value;
- textBox.Text = value;
- }
- }
-
- [Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0," +
- "Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor))]
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Texts")]
- public string Texts
- {
- get { return textBox.Text; }
- set { textBox.Text = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Text Align")]
- public HorizontalAlignment TextAlign
- {
- get { return textBox.TextAlign; }
- set { textBox.TextAlign = value; }
- }
-
- private bool mUnderlinedStyle = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border Underlined Style")]
- public bool UnderlinedStyle
- {
- get { return mUnderlinedStyle; }
- set
- {
- if (mUnderlinedStyle != value)
- {
- mUnderlinedStyle = value;
- Invalidate();
- }
- }
- }
-
- // Behavior
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Accepts Return")]
- public bool AcceptsReturn
- {
- get { return textBox.AcceptsReturn; }
- set { textBox.AcceptsReturn = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Accepts Tab")]
- public bool AcceptsTab
- {
- get { return textBox.AcceptsTab; }
- set { textBox.AcceptsTab = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Allow Drop")]
- public override bool AllowDrop
- {
- get { return textBox.AllowDrop; }
- set { textBox.AllowDrop = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Character Casing")]
- public CharacterCasing CharacterCasing
- {
- get { return textBox.CharacterCasing; }
- set { textBox.CharacterCasing = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Context Menu Strip")]
- public override ContextMenuStrip ContextMenuStrip
- {
- get { return textBox.ContextMenuStrip; }
- set { textBox.ContextMenuStrip = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Hide Selection")]
- public bool HideSelection
- {
- get { return textBox.HideSelection; }
- set { textBox.HideSelection = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Input Method Editor")]
- public new ImeMode ImeMode
- {
- get { return textBox.ImeMode; }
- set { textBox.ImeMode = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Max Length")]
- public int MaxLength
- {
- get { return textBox.MaxLength; }
- set { textBox.MaxLength = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Multiline Style")]
- public bool Multiline
- {
- get { return textBox.Multiline; }
- set
- {
- textBox.Multiline = value;
- if (DesignMode)
- UpdateControlSize();
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Read Only")]
- public bool ReadOnly
- {
- get { return textBox.ReadOnly; }
- set { textBox.ReadOnly = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Shortcuts Enabled")]
- public bool ShortcutsEnabled
- {
- get { return textBox.ShortcutsEnabled; }
- set { textBox.ShortcutsEnabled = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Tab Index")]
- public new int TabIndex
- {
- get { return textBox.TabIndex; }
- set { textBox.TabIndex = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Tab Stop")]
- public new bool TabStop
- {
- get { return textBox.TabStop; }
- set { textBox.TabStop = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Password Style")]
- public bool UsePasswordChar
- {
- get { return textBox.UseSystemPasswordChar; }
- set { textBox.UseSystemPasswordChar = value; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Word Wrap Style")]
- public bool WordWrap
- {
- get { return textBox.WordWrap; }
- set { textBox.WordWrap = value; }
- }
-
- private bool ApplicationIdle = false;
- private bool once = true;
-
- public CustomTextBox() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- Font = new("Segoe UI", 9);
- AutoScaleMode = AutoScaleMode.None;
- Padding = new(0);
- Size = new(100, 23);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
- AutoScroll = false;
- AutoScrollMargin = new(0, 0);
- AutoScrollMinSize = new(0, 0);
- AutoSize = false;
-
- // Disabled
- AutoSizeMode = AutoSizeMode.GrowOnly;
- AutoValidate = AutoValidate.EnablePreventFocusChange;
-
- Controls.Add(textBox);
- textBox.BackColor = GetBackColor();
- textBox.ForeColor = GetForeColor();
- //textBox.Dock = DockStyle.Fill;
- textBox.BorderStyle = BorderStyle.None;
-
- // Events
- Application.Idle += Application_Idle;
- EnabledChanged += CustomTextBox_EnabledChanged;
- BackColorChanged += CustomTextBox_BackColorChanged;
- ForeColorChanged += CustomTextBox_ForeColorChanged;
- textBox.Click += TextBox_Click;
- textBox.MouseEnter += TextBox_MouseEnter;
- textBox.MouseLeave += TextBox_MouseLeave;
- textBox.KeyPress += TextBox_KeyPress;
- textBox.Enter += TextBox_Enter;
- textBox.Leave += TextBox_Leave;
- textBox.Invalidated += TextBox_Invalidated;
- textBox.AcceptsTabChanged += TextBox_AcceptsTabChanged;
- textBox.HideSelectionChanged += TextBox_HideSelectionChanged;
- textBox.ModifiedChanged += TextBox_ModifiedChanged;
- textBox.MultilineChanged += TextBox_MultilineChanged;
- textBox.ReadOnlyChanged += TextBox_ReadOnlyChanged;
- textBox.TextAlignChanged += TextBox_TextAlignChanged;
- textBox.TextChanged += TextBox_TextChanged;
- }
-
- // Events
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? Scroll;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? Load;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? PaddingChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? AutoSizeChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? AutoValidateChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? BackgroundImageChanged;
-
- [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new event EventHandler? BackgroundImageLayoutChanged;
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- ApplicationIdle = true;
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTextBox_EnabledChanged(object? sender, EventArgs e)
- {
- textBox.Enabled = Enabled;
- Invalidate();
- textBox.Invalidate();
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Accepts Tab Changed")]
- public event EventHandler? AcceptsTabChanged;
- private void TextBox_AcceptsTabChanged(object? sender, EventArgs e)
- {
- AcceptsTabChanged?.Invoke(sender, e);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Hide Selection Changed")]
- public event EventHandler? HideSelectionChanged;
- private void TextBox_HideSelectionChanged(object? sender, EventArgs e)
- {
- HideSelectionChanged?.Invoke(sender, e);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Modified Changed")]
- public event EventHandler? ModifiedChanged;
- private void TextBox_ModifiedChanged(object? sender, EventArgs e)
- {
- ModifiedChanged?.Invoke(sender, e);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Multiline Changed")]
- public event EventHandler? MultilineChanged;
- private bool MultilineChangedBool = false;
- private void TextBox_MultilineChanged(object? sender, EventArgs e)
- {
- if (MultilineChanged != null && ApplicationIdle == true)
- {
- MultilineChanged.Invoke(sender, e);
- MultilineChangedBool = true;
- UpdateControlSize();
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Read Only Changed")]
- public event EventHandler? ReadOnlyChanged;
- private void TextBox_ReadOnlyChanged(object? sender, EventArgs e)
- {
- ReadOnlyChanged?.Invoke(sender, e);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Text Align Changed")]
- public event EventHandler? TextAlignChanged;
- private void TextBox_TextAlignChanged(object? sender, EventArgs e)
- {
- TextAlignChanged?.Invoke(sender, e);
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Text Changed")]
- public new event EventHandler? TextChanged;
- private void TextBox_TextChanged(object? sender, EventArgs e)
- {
- TextChanged?.Invoke(sender, e);
- }
-
- private void CustomTextBox_BackColorChanged(object? sender, EventArgs e)
- {
- textBox.BackColor = GetBackColor();
- Invalidate();
- }
-
- private void CustomTextBox_ForeColorChanged(object? sender, EventArgs e)
- {
- textBox.ForeColor = GetForeColor();
- Invalidate();
- }
-
- private void TextBox_Click(object? sender, EventArgs e)
- {
- OnClick(e);
- }
-
- private void TextBox_MouseEnter(object? sender, EventArgs e)
- {
- OnMouseEnter(e);
- }
-
- private void TextBox_MouseLeave(object? sender, EventArgs e)
- {
- OnMouseLeave(e);
- }
-
- private void TextBox_KeyPress(object? sender, KeyPressEventArgs e)
- {
- OnKeyPress(e);
- }
-
- private void TextBox_Enter(object? sender, EventArgs e)
- {
- isFocused = true;
- Invalidate();
- }
-
- private void TextBox_Leave(object? sender, EventArgs e)
- {
- isFocused = false;
- Invalidate();
- }
-
- private void TextBox_Invalidated(object? sender, InvalidateEventArgs e)
- {
- if (BackColor.DarkOrLight() == "Dark")
- Methods.SetDarkControl(textBox);
- textBox.Enabled = Enabled;
- textBox.BackColor = GetBackColor();
- textBox.ForeColor = GetForeColor();
- }
-
- // Overridden Methods
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
-
- Color borderColor = GetBorderColor();
-
- e.Graphics.Clear(GetBackColor());
-
- //Draw border
- using Pen penBorder = new(borderColor, mBorderSize);
- penBorder.Alignment = System.Drawing.Drawing2D.PenAlignment.Inset;
-
- if (Border)
- {
- if (mUnderlinedStyle) // Line Style
- e.Graphics.DrawLine(penBorder, 0, Height - 1, Width, Height - 1);
- else //Normal Style
- e.Graphics.DrawRectangle(penBorder, 0, 0, Width - 0.5F, Height - 0.5F);
- }
- }
-
- protected override void OnResize(EventArgs e)
- {
- base.OnResize(e);
- Invalidate();
- UpdateControlSize();
- }
-
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad(e);
- UpdateControlSize();
- }
-
- private void UpdateControlSize()
- {
- if (textBox.Multiline == false)
- {
- int txtHeight = TextRenderer.MeasureText("Text", Font).Height + 2;
- int padding = 6;
- if (!MultilineChangedBool)
- {
- textBox.Multiline = true;
- textBox.MinimumSize = new Size(0, txtHeight);
- textBox.Multiline = false;
- }
- else
- MultilineChangedBool = false;
- textBox.Height = txtHeight;
- textBox.Width = Width - padding;
- Height = textBox.Height + padding;
- textBox.Location = new(padding / 2, padding / 2);
- }
- else
- {
- int txtHeight = TextRenderer.MeasureText("Text", Font).Height + 2;
- int padding = 6;
- textBox.MinimumSize = new Size(0, txtHeight);
- MinimumSize = new Size(0, txtHeight + padding);
- textBox.Height = Height - padding;
- textBox.Width = Width - padding;
- textBox.Location = new(padding / 2, padding / 2);
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- {
- if (isFocused)
- {
- // Focused Border Color
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.4f);
- else
- return BorderColor.ChangeBrightness(-0.4f);
- }
- else
- return BorderColor;
- }
- else
- {
- // Disabled Border Color
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomTextBox.resx b/MsmhTools/CustomControls/CustomTextBox.resx
deleted file mode 100644
index 1af7de1..0000000
--- a/MsmhTools/CustomControls/CustomTextBox.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/MsmhTools/CustomControls/CustomTimeUpDown.cs b/MsmhTools/CustomControls/CustomTimeUpDown.cs
deleted file mode 100644
index a735e78..0000000
--- a/MsmhTools/CustomControls/CustomTimeUpDown.cs
+++ /dev/null
@@ -1,362 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing;
-using System.Globalization;
-using System.Windows.Forms;
-using System.Windows.Forms.Design;
-
-namespace CustomControls
-{
- public class CustomTimeUpDown : UserControl
- {
- protected override CreateParams CreateParams // Fixes Flickers
- {
- get
- {
- CreateParams cp = base.CreateParams;
- cp.ExStyle |= 0x02000000; // WS_EX_COMPOSITED
- return cp;
- }
- }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new BorderStyle BorderStyle { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new bool AutoScroll { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Size AutoScrollMargin { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new Size AutoScrollMinSize { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new bool AutoSize { get; set; }
-
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public new AutoSizeMode AutoSizeMode { get; set; }
-
- private readonly MaskedTextBox MaskedTextBox1 = new();
- private readonly CustomNumericUpDown NumericUpDown1 = new();
-
- protected bool mBorder = true;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border")]
- public bool Border
- {
- get { return mBorder; }
- set
- {
- if (mBorder != value)
- {
- mBorder = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- NumericUpDown1.BorderColor = value;
- Invalidate();
- }
- }
- }
-
- private bool once = true;
- private const decimal MaxTimeTotalMilliseconds = 359999999; // new TimeConvert(99, 59, 59, 999).TotalMilliseconds
-
- private decimal mValue = 0;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Value (Milliseconds)")]
- public decimal Value
- {
- get { return mValue; }
- set
- {
- if (mValue != value)
- {
- if (value > MaxTimeTotalMilliseconds)
- value = MaxTimeTotalMilliseconds;
- else if (value < 0)
- value = 0;
-
- mValue = value;
- NumericUpDown1.Value = value;
- TimeConvert timeCode = new((double)value);
- MaskedTextBox1.Text = timeCode.ToString();
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Action"), Description("Value Changed Event")]
- public event EventHandler? ValueChanged;
-
- public CustomTimeUpDown() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- UpdateSizeAndColor();
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
- NumericUpDown1.Value = 0;
- NumericUpDown1.Increment = 100;
- NumericUpDown1.Minimum = 0;
- NumericUpDown1.Maximum = 359999999; // ~100 Hours
- MaskedTextBox1.Text = "00:00:00.000";
-
- Controls.Add(NumericUpDown1.Controls[0]);
- Controls.Add(MaskedTextBox1);
- MaskedTextBox1.BringToFront();
-
- NumericUpDown1.ValueChanged += NumericUpDown1_ValueChanged;
- MaskedTextBox1.TextChanged += MaskedTextBox1_TextChanged;
- MaskedTextBox1.KeyDown += MaskedTextBox1_KeyDown;
-
- Application.Idle += Application_Idle;
- HandleCreated += CustomTimeUpDown_HandleCreated;
- FontChanged += CustomTimeUpDown_FontChanged;
- LocationChanged += CustomTimeUpDown_LocationChanged;
- Move += CustomTimeUpDown_Move;
- EnabledChanged += CustomTimeUpDown_EnabledChanged;
- Paint += CustomTimeUpDown_Paint;
-
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTimeUpDown_HandleCreated(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTimeUpDown_FontChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTimeUpDown_LocationChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTimeUpDown_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTimeUpDown_EnabledChanged(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void CustomTimeUpDown_Paint(object? sender, PaintEventArgs e)
- {
- UpdateSizeAndColor();
- e.Graphics.Clear(GetBackColor());
- if (Border)
- {
- ControlPaint.DrawBorder(e.Graphics, ClientRectangle, GetBorderColor(), ButtonBorderStyle.Solid);
- }
- }
-
- private void UpdateSizeAndColor()
- {
- Color backColor = GetBackColor();
- Color foreColor = GetForeColor();
-
- int UpDownWidth = 18;
- BorderStyle = BorderStyle.None;
- AutoSize = false;
- AutoSizeMode = AutoSizeMode.GrowAndShrink;
- MinimumSize = new(0, 0);
- MaximumSize = new(0, 0);
- int width = (int)Math.Round(Graphics.FromImage(new Bitmap(1, 1)).MeasureString("00:00:00.000", Font).Width); // More accurate than MeasureText()
- NumericUpDown1.Font = Font;
- NumericUpDown1.AutoSize = false;
- NumericUpDown1.Size = new(width + UpDownWidth, 0);
- Size = NumericUpDown1.Size;
- ClientSize = Size;
- NumericUpDown1.BorderStyle = BorderStyle.FixedSingle;
- if (Border)
- NumericUpDown1.BorderColor = BorderColor;
- else
- NumericUpDown1.BorderColor = BackColor;
- NumericUpDown1.Margin = new(0);
- NumericUpDown1.TabStop = false;
- NumericUpDown1.BackColor = backColor;
- NumericUpDown1.ForeColor = foreColor;
- MaskedTextBox1.InsertKeyMode = InsertKeyMode.Overwrite;
- MaskedTextBox1.Mask = "00:00:00.000";
- MaskedTextBox1.PromptChar = '_';
- MaskedTextBox1.AutoSize = false;
- MaskedTextBox1.Size = new(ClientRectangle.Width - (UpDownWidth + 2), ClientRectangle.Height - 4);
- MaskedTextBox1.Margin = new(0);
- MaskedTextBox1.InsertKeyMode = InsertKeyMode.Overwrite;
- MaskedTextBox1.BorderStyle = BorderStyle.None;
- MaskedTextBox1.BackColor = backColor;
- MaskedTextBox1.ForeColor = foreColor;
- if (RightToLeft == RightToLeft.No)
- {
- NumericUpDown1.RightToLeft = RightToLeft.No;
- MaskedTextBox1.RightToLeft = RightToLeft.No;
- NumericUpDown1.Location = new(0, 0);
- MaskedTextBox1.Location = new(2, 2);
- }
- else
- {
- NumericUpDown1.RightToLeft = RightToLeft.Yes;
- MaskedTextBox1.RightToLeft = RightToLeft.Yes;
- NumericUpDown1.Location = new(0, 0);
- MaskedTextBox1.Location = new(18, 2);
- }
- NumericUpDown1.Enabled = Enabled;
- MaskedTextBox1.Enabled = Enabled;
- }
-
- private void NumericUpDown1_ValueChanged(object? sender, EventArgs e)
- {
- Value = NumericUpDown1.Value;
- TimeConvert timeCode = new((double)NumericUpDown1.Value);
- MaskedTextBox1.Text = timeCode.ToString();
- ValueChanged?.Invoke(this, e);
- }
-
- private void MaskedTextBox1_TextChanged(object? sender, EventArgs e)
- {
- decimal value = (decimal)TimeConvert.ParseToMilliseconds(MaskedTextBox1.Text);
- if (value != Value)
- {
- if (NumericUpDown1.Minimum <= value && value <= NumericUpDown1.Maximum)
- {
- if (NumericUpDown1.Value != value)
- NumericUpDown1.Value = value;
- }
- else
- {
- if (NumericUpDown1.Minimum > value)
- {
- MaskedTextBox1.Text = "00:00:00.000";
- NumericUpDown1.Value = NumericUpDown1.Minimum;
- }
- else if (value > NumericUpDown1.Maximum)
- {
- MaskedTextBox1.Text = "99:59:59.999";
- NumericUpDown1.Value = NumericUpDown1.Maximum;
- }
- }
- }
- }
-
- private void MaskedTextBox1_KeyDown(object? sender, KeyEventArgs e)
- {
- if (e.KeyData == Keys.Up)
- {
- NumericUpDown1.UpButton();
- e.SuppressKeyPress = true;
- }
- else if (e.KeyData == Keys.Down)
- {
- NumericUpDown1.DownButton();
- e.SuppressKeyPress = true;
- }
- else if (e.KeyData == Keys.Enter)
- {
- ValueChanged?.Invoke(this, e);
- e.SuppressKeyPress = true;
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.3f);
- else
- return BackColor.ChangeBrightness(-0.3f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomTimeUpDown.resx b/MsmhTools/CustomControls/CustomTimeUpDown.resx
deleted file mode 100644
index 1af7de1..0000000
--- a/MsmhTools/CustomControls/CustomTimeUpDown.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/MsmhTools/CustomControls/CustomToolStrip.cs b/MsmhTools/CustomControls/CustomToolStrip.cs
deleted file mode 100644
index 83bbbf2..0000000
--- a/MsmhTools/CustomControls/CustomToolStrip.cs
+++ /dev/null
@@ -1,181 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 20, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomToolStrip : ToolStrip
- {
- private readonly CustomToolStripRenderer MyRenderer = new();
-
- private bool mBorder = false;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Border")]
- public bool Border
- {
- get { return mBorder; }
- set
- {
- if (mBorder != value)
- {
- mBorder = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- BorderColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- SelectionColorChanged?.Invoke(this, EventArgs.Empty);
- Invalidate();
- }
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Border Color Changed Event")]
- public event EventHandler? BorderColorChanged;
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Property Changed"), Description("Selection Color Changed Event")]
- public event EventHandler? SelectionColorChanged;
-
- public CustomToolStrip() : base()
- {
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- // Default
- BackColor = Color.DimGray;
- ForeColor = Color.White;
-
- MyRenderer.BackColor = GetBackColor();
- MyRenderer.ForeColor = GetForeColor();
- MyRenderer.BorderColor = GetBorderColor();
- MyRenderer.SelectionColor = SelectionColor;
- Renderer = MyRenderer;
-
- BackColorChanged += CustomToolStrip_BackColorChanged;
- ForeColorChanged += CustomToolStrip_ForeColorChanged;
- BorderColorChanged += CustomToolStrip_BorderColorChanged;
- SelectionColorChanged += CustomToolStrip_SelectionColorChanged;
- Paint += CustomToolStrip_Paint;
-
- }
-
- private void CustomToolStrip_BackColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BackColor = GetBackColor();
- Invalidate();
- }
-
- private void CustomToolStrip_ForeColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.ForeColor = GetForeColor();
- Invalidate();
- }
-
- private void CustomToolStrip_BorderColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.BorderColor = GetBorderColor();
- Invalidate();
- }
-
- private void CustomToolStrip_SelectionColorChanged(object? sender, EventArgs e)
- {
- MyRenderer.SelectionColor = SelectionColor;
- Invalidate();
- }
-
- private void CustomToolStrip_Paint(object? sender, PaintEventArgs e)
- {
- // Paint Background
- using SolidBrush bgBrush = new(GetBackColor());
- e.Graphics.FillRectangle(bgBrush, ClientRectangle);
-
- // Paint Border
- if (Border)
- {
- Color borderColor = GetBorderColor();
- ControlPaint.DrawBorder(e.Graphics, ClientRectangle, borderColor, ButtonBorderStyle.Solid);
- }
- }
-
- private Color GetBackColor()
- {
- if (Enabled)
- return BackColor;
- else
- {
- if (BackColor.DarkOrLight() == "Dark")
- return BackColor.ChangeBrightness(0.2f);
- else
- return BackColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetForeColor()
- {
- if (Enabled)
- return ForeColor;
- else
- {
- if (ForeColor.DarkOrLight() == "Dark")
- return ForeColor.ChangeBrightness(0.2f);
- else
- return ForeColor.ChangeBrightness(-0.2f);
- }
- }
-
- private Color GetBorderColor()
- {
- if (Enabled)
- return BorderColor;
- else
- {
- if (BorderColor.DarkOrLight() == "Dark")
- return BorderColor.ChangeBrightness(0.3f);
- else
- return BorderColor.ChangeBrightness(-0.3f);
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomToolStripComboBox.cs b/MsmhTools/CustomControls/CustomToolStripComboBox.cs
deleted file mode 100644
index 872cd01..0000000
--- a/MsmhTools/CustomControls/CustomToolStripComboBox.cs
+++ /dev/null
@@ -1,348 +0,0 @@
-using System;
-using System.ComponentModel;
-using System.Windows.Forms.Design;
-/*
- * Copyright MSasanMH, April 16, 2022.
- * Needs CustomComboBox.
- */
-
-namespace CustomControls
-{
- public delegate void DrawControlEventHandler(object sender, Graphics g, Rectangle drawRect);
-
- [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
- [ToolboxBitmap(typeof(CustomToolStripComboBox), "")]
- public class CustomToolStripComboBox : ToolStripControlHost
- {
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public override Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- ComboBox.BackColor = BackColor;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- ComboBox.ForeColor = ForeColor;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- ComboBox.BorderColor = BorderColor;
- Invalidate();
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- ComboBox.SelectionColor = SelectionColor;
- Invalidate();
- }
- }
- }
-
- public event EventHandler? DropDown;
- public event EventHandler? DropDownClosed;
- public event EventHandler? SelectionIndexChanged;
-
- public CustomToolStripComboBox() : base(new CustomComboBox())
- {
- ComboBox.DropDown += new EventHandler(ComboBox_DropDown);
- ComboBox.DropDownClosed += new EventHandler(ComboBox_DropDownClosed);
- ComboBox.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);
- Paint += CustomToolStripComboBox_Paint;
- }
-
- private void CustomToolStripComboBox_Paint(object? sender, PaintEventArgs e)
- {
- ComboBox.BackColor = BackColor;
- ComboBox.ForeColor = ForeColor;
- ComboBox.BorderColor = BorderColor;
- ComboBox.SelectionColor = SelectionColor;
- }
-
- private void ComboBox_DropDown(object? sender, EventArgs e)
- {
- DropDown?.Invoke(sender, e);
- }
-
- private void ComboBox_DropDownClosed(object? sender, EventArgs e)
- {
- DropDownClosed?.Invoke(sender, e);
- }
-
- private void ComboBox_SelectedIndexChanged(object? sender, EventArgs e)
- {
- SelectionIndexChanged?.Invoke(sender, e);
- }
-
- public CustomComboBox ComboBox
- {
- get { return (CustomComboBox)Control; }
- }
-
- public ComboBox.ObjectCollection Items
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.Items;
- }
- }
-
- public AutoCompleteSource AutoCompleteSource
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.AutoCompleteSource;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.AutoCompleteSource = value;
- }
- }
-
- public AutoCompleteMode AutoCompleteMode
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.AutoCompleteMode;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.AutoCompleteMode = value;
- }
- }
-
- public AutoCompleteStringCollection AutoCompleteCustomSource
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.AutoCompleteCustomSource;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.AutoCompleteCustomSource = value;
- }
- }
-
- public int DropDownHeight
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.DropDownHeight;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.DropDownHeight = value;
- }
- }
-
- public ComboBoxStyle DropDownStyle
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.DropDownStyle;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.DropDownStyle = value;
- }
- }
-
- public int DropDownWidth
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.DropDownWidth;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.DropDownWidth = value;
- }
- }
-
- public FlatStyle FlatStyle
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.FlatStyle;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.FlatStyle = value;
- }
- }
-
- public bool IntegralHeight
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.IntegralHeight;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.IntegralHeight = value;
- }
- }
-
- public int MaxDropDownItems
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.MaxDropDownItems;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.MaxDropDownItems = value;
- }
- }
-
- public int SelectedIndex
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.SelectedIndex;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.SelectedIndex = value;
- }
- }
-
- public object SelectedItem
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.SelectedItem;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.SelectedItem = value;
- }
- }
-
- public string SelectedText
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.SelectedText;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.SelectedText = value;
- }
- }
-
- public int SelectionLength
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.SelectionLength;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.SelectionLength = value;
- }
- }
-
- public int SelectionStart
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.SelectionStart;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.SelectionStart = value;
- }
- }
-
- public bool Sorted
- {
- get
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- return ccb.Sorted;
- }
- set
- {
- CustomComboBox ccb = (CustomComboBox)Control;
- ccb.Sorted = value;
- }
- }
- }
-}
diff --git a/MsmhTools/CustomControls/CustomToolStripRenderer.cs b/MsmhTools/CustomControls/CustomToolStripRenderer.cs
deleted file mode 100644
index efdaa2e..0000000
--- a/MsmhTools/CustomControls/CustomToolStripRenderer.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing.Drawing2D;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 20, 2022.
-*/
-
-namespace CustomControls
-{
- public class CustomToolStripRenderer : ToolStripProfessionalRenderer
- {
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- }
- }
- }
-
- private Color mSelectionColor = Color.LightBlue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Selection Color")]
- public Color SelectionColor
- {
- get { return mSelectionColor; }
- set
- {
- if (mSelectionColor != value)
- {
- mSelectionColor = value;
- }
- }
- }
-
- protected override void OnRenderSeparator(ToolStripSeparatorRenderEventArgs e)
- {
- if (e.Item as ToolStripSeparator == null)
- base.OnRenderSeparator(e);
- else
- {
- var toolStripSeparator = e.Item as ToolStripSeparator;
- Rectangle rect = e.Item.Bounds;
-
- // Paint Background
- using SolidBrush bgBrush = new(toolStripSeparator.BackColor);
- e.Graphics.FillRectangle(bgBrush, rect);
-
- Color line2;
- if (toolStripSeparator.ForeColor.DarkOrLight() == "Dark")
- line2 = ControlPaint.Light(toolStripSeparator.ForeColor);
- else
- line2 = ControlPaint.Dark(toolStripSeparator.ForeColor);
- if (e.Vertical)
- {
- // Paint Vertical Separator
- Rectangle bounds = rect;
- bounds.Y += 3;
- bounds.Height = Math.Max(0, bounds.Height - 6);
- if (bounds.Height >= 4) bounds.Inflate(0, -2);
- int x = bounds.Width / 2;
- using Pen pen1 = new(toolStripSeparator.ForeColor);
- e.Graphics.DrawLine(pen1, x, bounds.Top, x, bounds.Bottom - 1);
- using Pen pen2 = new(line2);
- e.Graphics.DrawLine(pen2, x + 1, bounds.Top + 1, x + 1, bounds.Bottom);
- }
- else
- {
- // Paint Horizontal Separator
- Rectangle bounds = rect;
- int x = 25;
- int y = bounds.Height / 2;
- using Pen pen1 = new(toolStripSeparator.ForeColor);
- e.Graphics.DrawLine(pen1, x, y, bounds.Right - 2, y);
- using Pen pen2 = new(line2);
- e.Graphics.DrawLine(pen2, x + 1, y + 1, bounds.Right - 1, y + 1);
- }
- }
- }
-
- protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)
- {
- using SolidBrush brush = new(BackColor);
- e.Graphics.FillRectangle(brush, e.ConnectedArea);
- e.Graphics.FillRectangle(brush, e.AffectedBounds); // Contains Border Color of DropDownMenuItem's Container
- }
-
- protected override void OnRenderToolStripBorder(ToolStripRenderEventArgs e)
- {
- if (e.ToolStrip is null)
- {
- base.OnRenderToolStripBorder(e);
- }
- }
-
- protected override void OnRenderImageMargin(ToolStripRenderEventArgs e)
- {
- Rectangle rect = new(0, 0, e.ToolStrip.Width, e.ToolStrip.Height);
- ControlPaint.DrawBorder(e.Graphics, rect, BorderColor, ButtonBorderStyle.Solid);
- }
-
- protected override void OnRenderItemCheck(ToolStripItemImageRenderEventArgs e)
- {
- Rectangle rect = new(e.ImageRectangle.Left - 2, e.ImageRectangle.Top - 2,
- e.ImageRectangle.Width + 4, e.ImageRectangle.Height + 4);
-
- if (e.Item.ImageIndex == -1 && string.IsNullOrEmpty(e.Item.ImageKey) && e.Item.Image == null)
- {
- // Draw Check
- using Pen pen = new(ForeColor, 2);
- rect.Inflate(-6, -6);
- e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
- Point[] points = new Point[]
- {
- new Point(rect.Left, rect.Bottom - rect.Height / 2),
- new Point(rect.Left + rect.Width / 3, rect.Bottom),
- new Point(rect.Right, rect.Top)
- };
- e.Graphics.DrawLines(pen, points);
- e.Graphics.SmoothingMode = SmoothingMode.Default;
- rect.Inflate(+6, +6);
- }
- }
-
- protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e)
- {
- Color bgColor = e.Item.Selected ? SelectionColor : e.Item.BackColor;
-
- if (!e.Item.Enabled)
- bgColor = e.Item.BackColor;
-
- // Normal Item
- Rectangle rect = new(2, 0, e.Item.Width - 3, e.Item.Height);
-
- using SolidBrush sb1 = new(bgColor);
- e.Graphics.FillRectangle(sb1, rect);
-
- // Header Item On Open Menu
- if (e.Item.GetType() == typeof(ToolStripMenuItem))
- {
- if (((ToolStripMenuItem)e.Item).DropDown.Visible && e.Item.IsOnDropDown == false)
- {
- using SolidBrush sb2 = new(BackColor);
- e.Graphics.FillRectangle(sb2, rect);
- }
- }
- }
-
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomToolStripTextBox.cs b/MsmhTools/CustomControls/CustomToolStripTextBox.cs
deleted file mode 100644
index 5daac38..0000000
--- a/MsmhTools/CustomControls/CustomToolStripTextBox.cs
+++ /dev/null
@@ -1,424 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms.Design;
-/*
-* Copyright MSasanMH, June 20, 2022.
-* Needs CustomTextBox.
-*/
-
-namespace CustomControls
-{
- [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
- [ToolboxBitmap(typeof(CustomToolStripComboBox), "")]
- public class CustomToolStripTextBox : ToolStripControlHost
- {
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public override Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- TextBox.BackColor = BackColor;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- TextBox.ForeColor = ForeColor;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Blue;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- TextBox.BorderColor = BorderColor;
- Invalidate();
- }
- }
- }
-
- public new event EventHandler? EnabledChanged;
- public event EventHandler? MultilineChanged;
- public new event EventHandler? RightToLeftChanged;
- public event EventHandler? TextAlignChanged;
- public new event EventHandler? TextChanged;
-
- public CustomToolStripTextBox() : base(new CustomTextBox())
- {
- TextBox.TextChanged += TextBox_TextChanged;
- TextBox.EnabledChanged += TextBox_EnabledChanged;
- TextBox.MultilineChanged += TextBox_MultilineChanged;
- TextBox.RightToLeftChanged += TextBox_RightToLeftChanged;
- TextBox.TextAlignChanged += TextBox_TextAlignChanged;
- }
-
- private void TextBox_TextChanged(object? sender, EventArgs e)
- {
- TextChanged?.Invoke(sender, e);
- }
-
- private void TextBox_EnabledChanged(object? sender, EventArgs e)
- {
- EnabledChanged?.Invoke(sender, e);
- }
-
- private void TextBox_MultilineChanged(object? sender, EventArgs e)
- {
- MultilineChanged?.Invoke(sender, e);
- }
-
- private void TextBox_RightToLeftChanged(object? sender, EventArgs e)
- {
- RightToLeftChanged?.Invoke(sender, e);
- }
-
- private void TextBox_TextAlignChanged(object? sender, EventArgs e)
- {
- TextAlignChanged?.Invoke(sender, e);
- }
-
- public CustomTextBox TextBox
- {
- get { return (CustomTextBox)Control; }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Right To Left Mode")]
- public override RightToLeft RightToLeft
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.RightToLeft;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.RightToLeft = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("ScrollBar")]
- public ScrollBars ScrollBars
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.ScrollBars;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.ScrollBars = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Text")]
- public override string Text
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.Text;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.Text = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Text Align")]
- public new HorizontalAlignment TextAlign
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.TextAlign;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.TextAlign = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Underlined Style Border")]
- public bool UnderlinedStyle
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.UnderlinedStyle;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.UnderlinedStyle = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Appearance"), Description("Use Wait Cursor")]
- public bool UseWaitCursor
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.UseWaitCursor;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.UseWaitCursor = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Accepts Return")]
- public bool AcceptsReturn
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.AcceptsReturn;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.AcceptsReturn = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Accepts Tab")]
- public bool AcceptsTab
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.AcceptsTab;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.AcceptsTab = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Allow Drop")]
- public override bool AllowDrop
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.AllowDrop;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.AllowDrop = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Character Casing")]
- public CharacterCasing CharacterCasing
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.CharacterCasing;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.CharacterCasing = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Enable Or Disable Control")]
- public override bool Enabled
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.Enabled;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.Enabled = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Hide Selection")]
- public bool HideSelection
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.HideSelection;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.HideSelection = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Max Length")]
- public int MaxLength
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.MaxLength;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.MaxLength = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Multiline Style")]
- public bool Multiline
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.Multiline;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.Multiline = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Read Only")]
- public bool ReadOnly
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.ReadOnly;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.ReadOnly = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Password Style")]
- public bool UsePasswordChar
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.UsePasswordChar;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.UsePasswordChar = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Visible")]
- public new bool Visible
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.Visible;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.Visible = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Word Wrap Mode")]
- public bool WordWrap
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.WordWrap;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.WordWrap = value;
- }
- }
-
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Layout"), Description("Auto Size")]
- public new bool AutoSize
- {
- get
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- return ctb.AutoSize;
- }
- set
- {
- CustomTextBox ctb = (CustomTextBox)Control;
- ctb.AutoSize = value;
- }
- }
-
- }
-}
diff --git a/MsmhTools/CustomControls/CustomVScrollBar.cs b/MsmhTools/CustomControls/CustomVScrollBar.cs
deleted file mode 100644
index e3a46d6..0000000
--- a/MsmhTools/CustomControls/CustomVScrollBar.cs
+++ /dev/null
@@ -1,705 +0,0 @@
-using MsmhTools;
-using System;
-using System.ComponentModel;
-using System.Windows.Forms.Design;
-using System.Diagnostics;
-/*
-* Copyright MSasanMH, May 10, 2022.
-*/
-
-namespace CustomControls
-{
- [Designer(typeof(ScrollBarControlDesigner))]
- public class CustomVScrollBar : UserControl
- {
- [Browsable(false)]
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Obsolete("Mark as deprecated.", true)]
- public new BorderStyle BorderStyle { get; set; }
-
- protected int mNewValue = 0;
- private int nClickPoint;
-
- protected int mThumbTop = 0;
-
- protected bool mAutoSize = false;
-
- private bool mThumbDown = false;
- private bool mThumbDragging = false;
- private bool mDown = false;
-
- public new event EventHandler Scroll = null;
- public event EventHandler? ValueChanged = null;
-
- private static readonly int ScrollBarWidth = 16;
- private static readonly int ScrollBarWidthMin = 14;
- private static readonly int ScrollBarWidthMax = 30;
- private static readonly int ThumbMinHeight = 20;
- private static Size UpArrow = new(ScrollBarWidth, ScrollBarWidth);
- private static Size Thumb = new(ScrollBarWidth, ThumbMinHeight);
- private static Size DownArrow = new(ScrollBarWidth, ScrollBarWidth);
-
- private static Rectangle rect;
- private static Rectangle rectUpArrow;
- private static Rectangle rectThumb;
- private static Rectangle rectDownArrow;
-
- private Color mBackColor = Color.DimGray;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Back Color")]
- public override Color BackColor
- {
- get { return mBackColor; }
- set
- {
- if (mBackColor != value)
- {
- mBackColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mForeColor = Color.White;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Fore Color")]
- public override Color ForeColor
- {
- get { return mForeColor; }
- set
- {
- if (mForeColor != value)
- {
- mForeColor = value;
- Invalidate();
- }
- }
- }
-
- private Color mBorderColor = Color.Red;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Editor(typeof(WindowsFormsComponentEditor), typeof(Color))]
- [Category("Appearance"), Description("Border Color")]
- public Color BorderColor
- {
- get { return mBorderColor; }
- set
- {
- if (mBorderColor != value)
- {
- mBorderColor = value;
- Invalidate();
- }
- }
- }
-
- protected int mLargeChange = 10;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Large Change")]
- public int LargeChange
- {
- get { return mLargeChange; }
- set
- {
- mLargeChange = value;
- Invalidate();
- }
- }
-
- protected int mSmallChange = 1;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Small Change")]
- public int SmallChange
- {
- get { return mSmallChange; }
- set
- {
- mSmallChange = value;
- Invalidate();
- }
- }
-
- protected int mMinimum = 0;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Minimum")]
- public int Minimum
- {
- get { return mMinimum; }
- set
- {
- mMinimum = value;
- Invalidate();
- }
- }
-
- protected int mMaximum = 100;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Maximum")]
- public int Maximum
- {
- get { return mMaximum; }
- set
- {
- mMaximum = value;
- Invalidate();
- }
- }
-
- protected int mValue = 0;
- [EditorBrowsable(EditorBrowsableState.Always), Browsable(true)]
- [Category("Behavior"), Description("Value")]
- public int Value
- {
- get
- {
- if (mValue < Minimum)
- mValue = Minimum;
- else if (mValue > Maximum)
- mValue = Maximum;
- return mValue;
- }
- set
- {
- mValue = value;
-
- int nTrackHeight = Height - (UpArrow.Height + DownArrow.Height);
- int nThumbHeight = (int)GetThumbHeight();
-
- // Compute Value
- int nPixelRange = nTrackHeight - nThumbHeight;
- int nRealRange = Maximum - Minimum - LargeChange;
- float fPerc = 0.0f;
- if (nRealRange != 0)
- {
- fPerc = (float)mValue / nRealRange;
- }
-
- float fTop = fPerc * nPixelRange;
- mThumbTop = (int)fTop;
- Invalidate();
- }
- }
-
- public override bool AutoSize
- {
- get { return base.AutoSize; }
- set
- {
- base.AutoSize = value;
- if (base.AutoSize)
- {
- Width = UpArrow.Width;
- }
- }
- }
-
- private static Color[]? OriginalColors;
- private bool once = true;
-
- public CustomVScrollBar() : base()
- {
- SuspendLayout();
- Name = "CustomVScrollBar";
- SetStyle(ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer |
- ControlStyles.ResizeRedraw |
- ControlStyles.UserPaint, true);
-
- Width = ScrollBarWidth;
- base.MinimumSize = new Size(ScrollBarWidthMin, UpArrow.Height + Thumb.Height + DownArrow.Height);
-
- // Events
- MouseWheel += CustomVScrollBar_MouseWheel;
- MouseDown += CustomVScrollBar_MouseDown;
- MouseMove += CustomVScrollBar_MouseMove;
- MouseUp += CustomVScrollBar_MouseUp;
- LocationChanged += CustomVScrollBar_LocationChanged;
- Move += CustomVScrollBar_Move;
- EnabledChanged += CustomVScrollBar_EnabledChanged;
- Application.Idle += Application_Idle;
- ResumeLayout(false);
- }
-
- private void Application_Idle(object? sender, EventArgs e)
- {
- if (Parent != null && FindForm() != null)
- {
- if (once)
- {
- Parent.MouseWheel -= Parent_MouseWheel;
- Parent.MouseWheel += Parent_MouseWheel;
- Control topParent = FindForm();
- topParent.Move -= TopParent_Move;
- topParent.Move += TopParent_Move;
- Parent.Move -= Parent_Move;
- Parent.Move += Parent_Move;
- Invalidate();
- once = false;
- }
- }
- }
-
- private void TopParent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_Move(object? sender, EventArgs e)
- {
- Invalidate();
- }
-
- private void Parent_MouseWheel(object? sender, MouseEventArgs e)
- {
- CustomVScrollBar_MouseWheel(sender, e);
- }
-
- private void CustomVScrollBar_LocationChanged(object? sender, EventArgs e)
- {
- var csb = sender as CustomVScrollBar;
- csb.Invalidate();
- }
-
- private void CustomVScrollBar_Move(object? sender, EventArgs e)
- {
- var csb = sender as CustomVScrollBar;
- csb.Invalidate();
- }
-
- private void CustomVScrollBar_EnabledChanged(object? sender, EventArgs e)
- {
- var csb = sender as CustomVScrollBar;
- csb.Invalidate();
- }
-
- private void CustomVScrollBar_MouseWheel(object? sender, MouseEventArgs e)
- {
- if (!Enabled)
- return;
-
- int nTrackHeight = Height - (UpArrow.Height + DownArrow.Height);
- int nThumbHeight = (int)GetThumbHeight();
-
- int nRealRange = Maximum - Minimum - LargeChange;
- int nPixelRange = nTrackHeight - nThumbHeight;
- if (e.Delta > 0)
- {
- Value -= SmallChange;
- Value = Math.Max(Value, 0);
- MoveThumb(e.Y);
- Debug.WriteLine(Value);
- }
- else
- {
- if (nRealRange > 0)
- {
- if (nPixelRange > 0)
- {
- Value += SmallChange;
- if ((mThumbTop + SmallChange) > nPixelRange)
- {
- mThumbTop = nPixelRange;
- // Compute Value
- float fPerc = mThumbTop / nPixelRange;
- float fValue = fPerc * (Maximum - LargeChange);
- Value = (int)fValue;
- }
- MoveThumb(e.Y);
- Debug.WriteLine(Value);
- }
- }
- }
-
- ValueChanged?.Invoke(this, new EventArgs());
- Scroll?.Invoke(this, new EventArgs());
- }
-
- private void CustomVScrollBar_MouseDown(object? sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Right || e.Button == MouseButtons.Middle)
- return;
- Debug.WriteLine("Mouse Down");
- mDown = true;
- Point ptPoint = PointToClient(Cursor.Position);
-
- int nTrackHeight = Height - (UpArrow.Height + DownArrow.Height);
- int nThumbHeight = (int)GetThumbHeight();
-
- int nTop = mThumbTop;
- nTop += UpArrow.Height;
-
- int nRealRange = Maximum - Minimum - LargeChange;
- int nPixelRange = nTrackHeight - nThumbHeight;
-
- // rectUpArrow Action
- if (rectUpArrow.Contains(ptPoint))
- {
- if (nRealRange > 0)
- {
- if (nPixelRange > 0)
- {
- while (mDown == true)
- {
- Value -= SmallChange;
- Value = Math.Max(Value, 0);
- MoveThumb(e.Y);
- Debug.WriteLine(Value);
-
- ValueChanged?.Invoke(this, new EventArgs());
- Scroll?.Invoke(this, new EventArgs());
-
- Invalidate();
- Task.Delay(10).Wait();
- Application.DoEvents();
- if (mDown == false)
- break;
- }
- }
- }
- }
-
- // rectThumbBefore Action
- Rectangle rectThumbBefore = new(new Point(1, UpArrow.Height), new Size(Thumb.Width, nTop - (UpArrow.Height)));
- if (rectThumbBefore.Contains(ptPoint))
- {
- if (nRealRange > 0)
- {
- if (nPixelRange > 0)
- {
- while (mDown == true)
- {
- Value -= LargeChange;
- if (mThumbTop + UpArrow.Height < e.Y)
- {
- if (mThumbTop <= 0)
- {
- mThumbTop = 0;
- }
- return;
- }
- Value = Math.Max(Value, 0);
- MoveThumb(e.Y);
- Debug.WriteLine(Value);
- Task.Delay(10).Wait();
- Application.DoEvents();
- if (mDown == false)
- break;
- }
- }
- }
- }
-
- // rectThumb Action
- if (rectThumb.Contains(ptPoint))
- {
- // Hit the thumb
- nClickPoint = ptPoint.Y - nTop;
- mThumbDown = true;
- }
-
- // rectThumbAfter Action
- Rectangle rectThumbAfter = new(1, nTop + Thumb.Height, Thumb.Width, Height - (nTop + Thumb.Height) - (DownArrow.Height));
- if (rectThumbAfter.Contains(ptPoint))
- {
- if (nRealRange > 0)
- {
- if (nPixelRange > 0)
- {
- while (mDown == true)
- {
- Value += LargeChange;
- if (mThumbTop + Thumb.Height > e.Y)
- {
- if (mThumbTop >= nPixelRange)
- {
- mThumbTop = nPixelRange;
- }
- return;
- }
- if ((mThumbTop + SmallChange) > nPixelRange)
- {
- mThumbTop = nPixelRange;
- // Compute Value
- float fPerc = mThumbTop / nPixelRange;
- float fValue = fPerc * (Maximum - LargeChange);
- Value = (int)fValue;
- }
- MoveThumb(e.Y);
- Debug.WriteLine(Value);
- Task.Delay(10).Wait();
- Application.DoEvents();
- if (mDown == false)
- break;
- }
- }
- }
- }
-
- // rectDownArrow Action
- if (rectDownArrow.Contains(ptPoint))
- {
- if (nRealRange > 0)
- {
- if (nPixelRange > 0)
- {
- while (mDown == true)
- {
- Value += SmallChange;
- if ((mThumbTop + SmallChange) > nPixelRange)
- {
- mThumbTop = nPixelRange;
- // Compute Value
- float fPerc = mThumbTop / nPixelRange;
- float fValue = fPerc * (Maximum - LargeChange);
- Value = (int)fValue;
- }
- MoveThumb(e.Y);
- Debug.WriteLine(Value);
-
- ValueChanged?.Invoke(this, new EventArgs());
- Scroll?.Invoke(this, new EventArgs());
-
- Invalidate();
- Task.Delay(10).Wait();
- Application.DoEvents();
- if (mDown == false)
- break;
- }
- }
- }
- }
- }
-
- private void CustomVScrollBar_MouseUp(object? sender, MouseEventArgs e)
- {
- Debug.WriteLine("Mouse Up");
- mThumbDown = false;
- mThumbDragging = false;
- mDown = false;
- }
-
- private void CustomVScrollBar_MouseMove(object? sender, MouseEventArgs e)
- {
- if (mThumbDown == true)
- {
- mThumbDragging = true;
- }
-
- if (mThumbDragging)
- {
- MoveThumb(e.Y);
- }
-
- ValueChanged?.Invoke(this, new EventArgs());
- Scroll?.Invoke(this, new EventArgs());
- }
-
- protected override void OnPaint(PaintEventArgs e)
- {
- // Update Colors
- OriginalColors = new Color[] { BackColor, ForeColor, BorderColor };
-
- // Set Maximum Size
- Width = Math.Min(Width, ScrollBarWidthMax);
-
- // Update Size
- UpArrow = new(Width, Width);
- Thumb = new(Width, (int)GetThumbHeight());
- DownArrow = new(Width, Width);
- base.MinimumSize = new Size(ScrollBarWidthMin, UpArrow.Height + ThumbMinHeight + DownArrow.Height);
-
- //Thumb.Height = (int)GetThumbHeight();
-
- e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
-
- if (OriginalColors == null)
- return;
-
- Color backColor;
- Color foreColor;
- Color borderColor;
-
- if (Enabled)
- {
- backColor = OriginalColors[0];
- foreColor = OriginalColors[1];
- borderColor = OriginalColors[2];
- }
- else
- {
- // Disabled Colors
- if (OriginalColors[0].DarkOrLight() == "Dark")
- backColor = OriginalColors[0].ChangeBrightness(0.3f);
- else
- backColor = OriginalColors[0].ChangeBrightness(-0.3f);
-
- if (OriginalColors[1].DarkOrLight() == "Dark")
- foreColor = OriginalColors[1].ChangeBrightness(0.2f);
- else
- foreColor = OriginalColors[1].ChangeBrightness(-0.2f);
-
- if (OriginalColors[2].DarkOrLight() == "Dark")
- borderColor = OriginalColors[2].ChangeBrightness(0.3f);
- else
- borderColor = OriginalColors[2].ChangeBrightness(-0.3f);
- }
-
- // Fill Background
- using Brush sb0 = new SolidBrush(backColor);
- rect = new(0, 0, Width, Height);
- e.Graphics.FillRectangle(sb0, rect);
-
- // Draw Up Arrow BG
- using SolidBrush sbUpArrow = new(foreColor);
- rectUpArrow = new(rect.X + 2, rect.Y, rect.Width - 4, UpArrow.Height);
- e.Graphics.FillRectangle(sbUpArrow, rectUpArrow);
-
- // Draw Up Spaces
- using Pen penUpArrow = new(backColor);
- e.Graphics.DrawLine(penUpArrow, rectUpArrow.X, rectUpArrow.Y, rectUpArrow.X + rectUpArrow.Width - 1, rectUpArrow.Y);
- e.Graphics.DrawLine(penUpArrow, rectUpArrow.X, rectUpArrow.Y + 1, rectUpArrow.X + rectUpArrow.Width - 1, rectUpArrow.Y + 1);
- e.Graphics.DrawLine(penUpArrow, rectUpArrow.X, rectUpArrow.Y + rectUpArrow.Height - 1, rectUpArrow.X + rectUpArrow.Width - 1, rectUpArrow.Y + rectUpArrow.Height - 1);
-
- // Draw Up Arrow Button Icon
- var pthUpArrow = new System.Drawing.Drawing2D.GraphicsPath();
- var TopUpArrow = new PointF(rectUpArrow.X + rectUpArrow.Width / 2, rectUpArrow.Y + rectUpArrow.Height * 2 / 5);
- var ButtomLeftUpArrow = new PointF(rectUpArrow.X + rectUpArrow.Width * 1 / 5, rectUpArrow.Y + rectUpArrow.Height * 3 / 5);
- var BottomRightUpArrow = new PointF(rectUpArrow.X + rectUpArrow.Width * 4 / 5, rectUpArrow.Y + rectUpArrow.Height * 3 / 5);
- pthUpArrow.AddLine(TopUpArrow, ButtomLeftUpArrow);
- pthUpArrow.AddLine(ButtomLeftUpArrow, BottomRightUpArrow);
-
- // Draw Up Arrow
- using SolidBrush arrowBrushUpArrow = new(backColor);
- e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
- e.Graphics.FillPath(arrowBrushUpArrow, pthUpArrow);
- e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
-
- //Thumb Location
- int nTop = mThumbTop;
- nTop += UpArrow.Height;
-
- //Draw Thumb
- using SolidBrush sb3 = new(foreColor);
- rectThumb = new(rectUpArrow.X, nTop, rectUpArrow.Width, Thumb.Height);
- e.Graphics.FillRectangle(sb3, rectThumb);
-
- // Draw Down Arrow BG
- using SolidBrush sbDownArrow = new(foreColor);
- rectDownArrow = new(rectUpArrow.X, Height - DownArrow.Height, rectUpArrow.Width, DownArrow.Height);
- e.Graphics.FillRectangle(sbDownArrow, rectDownArrow);
-
- // Draw Down Spaces
- using Pen penDownArrow = new(backColor);
- e.Graphics.DrawLine(penDownArrow, rectDownArrow.X, rectDownArrow.Y, rectDownArrow.X + rectDownArrow.Width - 1, rectDownArrow.Y);
- e.Graphics.DrawLine(penDownArrow, rectDownArrow.X, rectDownArrow.Y + rectDownArrow.Height - 1, rectDownArrow.X + rectDownArrow.Width - 1, rectDownArrow.Y + rectDownArrow.Height - 1);
- e.Graphics.DrawLine(penDownArrow, rectDownArrow.X, rectDownArrow.Y + rectDownArrow.Height - 2, rectDownArrow.X + rectDownArrow.Width - 1, rectDownArrow.Y + rectDownArrow.Height - 2);
-
- // Draw Down Arrow Button Icon
- var pthDownArrow = new System.Drawing.Drawing2D.GraphicsPath();
- var TopLeftDownArrow = new PointF(rectDownArrow.X + rectDownArrow.Width * 1 / 5, rectDownArrow.Y + rectDownArrow.Height * 2 / 5);
- var TopRightDownArrow = new PointF(rectDownArrow.X + rectDownArrow.Width * 4 / 5, rectDownArrow.Y + rectDownArrow.Height * 2 / 5);
- var BottomDownArrow = new PointF(rectDownArrow.X + rectDownArrow.Width / 2, rectDownArrow.Y + rectDownArrow.Height * 3 / 5);
- pthDownArrow.AddLine(TopLeftDownArrow, TopRightDownArrow);
- pthDownArrow.AddLine(TopRightDownArrow, BottomDownArrow);
-
- // Draw Down Arrow
- using SolidBrush arrowBrushDownArrow = new(backColor);
- e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
- e.Graphics.FillPath(arrowBrushDownArrow, pthDownArrow);
- e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
-
- // Draw Border
- using Pen penBorder = new(borderColor);
- Rectangle rectBorder = new(rect.X, rect.Y, rect.Width - 1, rect.Height - 1);
- e.Graphics.DrawRectangle(penBorder, rectBorder);
- }
-
- private float GetThumbHeight()
- {
- int nTrackHeight = Height - (UpArrow.Height + DownArrow.Height);
- //float eachRowHeight = nTrackHeight / (float)LargeChange;
- float fThumbHeight = (float)LargeChange / Maximum * nTrackHeight;
- int nThumbHeight = (int)fThumbHeight;
- if (nThumbHeight < ThumbMinHeight)
- {
- nThumbHeight = ThumbMinHeight;
- fThumbHeight = (float)ThumbMinHeight;
- }
- else if (nThumbHeight > nTrackHeight)
- {
- nThumbHeight = nTrackHeight;
- fThumbHeight = (float)nTrackHeight;
- }
- Thumb.Height = nThumbHeight;
- return fThumbHeight;
- }
-
- private void MoveThumb(int y)
- {
- int nRealRange = Maximum - Minimum;
- int nTrackHeight = Height - (UpArrow.Height + DownArrow.Height);
- int nThumbHeight = (int)GetThumbHeight();
-
- int nPixelRange = nTrackHeight - nThumbHeight;
- if (mThumbDown && nRealRange > 0)
- {
- //Debug.WriteLine(nPixelRange);
- if (nPixelRange > 0)
- {
- int nNewThumbTop = y - (UpArrow.Height + nClickPoint);
-
- if (nNewThumbTop < 0)
- {
- mThumbTop = 0;
- }
- else if (nNewThumbTop > nPixelRange)
- {
- mThumbTop = nPixelRange;
- }
- else
- {
- mThumbTop = y - (UpArrow.Height + nClickPoint);
- }
-
- //Compute Value
- float fPerc = (float)mThumbTop / nPixelRange;
- float fValue = fPerc * (Maximum - LargeChange);
- mValue = (int)fValue;
- Debug.WriteLine(mValue.ToString());
-
- Application.DoEvents();
-
- Invalidate();
- }
- }
- }
-
- }
-
- internal class ScrollBarControlDesigner : ControlDesigner
- {
- public override SelectionRules SelectionRules
- {
- get
- {
- SelectionRules selectionRules = base.SelectionRules;
- PropertyDescriptor propDescriptor = TypeDescriptor.GetProperties(Component)["AutoSize"];
- if (propDescriptor != null)
- {
- bool autoSize = (bool)propDescriptor.GetValue(Component);
- if (autoSize)
- {
- selectionRules = SelectionRules.Visible | SelectionRules.Moveable | SelectionRules.BottomSizeable | SelectionRules.TopSizeable;
- }
- else
- {
- selectionRules = SelectionRules.Visible | SelectionRules.AllSizeable | SelectionRules.Moveable;
- }
- }
- return selectionRules;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/MsmhTools/CustomControls/CustomVScrollBar.resx b/MsmhTools/CustomControls/CustomVScrollBar.resx
deleted file mode 100644
index 1af7de1..0000000
--- a/MsmhTools/CustomControls/CustomVScrollBar.resx
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/MsmhTools/Library/ColumnSorter.cs b/MsmhTools/Library/ColumnSorter.cs
deleted file mode 100644
index 5509f1a..0000000
--- a/MsmhTools/Library/ColumnSorter.cs
+++ /dev/null
@@ -1,327 +0,0 @@
-using System;
-using System.Collections;
-using System.Text.RegularExpressions;
-using System.Windows.Forms;
-
-namespace PersianSubtitleFixes.ColumnSorter
-{
- ///
- /// This class is an implementation of the 'IComparer' interface.
- ///
- public class ListViewColumnSorter : IComparer
- {
- public enum SortModifiers
- {
- SortByImage,
- SortByCheckbox,
- SortByText
- }
-
- ///
- /// Specifies the column to be sorted
- ///
- public int ColumnToSort;
- ///
- /// Specifies the order in which to sort (i.e. 'Ascending').
- ///
- public SortOrder OrderOfSort;
- ///
- /// Case insensitive comparer object
- ///
-
- private NumberCaseInsensitiveComparer ObjectCompare;
- private ImageTextComparer FirstObjectCompare;
- private CheckboxTextComparer FirstObjectCompare2;
-
- private SortModifiers mySortModifier = SortModifiers.SortByText;
- public SortModifiers _SortModifier
- {
- set
- {
- mySortModifier = value;
- }
- get
- {
- return mySortModifier;
- }
- }
-
- ///
- /// Class constructor. Initializes various elements
- ///
- public ListViewColumnSorter()
- {
- // Initialize the column to '0'
- ColumnToSort = 0;
-
- // Initialize the CaseInsensitiveComparer object
- ObjectCompare = new NumberCaseInsensitiveComparer();
- FirstObjectCompare = new ImageTextComparer();
- FirstObjectCompare2 = new CheckboxTextComparer();
- }
-
- ///
- /// This method is inherited from the IComparer interface. It compares the two objects passed using a case insensitive comparison.
- ///
- /// First object to be compared
- /// Second object to be compared
- /// The result of the comparison. "0" if equal, negative if 'x' is less than 'y' and positive if 'x' is greater than 'y'
- public int Compare(object x, object y)
- {
- int compareResult = 0;
- ListViewItem listviewX, listviewY;
-
- // Cast the objects to be compared to ListViewItem objects
- listviewX = (ListViewItem)x;
- listviewY = (ListViewItem)y;
-
- ListView listViewMain = listviewX.ListView;
-
- // Calculate correct return value based on object comparison
- if (listViewMain.Sorting != SortOrder.Ascending &&
- listViewMain.Sorting != SortOrder.Descending)
- {
- // Return '0' to indicate they are equal
- return compareResult;
- }
-
- if (mySortModifier.Equals(SortModifiers.SortByText) || ColumnToSort > 0)
- {
- // Compare the two items
-
- if (listviewX.SubItems.Count <= ColumnToSort &&
- listviewY.SubItems.Count <= ColumnToSort)
- {
- compareResult = ObjectCompare.Compare(null, null);
- }
- else if (listviewX.SubItems.Count <= ColumnToSort &&
- listviewY.SubItems.Count > ColumnToSort)
- {
- compareResult = ObjectCompare.Compare(null, listviewY.SubItems[ColumnToSort].Text.Trim());
- }
- else if (listviewX.SubItems.Count > ColumnToSort && listviewY.SubItems.Count <= ColumnToSort)
- {
- compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text.Trim(), null);
- }
- else
- {
- compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text.Trim(), listviewY.SubItems[ColumnToSort].Text.Trim());
- }
- }
- else
- {
- switch (mySortModifier)
- {
- case SortModifiers.SortByCheckbox:
- compareResult = FirstObjectCompare2.Compare(x, y);
- break;
- case SortModifiers.SortByImage:
- compareResult = FirstObjectCompare.Compare(x, y);
- break;
- default:
- compareResult = FirstObjectCompare.Compare(x, y);
- break;
- }
- }
-
- // Calculate correct return value based on object comparison
- if (OrderOfSort == SortOrder.Ascending)
- {
- // Ascending sort is selected, return normal result of compare operation
- return compareResult;
- }
- else if (OrderOfSort == SortOrder.Descending)
- {
- // Descending sort is selected, return negative result of compare operation
- return (-compareResult);
- }
- else
- {
- // Return '0' to indicate they are equal
- return 0;
- }
- }
-
- ///
- /// Gets or sets the number of the column to which to apply the sorting operation (Defaults to '0').
- ///
- public int SortColumn
- {
- set
- {
- ColumnToSort = value;
- }
- get
- {
- return ColumnToSort;
- }
- }
-
- ///
- /// Gets or sets the order of sorting to apply (for example, 'Ascending' or 'Descending').
- ///
- public SortOrder Order
- {
- set
- {
- OrderOfSort = value;
- }
- get
- {
- return OrderOfSort;
- }
- }
-
- }
-
- public class ImageTextComparer : IComparer
- {
- //private CaseInsensitiveComparer ObjectCompare;
- private NumberCaseInsensitiveComparer ObjectCompare;
-
- public ImageTextComparer()
- {
- // Initialize the CaseInsensitiveComparer object
- ObjectCompare = new NumberCaseInsensitiveComparer();
- }
-
- public int Compare(object x, object y)
- {
- //int compareResult;
- int image1, image2;
- ListViewItem listviewX, listviewY;
-
- // Cast the objects to be compared to ListViewItem objects
- listviewX = (ListViewItem)x;
- image1 = listviewX.ImageIndex;
- listviewY = (ListViewItem)y;
- image2 = listviewY.ImageIndex;
-
- if (image1 < image2)
- {
- return -1;
- }
- else if (image1 == image2)
- {
- return ObjectCompare.Compare(listviewX.Text.Trim(), listviewY.Text.Trim());
- }
- else
- {
- return 1;
- }
- }
- }
-
- public class CheckboxTextComparer : IComparer
- {
- private NumberCaseInsensitiveComparer ObjectCompare;
-
- public CheckboxTextComparer()
- {
- // Initialize the CaseInsensitiveComparer object
- ObjectCompare = new NumberCaseInsensitiveComparer();
- }
-
- public int Compare(object x, object y)
- {
- // Cast the objects to be compared to ListViewItem objects
- ListViewItem listviewX = (ListViewItem)x;
- ListViewItem listviewY = (ListViewItem)y;
-
- if (listviewX.Checked && !listviewY.Checked)
- {
- return -1;
- }
- else if (listviewX.Checked.Equals(listviewY.Checked))
- {
- if (listviewX.ImageIndex < listviewY.ImageIndex)
- {
- return -1;
- }
- else if (listviewX.ImageIndex == listviewY.ImageIndex)
- {
- return ObjectCompare.Compare(listviewX.Text.Trim(), listviewY.Text.Trim());
- }
- else
- {
- return 1;
- }
- }
- else
- {
- return 1;
- }
- }
- }
-
-
- public class NumberCaseInsensitiveComparer : CaseInsensitiveComparer
- {
- public NumberCaseInsensitiveComparer ()
- {
-
- }
-
- public new int Compare(object x, object y)
- {
- if (x == null && y == null)
- {
- return 0;
- }
- else if (x == null && y != null)
- {
- return -1;
- }
- else if (x != null && y == null)
- {
- return 1;
- }
-
- if ((x is System.String) && IsDecimalNumber((string)x) && (y is System.String) && IsDecimalNumber((string)y))
- {
- try
- {
- decimal xx= Decimal.Parse(((string)x).Trim());
- decimal yy= Decimal.Parse(((string)y).Trim());
-
- return base.Compare(xx,yy);
- }
- catch
- {
- return -1;
- }
- }
- else
- {
- return base.Compare(x,y);
- }
- }
-
- // deprecated
- //private bool IsWholeNumber(string strNumber)
- //{
- // Regex wholePattern = new Regex(@"^\d+$");
- // return wholePattern.IsMatch(strNumber);
- //}
-
- private string GetNumberDecimalSeparator()
- {
- return System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
- }
-
- // http://stackoverflow.com/questions/4246077/matching-numbers-with-regular-expressions-only-digits-and-commas/4247184#4247184
- // https://www.debuggex.com/r/Lyx0F0y1LORvNhwA
- private bool IsDecimalNumber(string strNumber)
- {
- //@"^-?(\d+|(\d{1,3}((,|\.)\d{3})*))((,|\.)\d+)?$"
-
- //string regex = @"^-?(?:(?:0|[1-9][0-9]*)(?:" + GetNumberDecimalSeparator() + @"[0-9]+)?|[1-9][0-9]{1,2}(?:,[0-9]{3})+)$";
-
- string regex = @"^-?(\d+|(\d{1,3}((,|\.)\d{3})*))((,|\.)\d+)?$";
-
- Regex wholePattern = new Regex(regex);
- return wholePattern.IsMatch(strNumber);
- }
- }
-
-}
diff --git a/MsmhTools/Library/Crc32.NET.dll b/MsmhTools/Library/Crc32.NET.dll
deleted file mode 100644
index 21213ed..0000000
Binary files a/MsmhTools/Library/Crc32.NET.dll and /dev/null differ
diff --git a/MsmhTools/Library/UtfUnknown.dll b/MsmhTools/Library/UtfUnknown.dll
deleted file mode 100644
index 49ea45a..0000000
Binary files a/MsmhTools/Library/UtfUnknown.dll and /dev/null differ
diff --git a/MsmhTools/Library/libse.dll b/MsmhTools/Library/libse.dll
deleted file mode 100644
index ecee723..0000000
Binary files a/MsmhTools/Library/libse.dll and /dev/null differ
diff --git a/MsmhTools/MsmhTools.csproj b/MsmhTools/MsmhTools.csproj
deleted file mode 100644
index 277c668..0000000
--- a/MsmhTools/MsmhTools.csproj
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- Library
- net6.0-windows
- enable
- true
- enable
- $(VersionPrefix)1.2.0
- $(Authors)MSasanMH
- MSasanMH
-
-
-
-
-
-
-
-
- Library\Crc32.NET.dll
-
-
-
-
\ No newline at end of file
diff --git a/MsmhTools/MsmhTools.csproj.user b/MsmhTools/MsmhTools.csproj.user
deleted file mode 100644
index 870f28e..0000000
--- a/MsmhTools/MsmhTools.csproj.user
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
- <_LastSelectedProfileId>D:\PPWin\SecureDNSClient\MsmhTools\Properties\PublishProfiles\FolderProfile.pubxml
-
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Form
-
-
- Component
-
-
- Component
-
-
- Form
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- UserControl
-
-
- Component
-
-
- Component
-
-
- UserControl
-
-
- UserControl
-
-
- Component
-
-
- Component
-
-
- Component
-
-
- UserControl
-
-
-
\ No newline at end of file
diff --git a/MsmhTools/MsmhTools/CenterWinDialog.cs b/MsmhTools/MsmhTools/CenterWinDialog.cs
deleted file mode 100644
index 056df3d..0000000
--- a/MsmhTools/MsmhTools/CenterWinDialog.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Text;
-using System.Runtime.InteropServices;
-
-namespace MsmhTools
-{
- public class CenterWinDialog : IDisposable
- {
- private int mTries = 0;
- private readonly Form mOwner;
- public CenterWinDialog(Form owner)
- {
- mOwner = owner;
- if (owner.WindowState != FormWindowState.Minimized)
- owner.BeginInvoke(new MethodInvoker(FindDialog));
- }
- private void FindDialog()
- {
- // Enumerate windows to find the message box
- if (mTries < 0) return;
- EnumThreadWndProc callback = new(CheckWindow);
- if (EnumThreadWindows(GetCurrentThreadId(), callback, IntPtr.Zero))
- {
- if (++mTries < 10) mOwner.BeginInvoke(new MethodInvoker(FindDialog));
- }
- }
- private bool CheckWindow(IntPtr hWnd, IntPtr lp)
- {
- // Checks if is a dialog
- StringBuilder sb = new(260);
- _ = GetClassName(hWnd, sb, sb.Capacity);
- if (sb.ToString() != "#32770") return true;
- // Got it
- Rectangle frmRect = new(mOwner.Location, mOwner.Size);
- GetWindowRect(hWnd, out RECT dlgRect);
- MoveWindow(hWnd,
- frmRect.Left + (frmRect.Width - dlgRect.Right + dlgRect.Left) / 2,
- frmRect.Top + (frmRect.Height - dlgRect.Bottom + dlgRect.Top) / 2,
- dlgRect.Right - dlgRect.Left,
- dlgRect.Bottom - dlgRect.Top, true);
- return false;
- }
- public void Dispose()
- {
- mTries = -1;
- }
- // P/Invoke declarations
- private delegate bool EnumThreadWndProc(IntPtr hWnd, IntPtr lp);
- [DllImport("user32.dll")]
- private static extern bool EnumThreadWindows(int tid, EnumThreadWndProc callback, IntPtr lp);
- [DllImport("kernel32.dll")]
- private static extern int GetCurrentThreadId();
- [DllImport("user32.dll")]
- private static extern int GetClassName(IntPtr hWnd, StringBuilder buffer, int buflen);
- [DllImport("user32.dll")]
- private static extern bool GetWindowRect(IntPtr hWnd, out RECT rc);
- [DllImport("user32.dll")]
- private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int w, int h, bool repaint);
- private struct RECT { public int Left; public int Top; public int Right; public int Bottom; }
- }
- // Usage:
- // using (new CenterWinDialog(this))
- // {
- // MessageBox.Show("MessageBox is Parent center.");
- // }
-}
diff --git a/MsmhTools/MsmhTools/CertificateTool.cs b/MsmhTools/MsmhTools/CertificateTool.cs
deleted file mode 100644
index 63940b8..0000000
--- a/MsmhTools/MsmhTools/CertificateTool.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Net;
-using System.Security.Cryptography;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- public class CertificateTool
- {
- public static void GenerateCertificate(string folderPath, IPAddress gateway, string issuerSubjectName = "CN=MSasanMH Authority", string subjectName = "CN=MSasanMH")
- {
- const string CRT_HEADER = "-----BEGIN CERTIFICATE-----\n";
- const string CRT_FOOTER = "\n-----END CERTIFICATE-----";
-
- const string KEY_HEADER = "-----BEGIN RSA PRIVATE KEY-----\n";
- const string KEY_FOOTER = "\n-----END RSA PRIVATE KEY-----";
-
- // Create X509KeyUsageFlags
- const X509KeyUsageFlags x509KeyUsageFlags = X509KeyUsageFlags.CrlSign |
- X509KeyUsageFlags.DataEncipherment |
- X509KeyUsageFlags.DigitalSignature |
- X509KeyUsageFlags.KeyAgreement |
- X509KeyUsageFlags.KeyCertSign |
- X509KeyUsageFlags.KeyEncipherment |
- X509KeyUsageFlags.NonRepudiation;
-
- // Create SubjectAlternativeNameBuilder
- SubjectAlternativeNameBuilder sanBuilder = new();
- sanBuilder.AddDnsName("localhost"); // Add Localhost
- sanBuilder.AddDnsName(Environment.UserName); // Add Current User
- sanBuilder.AddUserPrincipalName(System.Security.Principal.WindowsIdentity.GetCurrent().Name); // Add User Principal Name
- sanBuilder.AddIpAddress(IPAddress.Parse("127.0.0.1"));
- sanBuilder.AddIpAddress(IPAddress.Parse("0.0.0.0"));
- sanBuilder.AddIpAddress(IPAddress.Loopback);
- sanBuilder.AddIpAddress(IPAddress.IPv6Loopback);
-
- // Generate IP range for gateway
- if (Network.IsIPv4(gateway))
- {
- string ipString = gateway.ToString();
- string[] ipSplit = ipString.Split('.');
- string ip1 = ipSplit[0] + "." + ipSplit[1] + "." + ipSplit[2] + ".";
- for (int n = 0; n <= 255; n++)
- {
- string ip2 = ip1 + n.ToString();
- sanBuilder.AddIpAddress(IPAddress.Parse(ip2));
- }
- // Generate local IP range in case a VPN is active.
- if (!ip1.Equals("192.168.1."))
- {
- string ipLocal1 = "192.168.1.";
- for (int n = 0; n <= 255; n++)
- {
- string ipLocal2 = ipLocal1 + n.ToString();
- sanBuilder.AddIpAddress(IPAddress.Parse(ipLocal2));
- }
- }
- }
-
- sanBuilder.AddUri(new Uri("https://127.0.0.1"));
- sanBuilder.Build();
-
- // Create Oid Collection
- OidCollection oidCollection = new();
- oidCollection.Add(new Oid("2.5.29.37.0")); // Any Purpose
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.1")); // Server Authentication
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.2")); // Client Authentication
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.3")); // Code Signing
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.4")); // Email Protection
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.5")); // IPSEC End System Certificate
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.6")); // IPSEC Tunnel
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.7")); // IPSEC User Certificate
- oidCollection.Add(new Oid("1.3.6.1.5.5.7.3.8")); // Time Stamping
- oidCollection.Add(new Oid("1.3.6.1.4.1.311.10.3.2")); // Microsoft Time Stamping
- oidCollection.Add(new Oid("1.3.6.1.4.1.311.10.5.1")); // Digital Rights
- oidCollection.Add(new Oid("1.3.6.1.4.1.311.64.1.1")); // Domain Name System (DNS) Server Trust
-
- // Create Issuer RSA Private Key
- using RSA issuerRsaKey = RSA.Create(4096);
-
- // Create Issuer Request
- CertificateRequest issuerReq = new(issuerSubjectName, issuerRsaKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
- issuerReq.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, true));
- issuerReq.CertificateExtensions.Add(new X509SubjectKeyIdentifierExtension(issuerReq.PublicKey, false));
- issuerReq.CertificateExtensions.Add(new X509KeyUsageExtension(x509KeyUsageFlags, false));
- issuerReq.CertificateExtensions.Add(sanBuilder.Build());
- issuerReq.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(oidCollection, true));
-
- // Create Issuer Certificate
- using X509Certificate2 issuerCert = issuerReq.CreateSelfSigned(DateTimeOffset.Now, DateTimeOffset.Now.AddYears(10));
-
- // Create RSA Private Key
- using RSA rsaKey = RSA.Create(2048);
-
- // Create Request
- CertificateRequest req = new(subjectName, rsaKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
- req.CertificateExtensions.Add(new X509BasicConstraintsExtension(false, false, 0, false));
- req.CertificateExtensions.Add(new X509SubjectKeyIdentifierExtension(req.PublicKey, false));
- req.CertificateExtensions.Add(new X509KeyUsageExtension(x509KeyUsageFlags, false));
- req.CertificateExtensions.Add(sanBuilder.Build());
- req.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(oidCollection, true));
-
- // Create Certificate
- using X509Certificate2 cert = req.Create(issuerCert, DateTimeOffset.Now, DateTimeOffset.Now.AddYears(9), new byte[] { 1, 2, 3, 4 });
-
- // Export
- // Export Issuer Private Key
- var issuerPrivateKeyExport = issuerRsaKey.ExportRSAPrivateKey();
- var issuerPrivateKeyData = Convert.ToBase64String(issuerPrivateKeyExport, Base64FormattingOptions.InsertLineBreaks);
- File.WriteAllText(Path.Combine(folderPath, "rootCA.key"), KEY_HEADER + issuerPrivateKeyData + KEY_FOOTER);
-
- // Export Issuer Certificate
- var issuerCertExport = issuerCert.Export(X509ContentType.Cert);
- var issuerCertData = Convert.ToBase64String(issuerCertExport, Base64FormattingOptions.InsertLineBreaks);
- File.WriteAllText(Path.Combine(folderPath, "rootCA.crt"), CRT_HEADER + issuerCertData + CRT_FOOTER);
-
- // Export Private Key
- var privateKeyExport = rsaKey.ExportRSAPrivateKey();
- var privateKeyData = Convert.ToBase64String(privateKeyExport, Base64FormattingOptions.InsertLineBreaks);
- File.WriteAllText(Path.Combine(folderPath, "localhost.key"), KEY_HEADER + privateKeyData + KEY_FOOTER);
-
- // Export Certificate
- var certExport = cert.Export(X509ContentType.Cert);
- var certData = Convert.ToBase64String(certExport, Base64FormattingOptions.InsertLineBreaks);
- File.WriteAllText(Path.Combine(folderPath, "localhost.crt"), CRT_HEADER + certData + CRT_FOOTER);
-
- }
-
- public static void CreateP12(string certPath, string keyPath, string password = "")
- {
- string? folderPath = Path.GetDirectoryName(certPath);
- string fileName = Path.GetFileNameWithoutExtension(certPath);
- using X509Certificate2 certWithKey = X509Certificate2.CreateFromPemFile(certPath, keyPath);
- var certWithKeyExport = certWithKey.Export(X509ContentType.Pfx, password);
- if (!string.IsNullOrEmpty(folderPath))
- File.WriteAllBytes(Path.Combine(folderPath, fileName + ".p12"), certWithKeyExport);
- }
-
- ///
- /// Returns false if user don't install certificate, otherwise true.
- ///
- public static bool InstallCertificate(string certPath, StoreName storeName, StoreLocation storeLocation)
- {
- try
- {
- X509Certificate2 certificate = new(certPath, "", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
- X509Store store = new(storeName, storeLocation);
- store.Open(OpenFlags.ReadWrite);
- store.Add(certificate);
- store.Close();
- return true;
- }
- catch (Exception ex) // Internal.Cryptography.CryptoThrowHelper.WindowsCryptographicException
- {
- Debug.WriteLine(ex.Message);
- // If ex.Message: (The operation was canceled by the user.)
- return false;
- }
- }
-
- public static bool IsCertificateInstalled(string subjectName, StoreName storeName, StoreLocation storeLocation)
- {
- X509Store store = new(storeName, storeLocation);
- store.Open(OpenFlags.ReadOnly);
-
- X509Certificate2Collection certificates = store.Certificates.Find(X509FindType.FindBySubjectName, subjectName, false);
-
- if (certificates != null && certificates.Count > 0)
- {
- Debug.WriteLine("Certificate is already installed.");
- return true;
- }
- else
- return false;
- }
-
- public static void UninstallCertificate(string subjectName, StoreName storeName, StoreLocation storeLocation)
- {
- X509Store store = new(storeName, storeLocation);
- store.Open(OpenFlags.ReadWrite | OpenFlags.IncludeArchived);
-
- // You could also use a more specific find type such as X509FindType.FindByThumbprint
- X509Certificate2Collection certificates = store.Certificates.Find(X509FindType.FindBySubjectName, subjectName, false);
- Debug.WriteLine($"Cert Count: {certificates.Count}");
-
- for (int i = 0; i < certificates.Count; i++)
- {
- X509Certificate2 cert = certificates[i];
- Debug.WriteLine($"Cert SubjectName: {cert.SubjectName.Name}");
-
- X509Chain chain = new();
- chain.Build(cert);
- X509Certificate2Collection allCertsInChain = new();
- Debug.WriteLine($"Cert Chain Count: {chain.ChainElements.Count}");
-
- for (int j = 0; j < chain.ChainElements.Count; j++)
- {
- X509ChainElement chainElement = chain.ChainElements[j];
- allCertsInChain.Add(chainElement.Certificate);
-
- Debug.WriteLine($"Cert Chain SubjectName: {chainElement.Certificate.SubjectName.Name}");
- }
-
- store.RemoveRange(allCertsInChain);
- store.Remove(cert);
- }
- store.Close();
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/Colors.cs b/MsmhTools/MsmhTools/Colors.cs
deleted file mode 100644
index d4bf622..0000000
--- a/MsmhTools/MsmhTools/Colors.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using System;
-
-namespace MsmhTools
-{
- public static class Colors
- {
- //-----------------------------------------------------------------------------------
- ///
- /// Converts the HSL values to a Color.
- ///
- /// The alpha. (0 - 255)
- /// The hue. (0f - 360f)
- /// The saturation. (0f - 1f)
- /// The lighting. (0f - 1f)
- ///
- public static Color FromHsl(int alpha, float hue, float saturation, float lighting)
- {
- if (0 > alpha || 255 < alpha)
- {
- throw new ArgumentOutOfRangeException(nameof(alpha));
- }
- if (0f > hue || 360f < hue)
- {
- throw new ArgumentOutOfRangeException(nameof(hue));
- }
- if (0f > saturation || 1f < saturation)
- {
- throw new ArgumentOutOfRangeException(nameof(saturation));
- }
- if (0f > lighting || 1f < lighting)
- {
- throw new ArgumentOutOfRangeException(nameof(lighting));
- }
-
- if (0 == saturation)
- {
- return Color.FromArgb(alpha, Convert.ToInt32(lighting * 255), Convert.ToInt32(lighting * 255), Convert.ToInt32(lighting * 255));
- }
-
- float fMax, fMid, fMin;
- int iSextant, iMax, iMid, iMin;
-
- if (0.5 < lighting)
- {
- fMax = lighting - (lighting * saturation) + saturation;
- fMin = lighting + (lighting * saturation) - saturation;
- }
- else
- {
- fMax = lighting + (lighting * saturation);
- fMin = lighting - (lighting * saturation);
- }
-
- iSextant = (int)Math.Floor(hue / 60f);
- if (300f <= hue)
- {
- hue -= 360f;
- }
- hue /= 60f;
- hue -= 2f * (float)Math.Floor(((iSextant + 1f) % 6f) / 2f);
- if (0 == iSextant % 2)
- {
- fMid = hue * (fMax - fMin) + fMin;
- }
- else
- {
- fMid = fMin - hue * (fMax - fMin);
- }
-
- iMax = Convert.ToInt32(fMax * 255);
- iMid = Convert.ToInt32(fMid * 255);
- iMin = Convert.ToInt32(fMin * 255);
-
- switch (iSextant)
- {
- case 1:
- return Color.FromArgb(alpha, iMid, iMax, iMin);
- case 2:
- return Color.FromArgb(alpha, iMin, iMax, iMid);
- case 3:
- return Color.FromArgb(alpha, iMin, iMid, iMax);
- case 4:
- return Color.FromArgb(alpha, iMid, iMin, iMax);
- case 5:
- return Color.FromArgb(alpha, iMax, iMin, iMid);
- default:
- return Color.FromArgb(alpha, iMax, iMid, iMin);
- }
- }
- //-----------------------------------------------------------------------------------
- }
-}
diff --git a/MsmhTools/MsmhTools/Controllers.cs b/MsmhTools/MsmhTools/Controllers.cs
deleted file mode 100644
index f6835b1..0000000
--- a/MsmhTools/MsmhTools/Controllers.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace MsmhTools
-{
- public static class Controllers
- {
- //-----------------------------------------------------------------------------------
- public static List GetAllControls(Control control)
- {
- List listC = new();
- GetAllSubControlsByType(control);
-
- void GetAllSubControlsByType(Control control)
- {
- listC.Add(control);
-
- if (control.HasChildren)
- {
- for (int n = 0; n < control.Controls.Count; n++)
- {
- Control c = control.Controls[n];
- GetAllSubControlsByType(c);
- }
- }
- }
- return listC;
- }
- //-----------------------------------------------------------------------------------
- public static List GetAllChildControls(Control control)
- {
- List listC = new();
- GetAllSubControlsByType(control);
-
- void GetAllSubControlsByType(Control control)
- {
- if (control.HasChildren)
- {
- for (int n = 0; n < control.Controls.Count; n++)
- {
- Control c = control.Controls[n];
- listC.Add(c);
- GetAllSubControlsByType(c);
- }
- }
- }
- return listC;
- }
- //-----------------------------------------------------------------------------------
- public static List GetAllControlsByType(Control control)
- {
- List listT = new();
- var type = control.GetType();
- var fields = type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
- for (int n = 0; n < fields.Length; n++)
- {
- var field = fields[n];
- if (field.GetValue(control) != null &&
- (field.GetValue(control).GetType().IsSubclassOf(typeof(T)) || field.GetValue(control).GetType() == typeof(T)))
- {
- var t = (T)field.GetValue(control);
- if (t != null)
- listT.Add(t);
- }
- }
- return listT;
- } // Usage: var toolStripButtons = GetSubControls(form);
- //-----------------------------------------------------------------------------------
- ///
- /// Recursively get SubMenu Items. Includes Separators.
- ///
- ///
- ///
- public static IEnumerable GetAllToolStripItems(ToolStripItem? item)
- {
- if (item is ToolStripMenuItem)
- {
- foreach (ToolStripItem tsi in (item as ToolStripMenuItem).DropDownItems)
- {
- if (tsi is ToolStripMenuItem)
- {
- if ((tsi as ToolStripMenuItem).HasDropDownItems)
- {
- foreach (ToolStripItem subItem in GetAllToolStripItems(tsi as ToolStripMenuItem))
- yield return subItem;
- }
- yield return tsi as ToolStripMenuItem;
- }
- else if (tsi is ToolStripSeparator)
- {
- yield return tsi as ToolStripSeparator;
- }
- }
- }
- else if (item is ToolStripSeparator)
- {
- yield return item as ToolStripSeparator;
- }
- }
- // Usage:
- // if(toolItem is ToolStripMenuItem)
- // {
- // ToolStripMenuItem tsmi = (toolItem as ToolStripMenuItem);
- // //Do something with it
- // }
- // else if(toolItem is ToolStripSeparator)
- // {
- // ToolStripSeparator tss = (toolItem as ToolStripSeparator);
- // //Do something with it
- // }
- //-----------------------------------------------------------------------------------
- public static Control GetTopParent(Control control)
- {
- Control parent = control;
- if (control.Parent != null)
- {
- parent = control.Parent;
- if (parent.Parent != null)
- while (parent.Parent != null)
- parent = parent.Parent;
- }
- return parent;
- }
- //-----------------------------------------------------------------------------------
- public static void SetDarkControl(Control control)
- {
- _ = Methods.SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
- foreach (Control c in GetAllControls(control))
- {
- _ = Methods.SetWindowTheme(c.Handle, "DarkMode_Explorer", null);
- }
- }
- //-----------------------------------------------------------------------------------
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DNSCryptConfigEditor.cs b/MsmhTools/MsmhTools/DnsTool/DNSCryptConfigEditor.cs
deleted file mode 100644
index b7d8d5d..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DNSCryptConfigEditor.cs
+++ /dev/null
@@ -1,249 +0,0 @@
-using MsmhTools;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Net;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool
-{
- public class DNSCryptConfigEditor
- {
- private List ConfigList = new();
- private string ConfigPath = string.Empty;
- public DNSCryptConfigEditor(string configPath)
- {
- ConfigPath = configPath;
- ConfigList.Clear();
- string text = File.ReadAllText(configPath);
- ConfigList = text.SplitToLines();
- }
-
- public void EditDnsCache(bool enable)
- {
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (line.Contains("cache = true") || line.Contains("cache = false"))
- {
- // e.g. cache = true
- if (enable)
- ConfigList[n] = "cache = true";
- else
- ConfigList[n] = "cache = false";
- break;
- }
- }
- }
-
- public void EditHTTPProxy(string proxyScheme)
- {
- if (string.IsNullOrEmpty(proxyScheme)) return;
- string keyName = "http_proxy";
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (line.Contains(keyName))
- {
- // e.g. http_proxy = 'https://http.proxy.net:8080'
- ConfigList[n] = $"{keyName} = '{proxyScheme}'";
- break;
- }
- }
- }
-
- public void RemoveHTTPProxy()
- {
- string keyName = "http_proxy";
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (line.Contains(keyName))
- {
- // e.g. http_proxy = 'https://http.proxy.net:8080'
- ConfigList[n] = $"#{keyName} = ''";
- break;
- }
- }
- }
-
- public void EditBootstrapDNS(IPAddress bootstrapDNS, int bootstrapPort)
- {
- if (bootstrapDNS == null) return;
- string keyName = "bootstrap_resolvers";
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (line.Contains(keyName))
- {
- // e.g. bootstrap_resolvers = ['9.9.9.11:53', '1.1.1.1:53']
- ConfigList[n] = $"{keyName} = ['{bootstrapDNS}:{bootstrapPort}', '1.1.1.1:53']";
- break;
- }
- }
- }
-
- public void EditCertPath(string certPath)
- {
- if (string.IsNullOrEmpty(certPath)) return;
- string sectionName = "[local_doh]";
- string keyName = "cert_file";
- bool section = false;
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (!section && line.StartsWith(sectionName))
- section = true;
-
- if (section)
- {
- if (line.Contains(keyName))
- {
- // e.g. cert_file = 'certs/domain.crt'
- ConfigList[n] = $"{keyName} = '{certPath}'";
- break;
- }
-
- // Break if reaches next section
- if (line.StartsWith('[') && !line.StartsWith(sectionName)) break;
- }
- }
- }
-
- public void EditCertKeyPath(string certKeyPath)
- {
- if (string.IsNullOrEmpty(certKeyPath)) return;
- string sectionName = "[local_doh]";
- string keyName = "cert_key_file";
- bool section = false;
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (!section && line.StartsWith(sectionName))
- section = true;
-
- if (section)
- {
- if (line.Contains(keyName))
- {
- // e.g. cert_key_file = 'certs/domain.key'
- ConfigList[n] = $"{keyName} = '{certKeyPath}'";
- break;
- }
-
- // Break if reaches next section
- if (line.StartsWith('[') && !line.StartsWith(sectionName)) break;
- }
- }
- }
-
- public void EnableDoH(int dohPort)
- {
- string sectionName = "[local_doh]";
- string keyName = "listen_addresses";
- bool section = false;
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (!section && line.StartsWith(sectionName))
- section = true;
-
- if (section)
- {
- if (line.Contains(keyName))
- {
- // e.g. listen_addresses = ['0.0.0.0:443']
- ConfigList[n] = $"{keyName} = ['0.0.0.0:{dohPort}']";
- break;
- }
-
- // Break if reaches next section
- if (line.StartsWith('[') && !line.StartsWith(sectionName)) break;
- }
- }
- }
-
- public void DisableDoH()
- {
- string sectionName = "[local_doh]";
- string keyName = "listen_addresses";
- bool section = false;
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (!section && line.StartsWith(sectionName))
- section = true;
-
- if (section)
- {
- if (line.Contains(keyName))
- {
- // e.g. listen_addresses = ['0.0.0.0:443']
- ConfigList[n] = $"#{keyName} = ['0.0.0.0:443']";
- break;
- }
-
- // Break if reaches next section
- if (line.StartsWith('[') && !line.StartsWith(sectionName)) break;
- }
- }
- }
-
- public void ChangePersonalServer(string[] sdns)
- {
- string sectionName = "[static]";
- string keyName = "stamp";
- bool section = false;
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n].Trim();
- if (!section && line.StartsWith(sectionName))
- section = true;
-
- if (section)
- {
- // Remove all existing personal servers
- if (n < ConfigList.Count - 1)
- {
- ConfigList.RemoveRange(n + 1, ConfigList.Count - (n + 1));
- }
-
- // e.g. [static.Personal]
- // e.g. stamp = 'sdns://AgcAAAAAAAAABzEuMC4wLjEAEmRucy5jbG91ZGZsYXJlLmNvbQovZG5zLXF1ZXJ5'
- for (int i = 0; i < sdns.Length; i++)
- {
- ConfigList.Add(string.Empty);
- string newLine1 = $"[static.Personal{i + 1}]";
- ConfigList.Add(newLine1);
-
- string sdnsOne = sdns[i];
- string newLine2 = $"{keyName} = '{sdnsOne}'";
- ConfigList.Add(newLine2);
- }
-
- break;
- }
- }
- }
-
- public async Task WriteAsync()
- {
- if (!FileDirectory.IsFileLocked(ConfigPath))
- {
- File.WriteAllText(ConfigPath, string.Empty);
- for (int n = 0; n < ConfigList.Count; n++)
- {
- string line = ConfigList[n];
-
- if (n == ConfigList.Count - 1)
- await FileDirectory.AppendTextAsync(ConfigPath, line, new UTF8Encoding(false));
- else
- await FileDirectory.AppendTextLineAsync(ConfigPath, line, new UTF8Encoding(false));
- }
- //File.WriteAllLines(ConfigPath, ConfigList);
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DNSCryptStampGenerator.cs b/MsmhTools/MsmhTools/DnsTool/DNSCryptStampGenerator.cs
deleted file mode 100644
index b1c5495..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DNSCryptStampGenerator.cs
+++ /dev/null
@@ -1,438 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Text;
-
-namespace MsmhTools.DnsTool
-{
- public class DNSCryptStampGenerator
- {
- // More info: https://dnscrypt.info/stamps-specifications/
- public DNSCryptStampGenerator()
- {
-
- }
-
- ///
- /// Generate Plain DNS Stamp
- ///
- /// IP Address (IPv6 addresses must be in brackets)
- /// Is DNSSec
- /// Is no log
- /// Is no filter
- /// Returns stamp or string.Empty if fail
- public string GeneratePlainDns(string ipPort, bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- ipPort = ipPort.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDns = new byte[] { 0x00 }; // Plain DNS
- byte[] bProps = GetProperties(isDNSSec, isNoLog, isNoFilter);
- byte[] bDnsIp = LP(ipPort);
-
- byte[] main = bDns.Concat(bProps).Concat(bDnsIp).ToArray();
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert Plain DNS to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- ///
- /// Generate DNSCrypt Stamp
- ///
- /// IP Address with optional port (IPv6 addresses must be in brackets)
- /// Public Key
- /// Provider Name
- /// Is DNSSec
- /// Is no log
- /// Is no filter
- /// Returns stamp or string.Empty if fail
- public string GenerateDNSCrypt(string ipPort, string publicKey, string providerName, bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- ipPort = ipPort.Trim();
- publicKey = publicKey.Trim();
- providerName = providerName.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDns = new byte[] { 0x01 }; // DNSCrypt
- byte[] bProps = GetProperties(isDNSSec, isNoLog, isNoFilter);
- byte[] bIpPort = LP(ipPort);
- byte[] bPK = LPPublicKey(publicKey);
- byte[] bPN = LP(providerName);
-
- byte[] main = bDns.Concat(bProps).Concat(bIpPort).Concat(bPK).Concat(bPN).ToArray();
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert DNSCrypt to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- ///
- /// Generate DoH Stamp
- ///
- /// IP Address (IPv6 addresses must be in brackets)
- /// Hashes (comma-separated) - Optional
- /// Host name (vHost+SNI) and optional port number
- /// Path
- /// Bootstraps (comma-separated) - Optional
- /// Is DNSSec
- /// Is no log
- /// Is no filter
- /// Returns stamp or string.Empty if fail
- public string GenerateDoH(string ip, string? hashes, string hostPort, string path, string? bootstraps, bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- ip = ip.Trim();
- if (!string.IsNullOrEmpty(hashes))
- hashes = hashes.Trim();
- hostPort = hostPort.Trim();
- path = string.IsNullOrEmpty(path) ? "/" : path.Trim();
- if (!string.IsNullOrEmpty(bootstraps))
- bootstraps = bootstraps.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDoh = new byte[] { 0x02 }; // DoH
- byte[] bProps = GetProperties(isDNSSec, isNoLog, isNoFilter);
- byte[] bDohIp = LP(ip);
- byte[] bHash = VLPHash(hashes);
- byte[] bhostPort = LP(hostPort);
- byte[] bPath = LP(path);
- byte[] bBootstrap = VLPBootstrap(bootstraps);
-
- byte[] main = bDoh.Concat(bProps).Concat(bDohIp).Concat(bHash).Concat(bhostPort).Concat(bPath).ToArray();
- if (!string.IsNullOrEmpty(bootstraps))
- main = main.Concat(bBootstrap).ToArray();
-
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert DoH to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- ///
- /// Generate DoT Stamp
- ///
- /// IP Address (IPv6 addresses must be in brackets)
- /// Hashes (comma-separated) - Optional
- /// Host name (vHost+SNI) and optional port number
- /// Bootstraps (comma-separated) - Optional
- /// Is DNSSec
- /// Is no log
- /// Is no filter
- /// Returns stamp or string.Empty if fail
- public string GenerateDoT(string ip, string? hashes, string hostPort, string? bootstraps, bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- ip = ip.Trim();
- if (!string.IsNullOrEmpty(hashes))
- hashes = hashes.Trim();
- hostPort = hostPort.Trim();
- if (!string.IsNullOrEmpty(bootstraps))
- bootstraps = bootstraps.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDot = new byte[] { 0x03 }; // DoT
- byte[] bProps = GetProperties(isDNSSec, isNoLog, isNoFilter);
- byte[] bDotIp = LP(ip);
- byte[] bHash = VLPHash(hashes);
- byte[] bhostPort = LP(hostPort);
- byte[] bBootstrap = VLPBootstrap(bootstraps);
-
- byte[] main = bDot.Concat(bProps).Concat(bDotIp).Concat(bHash).Concat(bhostPort).ToArray();
- if (!string.IsNullOrEmpty(bootstraps))
- main = main.Concat(bBootstrap).ToArray();
-
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert DoT to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- ///
- /// Generate DoQ Stamp
- ///
- /// IP Address (IPv6 addresses must be in brackets)
- /// Hashes (comma-separated) - Optional
- /// Host name (vHost+SNI) and optional port number
- /// Bootstraps (comma-separated) - Optional
- /// Is DNSSec
- /// Is no log
- /// Is no filter
- /// Returns stamp or string.Empty if fail
- public string GenerateDoQ(string ip, string? hashes, string hostPort, string? bootstraps, bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- ip = ip.Trim();
- if (!string.IsNullOrEmpty(hashes))
- hashes = hashes.Trim();
- hostPort = hostPort.Trim();
- if (!string.IsNullOrEmpty(bootstraps))
- bootstraps = bootstraps.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDoq = new byte[] { 0x04 }; // DoQ
- byte[] bProps = GetProperties(isDNSSec, isNoLog, isNoFilter);
- byte[] bDoqIp = LP(ip);
- byte[] bHash = VLPHash(hashes);
- byte[] bhostPort = LP(hostPort);
- byte[] bBootstrap = VLPBootstrap(bootstraps);
-
- byte[] main = bDoq.Concat(bProps).Concat(bDoqIp).Concat(bHash).Concat(bhostPort).ToArray();
- if (!string.IsNullOrEmpty(bootstraps))
- main = main.Concat(bBootstrap).ToArray();
-
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert DoQ to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- ///
- /// Generate Oblivious DoH Target Stamp
- ///
- /// Host name (vHost+SNI) and optional port number
- /// Path
- /// Is DNSSec
- /// Is no log
- /// Is no filter
- /// Returns stamp or string.Empty if fail
- public string GenerateObliviousDohTarget(string hostPort, string path, bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- hostPort = hostPort.Trim();
- path = string.IsNullOrEmpty(path) ? "/" : path.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDns = new byte[] { 0x05 }; // Oblivious DoH Target
- byte[] bProps = GetProperties(isDNSSec, isNoLog, isNoFilter);
- byte[] bhostPort = LP(hostPort);
- byte[] bPath = LP(path);
-
- byte[] main = bDns.Concat(bProps).Concat(bhostPort).Concat(bPath).ToArray();
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert Oblivious DoH Target to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- ///
- /// Generate Anonymized DNSCrypt Relay Stamp
- ///
- /// IP address and port, as a string. IPv6 strings must be included in square brackets.
- /// Returns stamp or string.Empty if fail
- public string GenerateAnonymizedDNSCryptRelay(string ipPort)
- {
- ipPort = ipPort.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDns = new byte[] { 0x81 }; // Anonymized DNSCrypt Relay
- byte[] bIpPort = LP(ipPort);
-
- byte[] main = bDns.Concat(bIpPort).ToArray();
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert Anonymized DNSCrypt Relay to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- ///
- /// Generate Oblivious DoH Relay Stamp
- ///
- /// IP Address (IPv6 addresses must be in brackets)
- /// Hashes (comma-separated) - Optional
- /// Host name (vHost+SNI) and optional port number
- /// Path
- /// Bootstraps (comma-separated) - Optional
- /// Is DNSSec
- /// Is no log
- /// Is no filter
- /// Returns stamp or string.Empty if fail
- public string GenerateObliviousDohRelay(string ip, string? hashes, string hostPort, string path, string? bootstraps, bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- ip = ip.Trim();
- if (!string.IsNullOrEmpty(hashes))
- hashes = hashes.Trim();
- hostPort = hostPort.Trim();
- path = string.IsNullOrEmpty(path) ? "/" : path.Trim();
- if (!string.IsNullOrEmpty(bootstraps))
- bootstraps = bootstraps.Trim();
- string sdns = string.Empty;
-
- try
- {
- byte[] bDns = new byte[] { 0x85 }; // Oblivious DoH Relay
- byte[] bProps = GetProperties(isDNSSec, isNoLog, isNoFilter);
- byte[] bDnsIp = LP(ip);
- byte[] bHash = VLPHash(hashes);
- byte[] bhostPort = LP(hostPort);
- byte[] bPath = LP(path);
- byte[] bBootstrap = VLPBootstrap(bootstraps);
-
- byte[] main = bDns.Concat(bProps).Concat(bDnsIp).Concat(bHash).Concat(bhostPort).Concat(bPath).ToArray();
- if (!string.IsNullOrEmpty(bootstraps))
- main = main.Concat(bBootstrap).ToArray();
-
- sdns = GetSdnsUrl(main);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Convert Oblivious DoH Relay to Stamp: " + ex.Message);
- }
-
- return sdns;
- }
-
- private static byte[] GetProperties(bool isDNSSec, bool isNoLog, bool isNoFilter)
- {
- // 1: the server supports DNSSEC
- // 2: the server doesn't keep logs
- // 4: the server doesn't intentionally block domains
- int p = 0;
- if (isDNSSec) p += 1;
- if (isNoLog) p += 2;
- if (isNoFilter) p += 4;
-
- byte[] bProps = new byte[] { Convert.ToByte(p), 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- return bProps;
- }
-
- private static byte[] LP(string input)
- {
- input = input.Trim();
- byte[] bInputLength = new byte[] { Convert.ToByte(input.Length) };
- byte[] bInput = Encoding.UTF8.GetBytes(input);
- return bInputLength.Concat(bInput).ToArray();
- }
-
- private static byte[] LPPublicKey(string input)
- {
- input = input.ToLower().Trim();
- byte[] bInput = Convert.FromHexString(input);
- byte[] bInputLength = new byte[] { Convert.ToByte(bInput.Length) };
- return bInputLength.Concat(bInput).ToArray();
- }
-
- private static byte[] VLPHash(string? input)
- {
- if (string.IsNullOrEmpty(input))
- return new byte[] { 0x00 };
-
- input = input.Replace(" ", string.Empty).ToLower();
-
- byte[] bInputOut = Array.Empty();
- if (input.Contains(','))
- {
- string[] split = input.Split(',', StringSplitOptions.TrimEntries);
- for (int n = 0; n < split.Length; n++)
- {
- string oneInput = split[n].Trim();
- if (n == split.Length - 1) // Last Line
- {
- byte[] bInput = Convert.FromHexString(oneInput);
- byte[] bInputLength = new byte[] { Convert.ToByte(bInput.Length) };
- bInputOut = bInputOut.Concat(bInputLength).Concat(bInput).ToArray();
- }
- else
- {
- byte[] bInput = Convert.FromHexString(oneInput);
- int length = 0x80 | bInput.Length;
- byte[] bInputLength = new byte[] { Convert.ToByte(length) };
- bInputOut = bInputOut.Concat(bInputLength).Concat(bInput).ToArray();
- }
- }
- }
- else
- {
- byte[] bInput = Convert.FromHexString(input);
- byte[] bInputLength = new byte[] { Convert.ToByte(bInput.Length) };
- bInputOut = bInputOut.Concat(bInputLength).Concat(bInput).ToArray();
-
- }
- return bInputOut;
- }
-
- private static byte[] VLPBootstrap(string? input)
- {
- if (string.IsNullOrEmpty(input))
- return new byte[] { 0x00 };
-
- input = input.Replace(" ", string.Empty);
-
- byte[] bInputOut = Array.Empty();
- if (input.Contains(','))
- {
- string[] split = input.Split(',', StringSplitOptions.TrimEntries);
- for (int n = 0; n < split.Length; n++)
- {
- string oneInput = split[n].Trim();
- if (n == split.Length - 1) // Last Line
- {
- byte[] bInputLength = new byte[] { Convert.ToByte(oneInput.Length) };
- byte[] bInput = Encoding.UTF8.GetBytes(oneInput);
- bInputOut = bInputOut.Concat(bInputLength).Concat(bInput).ToArray();
- }
- else
- {
- int length = 0x80 | oneInput.Length;
- byte[] bInputLength = new byte[] { Convert.ToByte(length) };
- byte[] bInput = Encoding.UTF8.GetBytes(oneInput);
- bInputOut = bInputOut.Concat(bInputLength).Concat(bInput).ToArray();
- }
- }
- }
- else
- {
- byte[] bInputLength = new byte[] { Convert.ToByte(input.Length) };
- byte[] bInput = Encoding.UTF8.GetBytes(input);
- bInputOut = bInputOut.Concat(bInputLength).Concat(bInput).ToArray();
-
- }
- return bInputOut;
- }
-
- private static string GetSdnsUrl(byte[] wholeBytes)
- {
- string sdnsScheme = "sdns://";
- string mainBase64 = EncodingTool.UrlEncode(wholeBytes);
- return sdnsScheme + mainBase64;
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DNSCryptStampReader.cs b/MsmhTools/MsmhTools/DnsTool/DNSCryptStampReader.cs
deleted file mode 100644
index edc94f8..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DNSCryptStampReader.cs
+++ /dev/null
@@ -1,528 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Text;
-
-namespace MsmhTools.DnsTool
-{
- public class DNSCryptStampReader
- {
- // More info: https://dnscrypt.info/stamps-specifications/
- public bool IsDecryptionSuccess { get; private set; } = false;
- public string Stamp { get; private set; } = string.Empty;
- public string IP { get; private set; } = string.Empty;
- public int Port { get; private set; } = -1;
- public string Host { get; private set; } = string.Empty;
- public string Path { get; private set; } = string.Empty;
- public string PublicKey { get; private set; } = string.Empty;
- public string ProviderName { get; private set; } = string.Empty;
- public List Hashi { get; private set; } = new();
- public List Bootstraps { get; private set; } = new();
- public StampProtocol Protocol { get; private set; } = StampProtocol.Unknown;
- public string ProtocolName { get; private set; } = StampProtocolName.Unknown;
- public bool IsDnsSec { get; set; } = false;
- public bool IsNoLog { get; set; } = false;
- public bool IsNoFilter { get; set; } = false;
-
- public static class DefaultPort
- {
- public static readonly int PlainDNS = 53;
- public static readonly int DnsCrypt = 443;
- public static readonly int DoH = 443;
- public static readonly int DoT = 853;
- public static readonly int DoQ = 853;
- public static readonly int ObliviousDohTarget = 443;
- public static readonly int AnonymizedDNSCryptRelay = 443;
- public static readonly int ObliviousDohRelay = 443;
- }
-
- public enum StampProtocol
- {
- PlainDNS,
- DnsCrypt,
- DoH,
- DoT,
- DoQ,
- ObliviousDohTarget,
- AnonymizedDNSCryptRelay,
- ObliviousDohRelay,
- Unknown
- }
-
- private struct StampProtocolName
- {
- public static string PlainDNS = "Plain DNS";
- public static string DnsCrypt = "DNSCrypt";
- public static string DoH = "DNS-Over-HTTPS";
- public static string DoT = "DNS-Over-TLS";
- public static string DoQ = "DNS-Over-Quic";
- public static string ObliviousDohTarget = "Oblivious DoH Target";
- public static string AnonymizedDNSCryptRelay = "Anonymized DNSCrypt Relay";
- public static string ObliviousDohRelay = "Oblivious DoH Relay";
- public static string Unknown = "Unknown";
- }
-
- public DNSCryptStampReader(string stamp)
- {
- Stamp = stamp;
-
- if (stamp.StartsWith("sdns://"))
- {
- try
- {
- // Strip sdns://
- stamp = stamp[7..];
-
- // Get Stamp Binary
- byte[] stampBinary = EncodingTool.UrlDecode(stamp);
-
- // Get Protocol
- if (stampBinary.Length > 0)
- {
- Protocol = GetProtocol(stampBinary, out string protocolName);
- ProtocolName = protocolName;
- }
-
- // Get Properties
- if (Protocol != StampProtocol.AnonymizedDNSCryptRelay) // Anonymized DNSCrypt Relay doesn't have properties
- {
- if (stampBinary.Length > 1)
- {
- GetStampProperties(stampBinary, out bool isDNSSec, out bool isNoLog, out bool isNoFilter);
- IsDnsSec = isDNSSec;
- IsNoLog = isNoLog;
- IsNoFilter = isNoFilter;
- }
- }
-
- // Get IP, Port, Host, Path, PublicKey, ProviderName, Hashi, Bootstraps
- bool isOk = DecryptTheRest(stampBinary, out string ip, out int port, out string host, out string path, out string publicKey,
- out string providerName, out List hashi, out List bootstraps);
-
- if (!isOk) return;
-
- IP = ip;
- Port = port;
- Host = host;
- Path = path;
- PublicKey = publicKey;
- ProviderName = providerName;
- Hashi = new(hashi);
- Bootstraps = new(bootstraps);
-
- IsDecryptionSuccess = true;
- }
- catch (Exception)
- {
- // do nothing
- }
- }
- else
- {
- Debug.WriteLine("\"sdns://\" is missing.");
- }
- }
-
- private static StampProtocol GetProtocol(byte[] stampBinary, out string protocolName)
- {
- byte stampProtocol = stampBinary[0];
-
- if (stampProtocol == 0x00)
- {
- protocolName = StampProtocolName.PlainDNS;
- return StampProtocol.PlainDNS;
- }
- else if (stampProtocol == 0x01)
- {
- protocolName = StampProtocolName.DnsCrypt;
- return StampProtocol.DnsCrypt;
- }
- else if (stampProtocol == 0x02)
- {
- protocolName = StampProtocolName.DoH;
- return StampProtocol.DoH;
- }
- else if (stampProtocol == 0x03)
- {
- protocolName = StampProtocolName.DoT;
- return StampProtocol.DoT;
- }
- else if (stampProtocol == 0x04)
- {
- protocolName = StampProtocolName.DoQ;
- return StampProtocol.DoQ;
- }
- else if (stampProtocol == 0x05)
- {
- protocolName = StampProtocolName.ObliviousDohTarget;
- return StampProtocol.ObliviousDohTarget;
- }
- else if (stampProtocol == 0x81)
- {
- protocolName = StampProtocolName.AnonymizedDNSCryptRelay;
- return StampProtocol.AnonymizedDNSCryptRelay;
- }
- else if (stampProtocol == 0x85)
- {
- protocolName = StampProtocolName.ObliviousDohRelay;
- return StampProtocol.ObliviousDohRelay;
- }
- else
- {
- protocolName = StampProtocolName.Unknown;
- return StampProtocol.Unknown;
- }
- }
-
- private static void GetStampProperties(byte[] stampBinary, out bool isDNSSec, out bool isNoLog, out bool isNoFilter)
- {
- byte dnsCryptProperties = stampBinary[1];
-
- isDNSSec = Convert.ToBoolean((dnsCryptProperties >> 0) & 1);
- isNoLog = Convert.ToBoolean((dnsCryptProperties >> 1) & 1);
- isNoFilter = Convert.ToBoolean((dnsCryptProperties >> 2) & 1);
- }
-
- private bool DecryptTheRest(byte[] stampBinary, out string ip, out int port, out string host, out string path, out string publicKey,
- out string providerName, out List hashi, out List bootstraps)
- {
- ip = string.Empty;
- port = -1;
- host = string.Empty;
- path = string.Empty;
- publicKey = string.Empty;
- providerName = string.Empty;
- hashi = new List();
- bootstraps = new List();
-
- int position = 0;
- position += 1; // Skip Protocol
- if (Protocol == StampProtocol.PlainDNS)
- {
- position += 8; // Skip Properties
-
- // LP(addr [:port])
- position = LPHostIpPort(position, stampBinary, DefaultPort.PlainDNS, out ip, out port);
- if (position == -1) return false;
- return true;
- }
- else if (Protocol == StampProtocol.DnsCrypt)
- {
- position += 8; // Skip Properties
-
- // LP(addr [:port])
- position = LPHostIpPort(position, stampBinary, DefaultPort.DnsCrypt, out ip, out port);
- if (position == -1) return false;
-
- // LP(pk)
- position = LPPublicKey(position, stampBinary, out publicKey);
- if (position == -1) return false;
-
- // LP(providerName))
- position = LP(position, stampBinary, out providerName);
- if (position == -1) return false;
- return true;
- }
- else if (Protocol == StampProtocol.DoH)
- {
- position += 8; // Skip Properties
-
- // LP(addr)
- position = LPHostIpPort(position, stampBinary, DefaultPort.DoH, out ip, out port);
- if (position == -1) return false;
-
- // VLP(hash1, hash2, ...hashn)
- position = VLPHash(position, stampBinary, out hashi);
- if (position == -1) return false;
-
- // LP(hostname[:port])
- position = LPHostIpPort(position, stampBinary, port, out host, out port);
- if (position == -1) return false;
-
- // LP(path)
- position = LP(position, stampBinary, out path);
- if (position == -1) return false;
-
- // VLP(bootstrap_ip1, bootstrap_ip2, ...bootstrap_ipn) - Optional
- position = VLPBootstrap(position, stampBinary, out bootstraps);
- if (position == -1) return false;
- return true;
- }
- else if (Protocol == StampProtocol.DoT)
- {
- position += 8; // Skip Properties
-
- // LP(addr)
- position = LPHostIpPort(position, stampBinary, DefaultPort.DoT, out ip, out port);
- if (position == -1) return false;
-
- // VLP(hash1, hash2, ...hashn)
- position = VLPHash(position, stampBinary, out hashi);
- if (position == -1) return false;
-
- // LP(hostname [:port])
- position = LPHostIpPort(position, stampBinary, port, out host, out port);
- if (position == -1) return false;
-
- // VLP(bootstrap_ip1, bootstrap_ip2, ...bootstrap_ipn) - Optional
- position = VLPBootstrap(position, stampBinary, out bootstraps);
- if (position == -1) return false;
- return true;
- }
- else if (Protocol == StampProtocol.DoQ)
- {
- position += 8; // Skip Properties
-
- // LP(addr)
- position = LPHostIpPort(position, stampBinary, DefaultPort.DoQ, out ip, out port);
- if (position == -1) return false;
-
- // VLP(hash1, hash2, ...hashn)
- position = VLPHash(position, stampBinary, out hashi);
- if (position == -1) return false;
-
- // LP(hostname [:port])
- position = LPHostIpPort(position, stampBinary, port, out host, out port);
- if (position == -1) return false;
-
- // VLP(bootstrap_ip1, bootstrap_ip2, ...bootstrap_ipn) - Optional
- position = VLPBootstrap(position, stampBinary, out bootstraps);
- if (position == -1) return false;
- return true;
- }
- else if (Protocol == StampProtocol.ObliviousDohTarget)
- {
- position += 8; // Skip Properties
-
- // LP(hostname [:port])
- position = LPHostIpPort(position, stampBinary, DefaultPort.ObliviousDohTarget, out host, out port);
- if (position == -1) return false;
-
- // LP(path)
- position = LP(position, stampBinary, out path);
- if (position == -1) return false;
- return true;
- }
- else if (Protocol == StampProtocol.AnonymizedDNSCryptRelay)
- {
- // Anonymized DNSCrypt Relay doesn't have properties to skip
-
- // LP(addr)
- position = LPHostIpPort(position, stampBinary, DefaultPort.AnonymizedDNSCryptRelay, out ip, out port);
- if (position == -1) return false;
- return true;
- }
- else if (Protocol == StampProtocol.ObliviousDohRelay)
- {
- position += 8; // Skip Properties
-
- // LP(addr)
- position = LPHostIpPort(position, stampBinary, DefaultPort.ObliviousDohRelay, out ip, out port);
- if (position == -1) return false;
-
- // VLP(hash1, hash2, ...hashn)
- position = VLPHash(position, stampBinary, out hashi);
- if (position == -1) return false;
-
- // LP(hostname [:port])
- position = LPHostIpPort(position, stampBinary, port, out host, out port);
- if (position == -1) return false;
-
- // LP(path)
- position = LP(position, stampBinary, out path);
- if (position == -1) return false;
-
- // VLP(bootstrap_ip1, bootstrap_ip2, ...bootstrap_ipn) - Optional
- position = VLPBootstrap(position, stampBinary, out bootstraps);
- if (position == -1) return false;
- return true;
- }
-
- return true;
- }
-
- private int LPHostIpPort(int position, byte[] stampBinary, int defaultPort, out string host, out int port)
- {
- try
- {
- if (stampBinary.Length <= position)
- {
- host = string.Empty;
- port = -1;
- return -1;
- }
-
- int hostPortLength = Convert.ToInt32(stampBinary[position]);
- position += 1; // Skip Host:Port Length
-
- byte[] bHostPort = new byte[hostPortLength];
- if (stampBinary.Length >= position + hostPortLength)
- Buffer.BlockCopy(stampBinary, position, bHostPort, 0, hostPortLength);
-
- string hostPort = Encoding.UTF8.GetString(bHostPort);
- Network.GetHostDetails(hostPort, defaultPort, out host, out port, out _, out bool _);
- position += hostPortLength; // Skip Host:Port
-
- return position;
- }
- catch (Exception)
- {
- host = string.Empty;
- port = -1;
- return -1;
- }
- }
-
- private int LP(int position, byte[] stampBinary, out string outResult)
- {
- try
- {
- if (stampBinary.Length <= position)
- {
- outResult = string.Empty;
- return -1;
- }
-
- int inputLength = Convert.ToInt32(stampBinary[position]);
- position += 1; // Skip Input Length
-
- byte[] bInput = new byte[inputLength];
- if (stampBinary.Length >= position + inputLength)
- Buffer.BlockCopy(stampBinary, position, bInput, 0, inputLength);
-
- outResult = Encoding.UTF8.GetString(bInput);
- position += inputLength; // Skip Input
-
- return position;
- }
- catch (Exception)
- {
- outResult = string.Empty;
- return -1;
- }
- }
-
- private int LPPublicKey(int position, byte[] stampBinary, out string outResult)
- {
- try
- {
- if (stampBinary.Length <= position)
- {
- outResult = string.Empty;
- return -1;
- }
-
- int inputLength = Convert.ToInt32(stampBinary[position]);
- position += 1; // Skip Input Length
-
- byte[] bInput = new byte[inputLength];
- if (stampBinary.Length >= position + inputLength)
- Buffer.BlockCopy(stampBinary, position, bInput, 0, inputLength);
-
- outResult = Convert.ToHexString(bInput).ToLower();
- position += inputLength; // Skip Input
-
- return position;
- }
- catch (Exception)
- {
- outResult = string.Empty;
- return -1;
- }
- }
-
- private int VLPHash(int position, byte[] stampBinary, out List hashi)
- {
- try
- {
- List hashi0 = new();
- while (position < stampBinary.Length - 1)
- {
- bool last = false;
-
- if (stampBinary.Length <= position)
- {
- hashi = new(hashi0);
- return -1;
- }
-
- int vlen = Convert.ToInt32(stampBinary[position]);
-
- if ((vlen & 0x80) == 0x80) vlen ^= 0x80;
- else last = true;
-
- position += 1; // Skip Hash Length
-
- if (vlen > 0)
- {
- byte[] bHash = new byte[vlen];
- if (stampBinary.Length >= position + vlen)
- Buffer.BlockCopy(stampBinary, position, bHash, 0, vlen);
-
- string hash = Convert.ToHexString(bHash).ToLower();
- hashi0.Add(hash);
- }
-
- position += vlen; // Skip Hash
- if (last) break;
- }
-
- hashi = new(hashi0);
-
- return position;
- }
- catch (Exception)
- {
- hashi = new();
- return -1;
- }
- }
-
- private int VLPBootstrap(int position, byte[] stampBinary, out List bootstraps)
- {
- try
- {
- List bootstraps0 = new();
- while (position < stampBinary.Length - 1)
- {
- bool last = false;
-
- if (stampBinary.Length <= position)
- {
- bootstraps = new(bootstraps0);
- return -1;
- }
-
- int vlen = Convert.ToInt32(stampBinary[position]);
-
- if ((vlen & 0x80) == 0x80) vlen ^= 0x80;
- else last = true;
-
- position += 1; // Skip Bootstrap Length
-
- if (vlen > 0)
- {
- byte[] bBootstrap = new byte[vlen];
- if (stampBinary.Length >= position + vlen)
- Buffer.BlockCopy(stampBinary, position, bBootstrap, 0, vlen);
-
- string bootstrap = Encoding.UTF8.GetString(bBootstrap);
- bootstraps0.Add(bootstrap);
- }
-
- position += vlen; // Skip Bootstrap
- if (last) break;
- }
-
- bootstraps = new(bootstraps0);
-
- return position;
- }
- catch (Exception)
- {
- bootstraps = new();
- return -1;
- }
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsReader.cs b/MsmhTools/MsmhTools/DnsTool/DnsReader.cs
deleted file mode 100644
index 446afd6..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsReader.cs
+++ /dev/null
@@ -1,215 +0,0 @@
-using System;
-using System.Net;
-
-namespace MsmhTools.DnsTool
-{
- public class DnsReader
- {
- public string? IP { get; private set; }
- public int Port { get; private set; }
- public string Dns { get; private set; }
- public string Host { get; private set; } = string.Empty;
- public string Path { get; private set; } = string.Empty;
- public string CompanyName { get; private set; } = string.Empty;
- private string CompanyNameDataFileContent { get; set; } = string.Empty;
- public DnsProtocol Protocol { get; private set; }
- public string ProtocolName { get; private set; }
- public bool IsDnsCryptStamp { get; private set; } = false;
- public DnsCryptStamp StampProperties = new();
-
- public class DnsCryptStamp
- {
- public bool IsDnsSec { get; set; } = false;
- public bool IsNoLog { get; set; } = false;
- public bool IsNoFilter { get; set; } = false;
- }
-
- ///
- /// Read any DNS
- ///
- /// DNS Address
- /// File content to get company name. each line e.g. 8.8.8.8|Google Inc.
- public DnsReader(string dns, string? companyNameDataFileContent)
- {
- Dns = dns;
-
- if (!string.IsNullOrEmpty(companyNameDataFileContent))
- CompanyNameDataFileContent = companyNameDataFileContent;
-
- Protocol = DnsProtocol.Unknown;
- ProtocolName = DnsProtocolName.Unknown;
-
- if (dns.ToLower().StartsWith("sdns://"))
- {
- IsDnsCryptStamp = true;
-
- // Decode Stamp
- DNSCryptStampReader stamp = new(dns);
- if (stamp != null && stamp.IsDecryptionSuccess)
- {
- IP = stamp.IP;
- Port = stamp.Port;
- Host = stamp.Host;
- Path = stamp.Path;
- Protocol = ParseProtocol(stamp.Protocol);
- ProtocolName = stamp.ProtocolName;
- StampProperties.IsDnsSec = stamp.IsDnsSec;
- StampProperties.IsNoLog = stamp.IsNoLog;
- StampProperties.IsNoFilter = stamp.IsNoFilter;
-
- // Get Company Name (SDNS)
- string stampHost = stamp.Host;
- if (string.IsNullOrEmpty(stampHost)) stampHost = stamp.IP;
- if (string.IsNullOrEmpty(stampHost)) stampHost = stamp.ProviderName;
- if (!string.IsNullOrEmpty(CompanyNameDataFileContent))
- CompanyName = GetCompanyName(stampHost, CompanyNameDataFileContent);
- }
- }
- else
- {
- if (dns.ToLower().StartsWith("https://"))
- {
- // DoH
- SetIpPortHostPath(dns, 443);
-
- Protocol = DnsProtocol.DoH;
- ProtocolName = DnsProtocolName.DoH;
- }
- else if (dns.ToLower().StartsWith("tls://"))
- {
- // TLS
- SetIpPortHostPath(dns, 853);
-
- Protocol = DnsProtocol.DoT;
- ProtocolName = DnsProtocolName.DoT;
- }
- else if (dns.ToLower().StartsWith("quic://"))
- {
- // DoQ
- SetIpPortHostPath(dns, 853);
-
- Protocol = DnsProtocol.DoQ;
- ProtocolName = DnsProtocolName.DoQ;
- }
- else if (dns.ToLower().StartsWith("tcp://") || dns.ToLower().StartsWith("udp://"))
- {
- // Plain DNS
- SetIpPortHostPath(dns, 53);
-
- Protocol = DnsProtocol.PlainDNS;
- ProtocolName = DnsProtocolName.PlainDNS;
- }
- else
- {
- // Plain DNS
- SetIpPortHost(dns, 53);
-
- Protocol = DnsProtocol.PlainDNS;
- ProtocolName = DnsProtocolName.PlainDNS;
- }
- }
- }
-
- private void SetIpPortHostPath(string dns, int defaultPort)
- {
- Network.GetUrlDetails(dns, defaultPort, out string host, out int port, out string path, out bool isIPv6);
- Port = port;
- Path = path;
- bool isIPv4 = Network.IsIPv4Valid(host, out IPAddress? _);
- if (isIPv6 || isIPv4)
- {
- IP = host;
- }
- else
- {
- Host = host;
- IPAddress? ip = Network.HostToIP(host);
- if (ip != null)
- IP = ip.ToString();
- }
- if (!string.IsNullOrEmpty(CompanyNameDataFileContent))
- {
- string? ipOrHost = Host;
- if (string.IsNullOrEmpty(ipOrHost)) ipOrHost = IP;
- if (string.IsNullOrEmpty(ipOrHost)) ipOrHost = host;
- CompanyName = GetCompanyName(ipOrHost, CompanyNameDataFileContent);
- }
- }
-
- private void SetIpPortHost(string hostIpPort, int defaultPort)
- {
- Network.GetHostDetails(hostIpPort, defaultPort, out string host, out int port, out string _, out bool isIPv6);
- Port = port;
- bool isIPv4 = Network.IsIPv4Valid(host, out IPAddress? _);
- if (isIPv6 || isIPv4)
- {
- IP = host;
- }
- else
- {
- Host = host;
- IPAddress? ip = Network.HostToIP(host);
- if (ip != null)
- IP = ip.ToString();
- }
- if (!string.IsNullOrEmpty(CompanyNameDataFileContent))
- {
- string? ipOrHost = Host;
- if (string.IsNullOrEmpty(ipOrHost)) ipOrHost = IP;
- if (string.IsNullOrEmpty(ipOrHost)) ipOrHost = host;
- CompanyName = GetCompanyName(ipOrHost, CompanyNameDataFileContent);
- }
- }
-
- private static string GetCompanyName(string host, string fileContent)
- {
- return DnsTool.GetCompanyName.HostToCompanyOffline(host, fileContent);
- }
-
- private static DnsProtocol ParseProtocol(DNSCryptStampReader.StampProtocol stampProtocol)
- {
- var protocol = stampProtocol switch
- {
- DNSCryptStampReader.StampProtocol.PlainDNS => DnsProtocol.PlainDNS,
- DNSCryptStampReader.StampProtocol.DnsCrypt => DnsProtocol.DnsCrypt,
- DNSCryptStampReader.StampProtocol.DoH => DnsProtocol.DoH,
- DNSCryptStampReader.StampProtocol.DoT => DnsProtocol.DoT,
- DNSCryptStampReader.StampProtocol.DoQ => DnsProtocol.DoQ,
- DNSCryptStampReader.StampProtocol.ObliviousDohTarget => DnsProtocol.ObliviousDohTarget,
- DNSCryptStampReader.StampProtocol.AnonymizedDNSCryptRelay => DnsProtocol.AnonymizedDNSCryptRelay,
- DNSCryptStampReader.StampProtocol.ObliviousDohRelay => DnsProtocol.ObliviousDohRelay,
- DNSCryptStampReader.StampProtocol.Unknown => DnsProtocol.Unknown,
- _ => DnsProtocol.Unknown,
- };
- return protocol;
- }
-
- public enum DnsProtocol
- {
- PlainDNS,
- DnsCrypt,
- DoH,
- DoT,
- DoQ,
- ObliviousDohTarget,
- AnonymizedDNSCryptRelay,
- ObliviousDohRelay,
- Unknown
- }
-
- private struct DnsProtocolName
- {
- public static string PlainDNS = "Plain DNS";
- public static string DnsCrypt = "DNSCrypt";
- public static string DoH = "DNS-Over-HTTPS";
- public static string DoT = "DNS-Over-TLS";
- public static string DoQ = "DNS-Over-Quic";
- public static string ObliviousDohTarget = "Oblivious DoH Target";
- public static string AnonymizedDNSCryptRelay = "Anonymized DNSCrypt Relay";
- public static string ObliviousDohRelay = "Oblivious DoH Relay";
- public static string Unknown = "Unknown";
- }
-
-
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsByteExtensions.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsByteExtensions.cs
deleted file mode 100644
index d9ca82a..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsByteExtensions.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- internal static class DnsByteExtensions
- {
- public static short ReadInt16(byte a, byte b)
- {
- return (short)(a << 0 | b << 8);
- }
-
- public static ushort ReadUInt16(byte a, byte b)
- {
- return (ushort)(a << 0 | b << 8);
- }
-
- public static short ReadInt16(ReadOnlyMemory bytes, ref int offset)
- {
- var value = ReadInt16(bytes.Span[offset + 1], bytes.Span[offset + 0]);
- offset += sizeof(short);
- return value;
- }
-
- public static ushort ReadUInt16(ReadOnlyMemory bytes, ref int offset)
- {
- var value = ReadUInt16(bytes.Span[offset + 1], bytes.Span[offset + 0]);
- offset += sizeof(ushort);
- return value;
- }
-
- public static int ReadInt32(ReadOnlyMemory bytes, ref int offset)
- {
- var value = bytes.Span[offset + 3] << 0 |
- bytes.Span[offset + 2] << 8 |
- bytes.Span[offset + 1] << 16 |
- bytes.Span[offset + 0] << 24;
- offset += sizeof(int);
- return value;
- }
-
- public static uint ReadUInt32(ReadOnlyMemory bytes, ref int offset)
- {
- var value = bytes.Span[offset + 3] << 0 |
- bytes.Span[offset + 2] << 8 |
- bytes.Span[offset + 1] << 16 |
- bytes.Span[offset + 0] << 24;
- offset += sizeof(uint);
- return (uint)value;
- }
-
- public static string ToDebugString(ReadOnlyMemory bytes)
- {
- if (bytes.IsEmpty)
- {
- return "";
- }
-
- return $"new byte [] {{{string.Join(",", bytes.ToArray())}}}";
- }
-
- public static ReadOnlyMemory ReadBytes(ReadOnlyMemory bytes, int length, ref int offset)
- {
- var data = bytes.Slice(offset, length);
- offset += length;
- return data;
- }
-
- public static string ReadStringSimple(ReadOnlyMemory bytes, ref int offset)
- {
- byte labelLength = bytes.Span[offset];
- offset += 1;
-#if NETSTANDARD2_0
- var str = Encoding.ASCII.GetString(bytes.Slice(offset, labelLength).ToArray());
-#else
- var str = Encoding.ASCII.GetString(bytes.Slice(offset, labelLength).Span);
-#endif
- offset += labelLength;
- return str;
- }
-
- public static string[] ReadString(ReadOnlyMemory bytes, ref int offset, bool compressionPermitted = true)
- {
- // Assume most labels consist of 3 parts
- var parts = new List(3);
-
- int? preCompressionOffset = null;
- while (offset < bytes.Length)
- {
- if (bytes.Span[offset] == 0)
- {
- offset++;
- break;
- }
-
- // Pointers are always 192 or more, because the first two bits are 1s
- if (bytes.Span[offset] >= 192 && compressionPermitted)
- {
- if (!preCompressionOffset.HasValue)
- {
- preCompressionOffset = offset + 2;
- }
-
- // Read the 14 bit pointer as our new offset
- offset = ReadUInt16(bytes.Span[offset + 1], (byte)(bytes.Span[offset] & (1 << 6) - 1));
- }
-
- parts.Add(ReadStringSimple(bytes, ref offset));
- }
-
- if (preCompressionOffset.HasValue)
- {
- offset = preCompressionOffset.Value;
- }
-
- return parts.ToArray();
- }
-
- public static ReadOnlyMemory AllocateAndWrite(IDnsByteArrayWriter writer)
- {
- var buffer = AllocatePinnedNetworkBuffer();
- var offset = 0;
- writer.WriteBytes(buffer, ref offset);
-#if NETSTANDARD2_0
- return buffer.AsMemory().Slice(0, offset);
-#else
- return buffer.Slice(0, offset);
-#endif
- }
-
-#if NETSTANDARD2_0
- public static ArraySegment Slice(this ArraySegment buffer, int start, int length)
- {
- return new ArraySegment(buffer.Array, start, length);
- }
-
- public static ArraySegment Slice(this ArraySegment buffer, int start)
- {
- return Slice(buffer, start, buffer.Count - start);
- }
-#endif
-
- private const int NetworkBufferSize = 65527;
-
-#if NETSTANDARD2_0 || NETSTANDARD2_1
- public static ArraySegment AllocatePinnedNetworkBuffer() => new ArraySegment(new byte[NetworkBufferSize]);
-#else
- // Allocate a buffer which will be used for the incoming query, and re-used to send the answer.
- // Also make it pinned, see https://enclave.io/high-performance-udp-sockets-net6/
- public static Memory AllocatePinnedNetworkBuffer() => GC.AllocateArray(NetworkBufferSize, true);
-#endif
-
- public static TReader FromBytes(ReadOnlyMemory bytes) where TReader : IDnsByteArrayReader, new()
- {
- var offset = 0;
-
- var reader = new TReader();
- reader.ReadBytes(bytes, ref offset);
-
- if (offset != bytes.Length)
- {
- throw new InvalidOperationException($"Should have read {bytes.Length} bytes, only read {offset} bytes");
- }
- return reader;
- }
-
- public static void ToBytes(ReadOnlySpan strings, Memory buffer, ref int offset)
- {
- for (int i = 0; i < strings.Length; i++)
- {
- // First write the value 1 byte from the offset to leave room for the length byte
-#if NETSTANDARD2_0
- var stringBytes = Encoding.ASCII.GetBytes(strings[i]);
- stringBytes.CopyTo(buffer.Slice(offset + 1, strings[i].Length));
- var length = stringBytes.Length;
-#else
- var length = Encoding.ASCII.GetBytes(strings[i], buffer.Slice(offset + 1, strings[i].Length).Span);
-#endif
-
- // Then write the length before the value
- buffer.Span[offset] = (byte)length;
-
- // Finally advance the offset past the length and value
- offset += 1 + length;
- }
-
- buffer.Span[offset++] = 0;
- }
-
- public static void ToBytes(int value, Memory buffer, ref int offset)
- {
- buffer.Span[offset++] = (byte)(value >> 24);
- buffer.Span[offset++] = (byte)(value >> 16);
- buffer.Span[offset++] = (byte)(value >> 8);
- buffer.Span[offset++] = (byte)(value >> 0);
- }
-
- public static void ToBytes(uint value, Memory buffer, ref int offset)
- {
- buffer.Span[offset++] = (byte)(value >> 24);
- buffer.Span[offset++] = (byte)(value >> 16);
- buffer.Span[offset++] = (byte)(value >> 8);
- buffer.Span[offset++] = (byte)(value >> 0);
- }
-
- public static void ToBytes(short value, Memory buffer, ref int offset)
- {
- buffer.Span[offset++] = (byte)(value >> 8);
- buffer.Span[offset++] = (byte)(value >> 0);
- }
-
- public static void ToBytes(ushort value, Memory buffer, ref int offset)
- {
- buffer.Span[offset++] = (byte)(value >> 8);
- buffer.Span[offset++] = (byte)(value >> 0);
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsDomainResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsDomainResource.cs
deleted file mode 100644
index 0f0d813..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsDomainResource.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a DNS text resource containing a domain name.
- ///
- public sealed class DnsDomainResource : DnsStringResource
- {
- ///
- protected override bool CanUseCompression => true;
-
- ///
- /// Get the value of this entry as a domain name.
- ///
- public string Domain => string.Join(".", Entries);
-
- ///
- public override string ToString() => Domain;
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsHeader.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsHeader.cs
deleted file mode 100644
index 945277d..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsHeader.cs
+++ /dev/null
@@ -1,230 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a DNS header, the first entry in a .
- /// See for methods to create DNS headers for specific purposes.
- ///
- public sealed class DnsHeader : IEquatable, IDnsByteArrayReader, IDnsByteArrayWriter
- {
- ///
- /// Gets or sets the unique ID of this DNS query.
- ///
- ///
- /// A unique ID which allows the sender/receiver to
- /// identify this DNS message (for example if the transport protocol is stateless).
- ///
- public ushort Id { get; set; }
-
- internal ushort Flags { get; set; }
-
- ///
- /// The number of questions in this header.
- ///
- ///
- /// A count of the number of questions asked of the DNS server.
- ///
- public short QuestionCount { get; set; }
-
- ///
- /// The number of records in this header.
- ///
- ///
- /// A count of the number of answers contained within this DNS message.
- ///
- public short AnswerRecordCount { get; set; }
-
- ///
- /// The number of name server records in this header.
- ///
- ///
- /// A count of the number of DNS name server records in this header.
- ///
- public short NameServerRecordCount { get; set; }
-
- ///
- /// The number of additional records in this header.
- ///
- ///
- /// A count of the number of additional records in this header.
- ///
- public short AdditionalRecordCount { get; set; }
-
- internal string[] Labels { get; set; }
-
- ///
- /// The of this header.
- ///
- ///
- /// If the type of query is , it means the query is for IP address records.
- ///
- public DnsQueryType QueryType { get; set; }
-
- ///
- /// The of this header, normally (Internet).
- ///
- ///
- /// The class of query, most likely to represent Internet DNS queries.
- ///
- public DnsQueryClass QueryClass { get; set; }
-
- ///
- /// Determines whether this is a DNS query or answer.
- ///
- ///
- /// For DNS queries this is false, for DNS responses this is true.
- ///
- public bool IsQueryResponse
- {
- get => (Flags & 0x8000) == 0x8000;
- set => Flags = value ? (ushort)(Flags | 0x8000) : (ushort)(Flags & (~0x8000));
- }
-
- ///
- /// Determines the operation code for this DNS header.
- ///
- ///
- /// The DNS operation code for this DNS answer. For example .
- ///
- public DnsOperationCode OperationCode
- {
- get => (DnsOperationCode)((Flags & 0x7800) >> 11);
- set => Flags = (ushort)((Flags & ~0x7800) | ((int)value << 11));
- }
-
- ///
- /// Determines whether the answer was from an authoritative DNS server.
- ///
- ///
- /// If true, this DNS answer is authoritative.
- ///
- public bool AuthoritativeAnswer
- {
- get => (Flags & 0x0400) == 0x0400;
- set => Flags = value ? (ushort)(Flags | 0x0400) : (ushort)(Flags & (~0x0400));
- }
-
- ///
- /// Determines whether this DNS answer was truncated due to size.
- ///
- public bool Truncation
- {
- get => (Flags & 0x0200) == 0x0200;
- set => Flags = value ? (ushort)(Flags | 0x0200) : (ushort)(Flags & (~0x0200));
- }
-
- ///
- /// Indicates whether recursion is desired on this DNS query.
- /// If this is an answer, indicates whether the original query requested recursion.
- ///
- public bool RecursionDesired
- {
- get => (Flags & 0x0100) == 0x0100;
- set => Flags = value ? (ushort)(Flags | 0x0100) : (ushort)(Flags & (~0x0100));
- }
-
- ///
- /// Indicates whether recursion is available.
- ///
- public bool RecursionAvailable
- {
- get => (Flags & 0x0080) == 0x0080;
- set => Flags = value ? (ushort)(Flags | 0x0080) : (ushort)(Flags & (~0x0080));
- }
-
- ///
- /// The for this result.
- ///
- public DnsResponseCode ResponseCode
- {
- get => (DnsResponseCode)(Flags & 0x000F);
- set => Flags = (ushort)((Flags & ~0x000F) | (byte)value);
- }
-
- ///
- /// The DNS host to use, for example "example.com".
- ///
- public string Host
- {
- get => string.Join(".", Labels);
- set => Labels = value.Split('.');
- }
-
- ///
- public override string ToString() => $"{(IsQueryResponse ? "RES" : "QRY")}: {Id} Domain: {Host} Type: {QueryType} Class: {QueryClass}";
-
- ///
- public bool Equals(DnsHeader other)
- {
- return Id == other.Id &&
- Flags == other.Flags &&
- QuestionCount == other.QuestionCount &&
- AnswerRecordCount == other.AnswerRecordCount &&
- NameServerRecordCount == other.NameServerRecordCount &&
- AdditionalRecordCount == other.AdditionalRecordCount &&
- Host == other.Host &&
- QueryType == other.QueryType &&
- QueryClass == other.QueryClass;
- }
-
- ///
- public override int GetHashCode()
- {
- HashCode hash = new HashCode();
- hash.Add(Id);
- hash.Add(Flags);
- hash.Add(QuestionCount);
- hash.Add(AnswerRecordCount);
- hash.Add(NameServerRecordCount);
- hash.Add(AdditionalRecordCount);
- hash.Add(QueryType);
- hash.Add(QueryClass);
- hash.Add(Host);
- return hash.ToHashCode();
- }
-
- ///
- public void ReadBytes(ReadOnlyMemory bytes, ref int offset)
- {
- Id = DnsByteExtensions.ReadUInt16(bytes, ref offset);
- Flags = DnsByteExtensions.ReadUInt16(bytes, ref offset);
- QuestionCount = DnsByteExtensions.ReadInt16(bytes, ref offset);
- AnswerRecordCount = DnsByteExtensions.ReadInt16(bytes, ref offset);
- NameServerRecordCount = DnsByteExtensions.ReadInt16(bytes, ref offset);
- AdditionalRecordCount = DnsByteExtensions.ReadInt16(bytes, ref offset);
- Labels = DnsByteExtensions.ReadString(bytes, ref offset);
- QueryType = (DnsQueryType)DnsByteExtensions.ReadUInt16(bytes, ref offset);
- QueryClass = (DnsQueryClass)DnsByteExtensions.ReadUInt16(bytes, ref offset);
-
- if (!IsQueryResponse && (AnswerRecordCount > 0 || NameServerRecordCount > 0))
- {
- throw new InvalidOperationException($"Header states that this message is a query, yet there are answer and nameserver records.");
- }
- }
-
- ///
- public void WriteBytes(Memory bytes, ref int offset)
- {
- DnsByteExtensions.ToBytes(Id, bytes, ref offset);
- DnsByteExtensions.ToBytes(Flags, bytes, ref offset);
- DnsByteExtensions.ToBytes(QuestionCount, bytes, ref offset);
- DnsByteExtensions.ToBytes(AnswerRecordCount, bytes, ref offset);
- DnsByteExtensions.ToBytes(NameServerRecordCount, bytes, ref offset);
- DnsByteExtensions.ToBytes(AdditionalRecordCount, bytes, ref offset);
- DnsByteExtensions.ToBytes(Labels, bytes, ref offset);
- DnsByteExtensions.ToBytes((ushort)QueryType, bytes, ref offset);
- DnsByteExtensions.ToBytes((ushort)QueryClass, bytes, ref offset);
- }
-
- ///
- /// A generic bag of tags associated with this object.
- /// Will not be serialised and/or passed over the wire.
- ///
- public IDictionary Tags { get; } = new Dictionary();
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsIpAddressResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsIpAddressResource.cs
deleted file mode 100644
index b06e348..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsIpAddressResource.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a DNS resource record which contains an Internet Protocol address.
- /// See and .
- ///
- public sealed class DnsIpAddressResource : IDnsResource, IEquatable
- {
- ///
- /// The Internet Protocol address.
- ///
- ///
- /// May be an IPv4 or IPv6 address, depending on the record type.
- ///
- public IPAddress IPAddress { get; set; }
-
- ///
- public bool Equals(DnsIpAddressResource other) => IPAddress.Equals(other.IPAddress);
-
- ///
- public override bool Equals(object obj) => obj is DnsIpAddressResource record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(IPAddress);
-
- ///
- public void ReadBytes(ReadOnlyMemory bytes, ref int offset, int length)
- {
- var raw = DnsByteExtensions.ReadBytes(bytes, length, ref offset);
- IPAddress = new IPAddress(raw.ToArray());
- }
-
- ///
- public IEnumerable> WriteBytes()
- {
- yield return IPAddress.GetAddressBytes();
- }
-
- ///
- public override string ToString() => IPAddress.ToString();
-
- ///
- public void WriteBytes(Memory bytes, ref int offset)
- {
- Span address = IPAddress.GetAddressBytes();
-
- address.CopyTo(bytes.Slice(offset).Span);
- offset += address.Length;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsMessage.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsMessage.cs
deleted file mode 100644
index a6721f7..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsMessage.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents an answer to a DNS query, generated by a DNS server.
- ///
- public sealed class DnsMessage : IEquatable, IDnsByteArrayReader, IDnsByteArrayWriter
- {
- ///
- /// The section of this answer.
- ///
- /// Gets or sets the , which describes the original DNS query.
- public DnsHeader Header { get; set; } = new DnsHeader();
-
- ///
- /// The list of DNS resources returned by the server.
- ///
- /// Gets or sets the list representing values returned by the DNS server.
- public IList Answers { get; set; } = Array.Empty();
-
- ///
- /// The list of name server DNS resources returned by the server.
- ///
- /// Gets or sets the list representing values returned by the DNS server.
- public IList Nameservers { get; set; } = Array.Empty();
-
- ///
- /// The list of additional DNS resources returned by the server.
- ///
- /// Gets or sets the list representing values returned by the DNS server.
- public IList Additional { get; set; } = Array.Empty();
-
- ///
- public bool Equals(DnsMessage other) => Header.Equals(other.Header) &&
- Answers.SequenceEqual(other.Answers) &&
- Nameservers.SequenceEqual(other.Nameservers) &&
- Additional.SequenceEqual(other.Additional);
-
- ///
- public override bool Equals(object obj) => obj is DnsMessage record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(Header, Answers, Nameservers, Additional);
-
- private IList ReadRecords(int count, ReadOnlyMemory bytes, ref int offset)
- {
- var records = new DnsResourceRecord[count];
- for (var i = 0; i < count; i++)
- {
- var record = new DnsResourceRecord();
- record.ReadBytes(bytes, ref offset);
- records[i] = record;
- }
-
- return records;
- }
-
- private void EnsureCorrectCounts()
- {
- if (Header.AnswerRecordCount != Answers.Count)
- {
- throw new InvalidOperationException($"Header states there are {Header.AnswerRecordCount} answer records, there are {Answers.Count}");
- }
-
- if (Header.AdditionalRecordCount != Additional.Count)
- {
- throw new InvalidOperationException($"Header states there are {Header.AdditionalRecordCount} additional records, there are {Additional.Count}");
- }
-
- if (Header.NameServerRecordCount != Nameservers.Count)
- {
- throw new InvalidOperationException($"Header states there are {Header.NameServerRecordCount} nameserver records, there are {Nameservers.Count}");
- }
- }
-
- ///
- public void ReadBytes(ReadOnlyMemory bytes, ref int offset)
- {
- EnsureCorrectCounts();
- Header.ReadBytes(bytes, ref offset);
- Answers = ReadRecords(Header.AnswerRecordCount, bytes, ref offset);
- Nameservers = ReadRecords(Header.NameServerRecordCount, bytes, ref offset);
- Additional = ReadRecords(Header.AdditionalRecordCount, bytes, ref offset);
- }
-
- ///
- public override string ToString()
- {
- var sb = new StringBuilder();
- sb.Append($"{Header} Response: {Header.ResponseCode}");
-
- if (Answers.Count > 0)
- {
- sb.Append($"{Environment.NewLine}Answers: {Answers.Count}{string.Concat(Answers.Select(x => $"{Environment.NewLine} * {x}"))}");
- }
-
- if (Additional.Count > 0)
- {
- sb.Append($"{Environment.NewLine}Additional: {Additional.Count}{string.Concat(Additional.Select(x => $"{Environment.NewLine} * {x}"))}");
- }
-
- return sb.ToString();
- }
-
- ///
- public void WriteBytes(Memory bytes, ref int offset)
- {
- EnsureCorrectCounts();
- Header.WriteBytes(bytes, ref offset);
-
- foreach (var answer in Answers)
- {
- answer.WriteBytes(bytes, ref offset);
- }
-
- foreach (var nameserver in Nameservers)
- {
- nameserver.WriteBytes(bytes, ref offset);
- }
-
- foreach (var additional in Additional)
- {
- additional.WriteBytes(bytes, ref offset);
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsMxResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsMxResource.cs
deleted file mode 100644
index be8c47e..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsMxResource.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a mail server DNS record. See .
- ///
- public sealed class DnsMxResource : DnsStringResource, IEquatable
- {
- ///
- /// The priority or preference field identifies which mailserver should be preferred.
- ///
- ///
- /// The priority field identifies which mailserver should be preferred - if multiple
- /// values are the same, mail would be expected to flow evenly to all hosts.
- ///
- public ushort Preference { get; set; }
-
- ///
- /// The domain name of a mailserver.
- ///
- ///
- /// The host name must map directly to one or more address records (A, or AAAA) in the DNS, and must not point to any CNAME records.
- ///
- public string Exchange => string.Join(".", Entries);
-
- ///
- protected override bool CanUseCompression => true;
-
- ///
- public bool Equals(DnsMxResource other) => Preference == other.Preference && Exchange == other.Exchange;
-
- ///
- public override bool Equals(object obj) => obj is DnsMxResource record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(Preference, Exchange);
-
- ///
- public override void ReadBytes(ReadOnlyMemory bytes, ref int offset, int length)
- {
- Preference = DnsByteExtensions.ReadUInt16(bytes, ref offset);
- base.ReadBytes(bytes, ref offset, length - sizeof(ushort));
- }
-
- ///
- public override string ToString() => Exchange;
-
- ///
- public override void WriteBytes(Memory bytes, ref int offset)
- {
- DnsByteExtensions.ToBytes(Preference, bytes, ref offset);
- base.WriteBytes(bytes, ref offset);
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsOperationCode.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsOperationCode.cs
deleted file mode 100644
index 9689897..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsOperationCode.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// DNS operation codes. See https://www.iana.org/assignments/dns-parameters/dns-parameters.xml#dns-parameters-5
- ///
- public enum DnsOperationCode : byte
- {
- ///
- /// Query
- ///
- QUERY = 0,
- ///
- /// IQuery (Inverse Query, OBSOLETE)
- ///
- IQUERY = 1,
- ///
- /// Status
- ///
- STATUS = 2,
- ///
- /// Notify
- ///
- NOTIFY = 4,
- ///
- /// Update
- ///
- UPDATE = 5,
- ///
- /// DNS Stateful Operations (DSO)
- ///
- DSO = 6,
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsOptResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsOptResource.cs
deleted file mode 100644
index e6813c5..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsOptResource.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Describes an EDNS0 psuedo-resource.
- ///
- public sealed class DnsOptResource : IDnsResource, IEquatable
- {
- ///
- /// The raw bytes recieved for this DNS resource.
- ///
- ///
- /// The raw set of bytes representing the value fo this DNS resource.
- /// For string values, due to compression the whole packet may be needed.
- ///
- public ReadOnlyMemory Raw { get; set; }
-
- ///
- public bool Equals(DnsOptResource other) => Raw.Span.SequenceEqual(other.Raw.Span);
-
- ///
- public override bool Equals(object obj) => obj is DnsOptResource record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(Raw);
-
- ///
- public void ReadBytes(ReadOnlyMemory bytes, ref int offset, int length)
- {
- Raw = DnsByteExtensions.ReadBytes(bytes, length, ref offset);
- }
-
- ///
- public void WriteBytes(Memory bytes, ref int offset)
- {
- // Payloadsize / flags is serialised at a higher level
- Raw.CopyTo(bytes.Slice(offset));
- offset += Raw.Length;
- }
-
- ///
- public override string ToString() => $"Raw: {Raw.Length} bytes";
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryClass.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryClass.cs
deleted file mode 100644
index 240cc2e..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryClass.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// DNS class. See https://www.iana.org/assignments/dns-parameters/dns-parameters.xml#dns-parameters-2
- ///
- public enum DnsQueryClass : ushort
- {
- ///
- /// Internet (IN)
- ///
- IN = 1,
- ///
- /// Chaos (CH)
- ///
- CH = 3,
- ///
- /// Hesiod (HS)
- ///
- HS = 4,
- ///
- /// QCLASS NONE
- ///
- QCLASS_NONE = 254,
- ///
- /// QCLASS * (ANY)
- ///
- QCLASS_ANY = 255,
- ///
- /// Standards Action
- ///
- StandardsAction = 65535
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryFactory.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryFactory.cs
deleted file mode 100644
index 06ddac2..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryFactory.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net;
-using System.Net.Sockets;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Provides extension methods around .
- ///
- public static class DnsQueryFactory
- {
- ///
- /// Generate a unique ID to identify this DNS message.
- ///
- /// A random value.
- public static ushort GenerateId()
- {
- var offset = 0;
- return DnsByteExtensions.ReadUInt16(Guid.NewGuid().ToByteArray(), ref offset);
- }
-
- ///
- /// Create a DNS query using the specified host name and DNS query type.
- ///
- /// The DNS host to request in the query.
- /// The type of DNS query to request.
- /// The complete DNS query.
- public static DnsMessage CreateQuery(string host, DnsQueryType type = DnsQueryType.A)
- {
- return new DnsMessage
- {
- Header = new DnsHeader
- {
- Id = GenerateId(),
- Host = host,
- QueryType = type,
- QueryClass = DnsQueryClass.IN,
- OperationCode = DnsOperationCode.QUERY,
- QuestionCount = 1,
- RecursionDesired = true
- }
- };
- }
-
- public static DnsHeader Clone(DnsHeader header)
- {
- return new DnsHeader
- {
- Id = header.Id,
- Host = header.Host,
- QueryType = header.QueryType,
- QueryClass = header.QueryClass,
- OperationCode = header.OperationCode,
- QuestionCount = header.QuestionCount,
- RecursionDesired = header.RecursionDesired,
- AdditionalRecordCount = header.AdditionalRecordCount,
- AnswerRecordCount = header.AnswerRecordCount,
- AuthoritativeAnswer = header.AuthoritativeAnswer,
- IsQueryResponse = header.IsQueryResponse,
- NameServerRecordCount = header.NameServerRecordCount,
- RecursionAvailable = header.RecursionAvailable,
- ResponseCode = header.ResponseCode,
- Truncation = header.Truncation
- };
- }
-
- public static DnsMessage TruncateAnswer(DnsMessage query)
- {
- var header = Clone(query.Header);
-
- header.AnswerRecordCount = 0;
- header.NameServerRecordCount = 0;
- header.AdditionalRecordCount = 0;
- header.IsQueryResponse = true;
- header.OperationCode = DnsOperationCode.QUERY;
- header.Truncation = true;
-
- return new DnsMessage { Header = header };
- }
-
- ///
- /// Create a reverse DNS query which resolves an IP address to a host name.
- ///
- /// The IPv4 or IPv6 address to resolve.
- /// The correctly formatted DNS query.
- public static DnsMessage CreateReverseQuery(IPAddress ipAddress)
- {
- return CreateQuery(GetReverseLookupHostForIpAddress(ipAddress), DnsQueryType.PTR);
- }
-
- private static string GetReverseLookupHostForIpAddress(IPAddress ipAddress)
- {
- if (ipAddress.AddressFamily == AddressFamily.InterNetworkV6)
- {
- return string.Join(".", string.Concat(ipAddress.GetAddressBytes().Select(x => x.ToString("x2"))).Reverse()) + ".ip6.arpa";
- }
- else if (ipAddress.AddressFamily == AddressFamily.InterNetwork)
- {
- return string.Join(".", ipAddress.ToString().Split('.').Reverse()) + ".in-addr.arpa";
- }
- else
- {
- throw new InvalidOperationException($"Invalid address type: {ipAddress.AddressFamily}");
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryType.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryType.cs
deleted file mode 100644
index 2881091..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsQueryType.cs
+++ /dev/null
@@ -1,296 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// DNS resource record type. See https://www.iana.org/assignments/dns-parameters/dns-parameters.xml#dns-parameters-4
- ///
- public enum DnsQueryType : ushort
- {
- ///
- /// A host address
- ///
- A = 1,
- ///
- /// An authoritative name server
- ///
- NS = 2,
- ///
- /// A mail destination (OBSOLETE - use MX)
- ///
- MD = 3,
- ///
- /// A mail forwarder (OBSOLETE - use MX)
- ///
- MF = 4,
- ///
- /// The canonical name for an alias
- ///
- CNAME = 5,
- ///
- /// Marks the start of a zone of authority
- ///
- SOA = 6,
- ///
- /// A mailbox domain name (EXPERIMENTAL)
- ///
- MB = 7,
- ///
- /// A mail group member (EXPERIMENTAL)
- ///
- MG = 8,
- ///
- /// A mail rename domain name (EXPERIMENTAL)
- ///
- MR = 9,
- ///
- /// A null RR (EXPERIMENTAL)
- ///
- NULL = 10,
- ///
- /// A well known service description
- ///
- WKS = 11,
- ///
- /// A domain name pointer
- ///
- PTR = 12,
- ///
- /// Host information
- ///
- HINFO = 13,
- ///
- /// Mailbox or mail list information
- ///
- MINFO = 14,
- ///
- /// Mail exchange
- ///
- MX = 15,
- ///
- /// Text strings
- ///
- TEXT = 16,
- ///
- /// For Responsible Person
- ///
- RP = 17,
- ///
- /// For AFS Data Base location
- ///
- AFSDB = 18,
- ///
- /// For X.25 PSDN address
- ///
- X25 = 19,
- ///
- /// For ISDN address
- ///
- ISDN = 20,
- ///
- /// For Route Through
- ///
- RT = 21,
- ///
- /// For NSAP address, NSAP style A record
- ///
- NSAP = 22,
- ///
- /// For domain name pointer, NSAP style
- ///
- NSAPPTR = 23,
- ///
- /// For security signature
- ///
- SIG = 24,
- ///
- /// For security key
- ///
- KEY = 25,
- ///
- /// X.400 mail mapping information
- ///
- PX = 26,
- ///
- /// Geographical Position
- ///
- GPOS = 27,
- ///
- /// IP6 Address
- ///
- AAAA = 28,
- ///
- /// Location Information
- ///
- LOC = 29,
- ///
- /// Next Domain (OBSOLETE)
- ///
- NXT = 30,
- ///
- /// Endpoint Identifier
- ///
- EID = 31,
- ///
- /// Nimrod Locator
- ///
- NIMLOC = 32,
- ///
- /// Server Selection
- ///
- SRV = 33,
- ///
- /// ATM Address
- ///
- ATMA = 34,
- ///
- /// Naming Authority Pointer
- ///
- NAPTR = 35,
- ///
- /// Key Exchanger
- ///
- KX = 36,
- CERT = 37,
- ///
- /// A6 (OBSOLETE - use AAAA)
- ///
- A6 = 38,
- DNAME = 39,
- SINK = 40,
- OPT = 41,
- APL = 42,
- ///
- /// Delegation Signer
- ///
- DS = 43,
- ///
- /// SSH Key Fingerprint
- ///
- SSHFP = 44,
- IPSECKEY = 45,
- RRSIG = 46,
- NSEC = 47,
- DNSKEY = 48,
- DHCID = 49,
- NSEC3 = 50,
- NSEC3PARAM = 51,
- TLSA = 52,
- ///
- /// S/MIME cert association
- ///
- SMIMEA = 53,
- ///
- /// Host Identity Protocol
- ///
- HIP = 55,
- NINFO = 56,
- RKEY = 57,
- ///
- /// Trust Anchor LINK
- ///
- TALINK = 58,
- ///
- /// Child DS
- ///
- CDS = 59,
- ///
- /// DNSKEY(s) the Child wants reflected in DS
- ///
- CDNSKEY = 60,
- ///
- /// OpenPGP Key
- ///
- OPENPGPKEY = 61,
- ///
- /// Child-To-Parent Synchronization
- ///
- CSYNC = 62,
- ///
- /// Message digest for DNS zone
- ///
- ZONEMD = 63,
- ///
- /// Service Binding
- ///
- SVCB = 64,
- ///
- /// HTTPS Binding
- ///
- HTTPS = 65,
- SPF = 99,
- UINFO = 100,
- UID = 101,
- GID = 102,
- UNSPEC = 103,
- NID = 104,
- L32 = 105,
- L64 = 106,
- LP = 107,
- ///
- /// An EUI-48 address
- ///
- EUI48 = 108,
- ///
- /// An EUI-64 address
- ///
- EUI64 = 109,
- ///
- /// Transaction Key
- ///
- TKEY = 249,
- ///
- /// Transaction Signature
- ///
- TSIG = 250,
- ///
- /// Incremental transfer
- ///
- IXFR = 251,
- ///
- /// Transfer of an entire zone
- ///
- AXFR = 252,
- ///
- /// Mailbox-related RRs (MB, MG or MR)
- ///
- MAILB = 253,
- ///
- /// Mail agent RRs (OBSOLETE - see MX)
- ///
- MAILA = 254,
- ///
- /// A request for some or all records the server has available
- ///
- ANY = 255,
- URI = 256,
- ///
- /// Certification Authority Restriction
- ///
- CAA = 257,
- ///
- /// Application Visibility and Control
- ///
- AVC = 258,
- ///
- /// Digital Object Architecture
- ///
- DOA = 259,
- ///
- /// Automatic Multicast Tunneling Relay
- ///
- AMTRELAY = 260,
- ///
- /// DNSSEC Trust Authorities
- ///
- TA = 32768,
- ///
- /// DNSSEC Lookaside Validation (OBSOLETE)
- ///
- DLV = 32769
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsResourceRecord.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsResourceRecord.cs
deleted file mode 100644
index d0152c7..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsResourceRecord.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents metadata around a DNS resource record returned by a DNS server.
- ///
- public sealed class DnsResourceRecord : IEquatable, IDnsByteArrayReader, IDnsByteArrayWriter
- {
- ///
- /// The type of DNS query.
- ///
- public DnsQueryType Type { get; set; }
- ///
- /// The class of DNS query.
- ///
- public DnsQueryClass Class { get; set; }
- ///
- /// The time to live entry for this record, in seconds.
- ///
- public uint TimeToLive { get; set; }
-
- ///
- /// The host name associated with this record.
- ///
- public string Host
- {
- get => string.Join(".", Name);
- set => Name = value.Split('.');
- }
-
- private string[] Name { get; set; }
-
- ///
- /// The value of this DNS record, which should be
- /// cast to the appropriate resource record type
- /// class depending on the .
- ///
- public IDnsResource Resource { get; set; }
-
- private IDnsResource CreateResourceRecord(DnsQueryType recordType)
- {
- return recordType switch
- {
- DnsQueryType.A => new DnsIpAddressResource(),
- DnsQueryType.AAAA => new DnsIpAddressResource(),
- DnsQueryType.TEXT => new DnsTextResource(),
- DnsQueryType.CNAME => new DnsDomainResource(),
- DnsQueryType.NS => new DnsDomainResource(),
- DnsQueryType.PTR => new DnsDomainResource(),
- DnsQueryType.SPF => new DnsTextResource(),
- DnsQueryType.SOA => new DnsSoaResource(),
- DnsQueryType.MX => new DnsMxResource(),
- DnsQueryType.OPT => new DnsOptResource(),
- _ => new DnsUnknownResource(),
- };
- }
-
- ///
- public override string ToString() => $"Name: {Host} Type: {Type} Class: {Class} TTL: {TimeToLive} Resource: {Resource}";
-
- ///
- public bool Equals(DnsResourceRecord other) => Host == other.Host &&
- Type == other.Type &&
- Class == other.Class &&
- TimeToLive == other.TimeToLive &&
- Resource.Equals(other.Resource);
-
- ///
- public override bool Equals(object obj) => obj is DnsResourceRecord record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(Name, Type, Class, TimeToLive, Host, Resource);
-
- ///
- public void ReadBytes(ReadOnlyMemory bytes, ref int offset)
- {
- Name = DnsByteExtensions.ReadString(bytes, ref offset);
- Type = (DnsQueryType)DnsByteExtensions.ReadUInt16(bytes, ref offset);
- Class = (DnsQueryClass)DnsByteExtensions.ReadUInt16(bytes, ref offset);
- TimeToLive = DnsByteExtensions.ReadUInt32(bytes, ref offset);
- Resource = CreateResourceRecord(Type);
- var dataLength = DnsByteExtensions.ReadUInt16(bytes, ref offset);
- FromBytesKnownLength(Resource, bytes, ref offset, dataLength);
- }
-
- private static void FromBytesKnownLength(IDnsResource resource, ReadOnlyMemory bytes, ref int offset, int length)
- {
- var expectedOffset = offset + length;
- resource.ReadBytes(bytes, ref offset, length);
- if (offset != expectedOffset)
- {
- throw new InvalidOperationException($"{resource.GetType().Name}.{nameof(IDnsResource.ReadBytes)} did not read to offset {expectedOffset} (read to {offset})");
- }
- }
-
- ///
- public void WriteBytes(Memory bytes, ref int offset)
- {
- DnsByteExtensions.ToBytes(Name, bytes, ref offset);
- DnsByteExtensions.ToBytes((ushort)Type, bytes, ref offset);
- DnsByteExtensions.ToBytes((ushort)Class, bytes, ref offset);
- DnsByteExtensions.ToBytes(TimeToLive, bytes, ref offset);
-
- // First, write the resource, but save two bytes for the size (and do not advance the offset)
- var resourceSize = 0;
- Resource.WriteBytes(bytes.Slice(offset + sizeof(ushort)), ref resourceSize);
-
- // Write the size of the resource in the two bytes preceeding (current offset)
- DnsByteExtensions.ToBytes((ushort)resourceSize, bytes, ref offset);
-
- // Advance the offset with the size of the resource
- offset += resourceSize;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsResponseCode.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsResponseCode.cs
deleted file mode 100644
index 87798e6..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsResponseCode.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// DNS response codes. See https://www.iana.org/assignments/dns-parameters/dns-parameters.xml#dns-parameters-6
- ///
- public enum DnsResponseCode : byte
- {
- ///
- /// No Error
- ///
- NoError = 0,
- ///
- /// Format Error
- ///
- FormErr = 1,
- ///
- /// Server Failure
- ///
- ServFail = 2,
- ///
- /// Non-Existent Domain
- ///
- NXDomain = 3,
- ///
- /// Not Implemented
- ///
- NotImp = 4,
- ///
- /// Query Refused
- ///
- Refused = 5,
- ///
- /// Name Exists when it should not
- ///
- YXDomain = 6,
- ///
- /// RR Set Exists when it should not
- ///
- YXRRSet = 7,
- ///
- /// RR Set that should exist does not
- ///
- NXRRSet = 8,
- ///
- /// Server Not Authoritative for zone or Not Authorized
- ///
- NotAuth = 9,
- ///
- /// Name not contained in zone
- ///
- NotZone = 10,
- ///
- /// DSO-TYPE Not Implemented
- ///
- DSOTYPENI = 11,
- ///
- /// BADVERS or TSIG Signature Failure
- ///
- BADVERS = 16,
- ///
- /// Key not recognized
- ///
- BADKEY = 17,
- ///
- /// Signature out of time window
- ///
- BADTIME = 18,
- ///
- /// Bad TKEY Mode
- ///
- BADMODE = 19,
- ///
- /// Duplicate key name
- ///
- BADNAME = 20,
- ///
- /// Algorithm not supported
- ///
- BADALG = 21,
- ///
- /// Bad Truncation
- ///
- BADTRUNC = 22,
- ///
- /// Bad/missing Server Cookie
- ///
- BADCOOKIE = 23
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsSoaResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsSoaResource.cs
deleted file mode 100644
index 882df69..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsSoaResource.cs
+++ /dev/null
@@ -1,101 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// A Start of Authority record (abbreviated as SOA record) is a type of
- /// resource record in the Domain Name System (DNS) containing administrative
- /// information about the zone, especially regarding zone transfers.
- /// The SOA record format is specified in RFC 1035.
- ///
- public sealed class DnsSoaResource : IDnsResource, IEquatable
- {
- ///
- /// Primary master name server for this zone
- ///
- public string MName { get; set; }
- ///
- /// Email address of the administrator responsible for this zone.
- /// (As usual, the email address is encoded as a name. The part of the
- /// email address before the @ becomes the first label of the name; the
- /// domain name after the @ becomes the rest of the name. In zone-file
- /// format, dots in labels are escaped with backslashes; thus the email
- /// address john.doe@example.com would be represented in a zone file
- /// as john\.doe.example.com.)
- ///
- public string RName { get; set; }
- ///
- /// Serial number for this zone. If a secondary name server slaved to
- /// this one observes an increase in this number, the slave will assume
- /// that the zone has been updated and initiate a zone transfer.
- ///
- public uint Serial { get; set; }
- ///
- /// Number of seconds after which secondary name servers should query
- /// the master for the SOA record, to detect zone changes. Recommendation
- /// for small and stable zones:[4] 86400 seconds (24 hours).
- ///
- public TimeSpan Refresh { get; set; }
- ///
- /// Number of seconds after which secondary name servers should retry to
- /// request the serial number from the master if the master does not respond.
- /// It must be less than Refresh. Recommendation for small and stable
- /// zones: 7200 seconds (2 hours).
- ///
- public TimeSpan Retry { get; set; }
- ///
- /// Number of seconds after which secondary name servers should stop answering
- /// request for this zone if the master does not respond. This value must be
- /// bigger than the sum of Refresh and Retry. Recommendation for small and
- /// stable zones: 3600000 seconds (1000 hours).
- ///
- public TimeSpan Expire { get; set; }
- ///
- /// Time to live for purposes of negative caching. Recommendation for
- /// small and stable zones: 3600 seconds (1 hour). Originally this
- /// field had the meaning of a minimum TTL value for resource records
- /// in this zone; it was changed to its current meaning by RFC 2308.
- ///
- public TimeSpan Minimum { get; set; }
-
- ///
- public bool Equals(DnsSoaResource other) => MName == other.MName && RName == other.RName && Serial == other.Serial && Refresh == other.Refresh && Retry == other.Retry && Expire == other.Expire && Minimum == other.Minimum;
-
- ///
- public override bool Equals(object obj) => obj is DnsSoaResource record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(MName, RName, Serial, Refresh, Retry, Expire, Minimum);
-
- ///
- public void ReadBytes(ReadOnlyMemory bytes, ref int offset, int length)
- {
- MName = string.Join(".", DnsByteExtensions.ReadString(bytes, ref offset));
- RName = string.Join(".", DnsByteExtensions.ReadString(bytes, ref offset));
- Serial = DnsByteExtensions.ReadUInt32(bytes, ref offset);
- Refresh = TimeSpan.FromSeconds(DnsByteExtensions.ReadInt32(bytes, ref offset));
- Retry = TimeSpan.FromSeconds(DnsByteExtensions.ReadInt32(bytes, ref offset));
- Expire = TimeSpan.FromSeconds(DnsByteExtensions.ReadInt32(bytes, ref offset));
- Minimum = TimeSpan.FromSeconds(DnsByteExtensions.ReadUInt32(bytes, ref offset));
- }
-
- ///
- public override string ToString() => MName;
-
- ///
- public void WriteBytes(Memory bytes, ref int offset)
- {
- DnsByteExtensions.ToBytes(MName.Split('.'), bytes, ref offset);
- DnsByteExtensions.ToBytes(RName.Split('.'), bytes, ref offset);
- DnsByteExtensions.ToBytes(Serial, bytes, ref offset);
- DnsByteExtensions.ToBytes((int)Refresh.TotalSeconds, bytes, ref offset);
- DnsByteExtensions.ToBytes((int)Retry.TotalSeconds, bytes, ref offset);
- DnsByteExtensions.ToBytes((int)Expire.TotalSeconds, bytes, ref offset);
- DnsByteExtensions.ToBytes((uint)Minimum.TotalSeconds, bytes, ref offset);
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsStringResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsStringResource.cs
deleted file mode 100644
index 08cefdc..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsStringResource.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a DNS resource containing a string.
- ///
- public abstract class DnsStringResource : IDnsResource, IEquatable
- {
- ///
- /// The text entry contained within this resource.
- ///
- ///
- /// The text values of this resource as an array of strings.
- ///
- public string[] Entries { get; set; } = Array.Empty();
-
- ///
- public bool Equals(DnsStringResource other) => Entries.SequenceEqual(other.Entries);
-
- ///
- public override bool Equals(object obj) => obj is DnsStringResource record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(Entries);
-
- ///
- /// Describes whether this string resource can use string compression.
- ///
- protected abstract bool CanUseCompression { get; }
-
- ///
- public virtual void ReadBytes(ReadOnlyMemory bytes, ref int offset, int length)
- {
- // Provide the ReadString method with a sliced buffer, which ends when this resource ends
- // It must start where the packet starts, since there are often pointers back to the beginning
- Entries = DnsByteExtensions.ReadString(bytes.Slice(0, offset + length), ref offset, CanUseCompression);
- }
-
- ///
- public virtual void WriteBytes(Memory bytes, ref int offset)
- {
- DnsByteExtensions.ToBytes(Entries, bytes, ref offset);
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsTextResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsTextResource.cs
deleted file mode 100644
index 4b60b2c..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsTextResource.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a DNS text resource containing a string.
- ///
- public sealed class DnsTextResource : DnsStringResource
- {
- ///
- protected override bool CanUseCompression => false;
-
- ///
- public override string ToString() => '"' + string.Join("\", \"", Entries) + '"';
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsUnknownResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsUnknownResource.cs
deleted file mode 100644
index 7407f44..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/DnsUnknownResource.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a DNS resource that this library cannot yet understand.
- ///
- public sealed class DnsUnknownResource : IDnsResource, IEquatable
- {
- ///
- /// The raw bytes recieved for this DNS resource.
- ///
- ///
- /// The raw set of bytes representing the value fo this DNS resource.
- /// For string values, due to compression the whole packet may be needed.
- ///
- public ReadOnlyMemory Raw { get; set; }
-
- ///
- public bool Equals(DnsUnknownResource other) => Raw.Span.SequenceEqual(other.Raw.Span);
-
- ///
- public override bool Equals(object obj) => obj is DnsUnknownResource record ? Equals(record) : base.Equals(obj);
-
- ///
- public override int GetHashCode() => HashCode.Combine(Raw);
-
- ///
- public void ReadBytes(ReadOnlyMemory bytes, ref int offset, int length)
- {
- Raw = DnsByteExtensions.ReadBytes(bytes, length, ref offset);
- }
-
- ///
- public override string ToString() => $"Raw {Raw.Length} bytes";
-
- ///
- public void WriteBytes(Memory bytes, ref int offset)
- {
- Raw.CopyTo(bytes.Slice(offset));
- offset += Raw.Length;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsByteArrayReader.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsByteArrayReader.cs
deleted file mode 100644
index e53f013..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsByteArrayReader.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a class which can read from the specified byte array.
- ///
- public interface IDnsByteArrayReader
- {
- ///
- /// Read from the specified byte array, starting at the specified offset.
- ///
- /// The byte array to read from.
- /// The offset to start at.
- void ReadBytes(ReadOnlyMemory bytes, ref int offset);
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsByteArrayWriter.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsByteArrayWriter.cs
deleted file mode 100644
index 7d3c23f..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsByteArrayWriter.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a class which can write its contents to an enumerable of bytes.
- ///
- public interface IDnsByteArrayWriter
- {
- ///
- /// Write to the the specified byte array.
- ///
- /// The byte array to read from.
- /// The offset to start at.
- void WriteBytes(Memory bytes, ref int offset);
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsResource.cs b/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsResource.cs
deleted file mode 100644
index cbf11e7..0000000
--- a/MsmhTools/MsmhTools/DnsTool/DnsWireformatTools/IDnsResource.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool.DnsWireformatTools
-{
- ///
- /// Represents a type of DNS resource.
- ///
- public interface IDnsResource : IDnsByteArrayWriter
- {
- ///
- /// Read from the specified byte array, starting at the specified offset.
- ///
- /// The byte array to read from.
- /// The offset to start at.
- /// The maximum number of bytes to read.
- void ReadBytes(ReadOnlyMemory bytes, ref int offset, int length);
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/GetCompanyName.cs b/MsmhTools/MsmhTools/DnsTool/GetCompanyName.cs
deleted file mode 100644
index a04c910..0000000
--- a/MsmhTools/MsmhTools/DnsTool/GetCompanyName.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.DnsTool
-{
- public static class GetCompanyName
- {
- public static string HostToCompanyOffline(string host, string fileContent)
- {
- host = host.Trim();
- string company = "Couldn't retrieve information.";
- if (!string.IsNullOrWhiteSpace(host))
- {
- if (!string.IsNullOrWhiteSpace(fileContent))
- {
- List split = fileContent.SplitToLines();
- for (int n = 0; n < split.Count; n++)
- {
- string hostToCom = split[n];
- if (hostToCom.Contains(host))
- {
- string com = hostToCom.Split('|')[1];
- if (!string.IsNullOrWhiteSpace(com))
- {
- company = com;
- break;
- }
- }
- }
- }
- }
- return company.Trim();
- }
-
- public static string UrlToCompanyOffline(string url, string fileContent)
- {
- Network.GetUrlDetails(url, 53, out string host, out int _, out string _, out bool _);
- return HostToCompanyOffline(host, fileContent);
- }
-
- public static string StampToCompanyOffline(string stampUrl, string fileContent)
- {
- stampUrl = stampUrl.Trim();
- string company = "Couldn't retrieve information.";
- // Can't always return Address
- try
- {
- // Decode Stamp
- DNSCryptStampReader stamp = new(stampUrl);
-
- if (!string.IsNullOrEmpty(stamp.Host))
- company = HostToCompanyOffline(stamp.Host, fileContent);
- else if (!string.IsNullOrEmpty(stamp.IP))
- company = HostToCompanyOffline(stamp.IP, fileContent);
- else
- company = HostToCompanyOffline(stampUrl, fileContent);
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
-
- return company;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/DnsTool/GetIP.cs b/MsmhTools/MsmhTools/DnsTool/GetIP.cs
deleted file mode 100644
index 119cd94..0000000
--- a/MsmhTools/MsmhTools/DnsTool/GetIP.cs
+++ /dev/null
@@ -1,602 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Net;
-using System.Net.Http.Headers;
-using System.Net.Sockets;
-using System.Text;
-using System.Text.Json;
-using System.Threading.Tasks;
-using MsmhTools.DnsTool.DnsWireformatTools;
-
-namespace MsmhTools.DnsTool
-{
- public static class GetIP
- {
- //================================================= Get From System
-
- ///
- /// Get First IP in Answer Section
- ///
- /// Host
- /// Look for IPv6
- /// Returns string.Empty if fail
- public static string GetIpFromSystem(string host, bool getIPv6 = false)
- {
- string result = string.Empty;
-
- try
- {
- //IPAddress[] ipAddresses = Dns.GetHostEntry(host).AddressList;
- IPAddress[] ipAddresses = Dns.GetHostAddresses(host);
-
- if (ipAddresses == null || ipAddresses.Length == 0)
- return string.Empty;
-
- if (!getIPv6)
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetwork)
- {
- result = ipAddresses[n].ToString();
- break;
- }
- }
- }
- else
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetworkV6)
- {
- result = ipAddresses[n].ToString();
- break;
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- return result;
- }
-
- //================================================= Get From DoH: Try Wire Format First, Then Try Json Format
-
- ///
- /// Get First IP in Answer Section (Use Wire Then try Json)
- ///
- /// Host
- /// DoH Server
- /// Timeout (Sec)
- /// Use Proxy to Get IP
- /// Returns string.Empty if fail
- public static async Task GetIpFromDoH(string host, string doh, int timeoutSec, string? proxyScheme = null)
- {
- string ip = await GetIpFromDoHUsingWireFormat(host, doh, timeoutSec, proxyScheme);
- if (string.IsNullOrEmpty(ip))
- ip = await GetIpFromDohUsingJsonFormat(host, doh, timeoutSec, proxyScheme);
- return ip;
- }
-
- //================================================= Get From DoH Using Wire Format
-
- ///
- /// Get First IP in Answer Section (Using Wire Format)
- ///
- /// Host
- /// DoH Server
- /// Timeout (Sec)
- /// Use Proxy to Get IP
- /// Returns string.Empty if fail
- public static async Task GetIpFromDoHUsingWireFormat(string host, string doh, int timeoutSec, string? proxyScheme = null)
- {
- List ips = await GetIpsFromDoHUsingWireFormat(host, doh, timeoutSec, proxyScheme);
- if (ips.Any()) return ips[0];
- return string.Empty;
- }
-
- ///
- /// Get A List of IPs (Using Wire Format)
- ///
- /// Host
- /// DoH Server
- /// Timeout (Sec)
- /// Use Proxy to Get IPs
- /// Returns an Empty List if fail
- public static async Task> GetIpsFromDoHUsingWireFormat(string host, string doh, int timeoutSec, string? proxyScheme = null)
- {
- if (string.IsNullOrEmpty(proxyScheme))
- return await GetIpsFromDohUsingWireFormatNoProxy(host, doh, timeoutSec);
- else
- return await GetIpsFromDohUsingWireFormatProxy(host, doh, timeoutSec, proxyScheme);
- }
-
- private static async Task> GetIpsFromDohUsingWireFormatNoProxy(string host, string doh, int timeoutSec)
- {
- List ips = new();
-
- try
- {
- DnsMessage dnsMessage = DnsQueryFactory.CreateQuery(host);
- var queryBuffer = DnsByteExtensions.AllocatePinnedNetworkBuffer();
- int queryBufferLength = 0;
- dnsMessage.WriteBytes(queryBuffer, ref queryBufferLength);
-
- Uri uri = new(doh);
-
- using HttpClient httpClient = new();
- httpClient.Timeout = new TimeSpan(0, 0, timeoutSec);
-
- HttpContent content = new ReadOnlyMemoryContent(queryBuffer.Slice(0, queryBufferLength));
- content.Headers.ContentType = new MediaTypeHeaderValue("application/dns-message");
-
- HttpRequestMessage message = new(HttpMethod.Post, "/dns-query");
- message.RequestUri = uri;
- message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/dns-message"));
- message.Content = content;
-
- using HttpResponseMessage r = await httpClient.SendAsync(message);
-
- if (r.IsSuccessStatusCode)
- {
- byte[] buffer = await r.Content.ReadAsByteArrayAsync();
-
- DnsMessage answer = DnsByteExtensions.FromBytes(buffer);
- object? obj = new();
- object? toString = obj.ToString();
- if (toString != null)
- answer.Header.Tags.Add("Resolver", toString);
-
- for (int n = 0; n < answer.Answers.Count; n++)
- {
- DnsResourceRecord drr = answer.Answers[n];
- string? ip = drr.Resource.ToString();
- if (!string.IsNullOrEmpty(ip) && IPAddress.TryParse(ip, out IPAddress _))
- ips.Add(ip);
- }
- }
- }
- catch (Exception)
- {
- // do nothing
- }
-
- return ips;
- }
-
- private static async Task> GetIpsFromDohUsingWireFormatProxy(string host, string doh, int timeoutSec, string? proxyScheme = null)
- {
- List ips = new();
-
- try
- {
- DnsMessage dnsMessage = DnsQueryFactory.CreateQuery(host);
- var queryBuffer = DnsByteExtensions.AllocatePinnedNetworkBuffer();
- int queryBufferLength = 0;
- dnsMessage.WriteBytes(queryBuffer, ref queryBufferLength);
-
- Uri uri = new(doh);
-
- using SocketsHttpHandler socketsHttpHandler = new();
- socketsHttpHandler.Proxy = new WebProxy(proxyScheme, true);
-
- using HttpClient httpClient = new(socketsHttpHandler);
- httpClient.Timeout = new TimeSpan(0, 0, timeoutSec);
-
- HttpContent content = new ReadOnlyMemoryContent(queryBuffer.Slice(0, queryBufferLength));
- content.Headers.ContentType = new MediaTypeHeaderValue("application/dns-message");
-
- HttpRequestMessage message = new(HttpMethod.Post, "/dns-query");
- message.RequestUri = uri;
- message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/dns-message"));
- message.Content = content;
-
- using HttpResponseMessage r = await httpClient.SendAsync(message);
-
- if (r.IsSuccessStatusCode)
- {
- byte[] buffer = await r.Content.ReadAsByteArrayAsync();
-
- DnsMessage answer = DnsByteExtensions.FromBytes(buffer);
- object? obj = new();
- object? toString = obj.ToString();
- if (toString != null)
- answer.Header.Tags.Add("Resolver", toString);
-
- for (int n = 0; n < answer.Answers.Count; n++)
- {
- DnsResourceRecord drr = answer.Answers[n];
- string? ip = drr.Resource.ToString();
- if (!string.IsNullOrEmpty(ip) && IPAddress.TryParse(ip, out IPAddress _))
- ips.Add(ip);
- }
- }
- }
- catch (Exception)
- {
- // do nothing
- }
-
- return ips;
- }
-
- //================================================= Get From DoH Using JSON Format
-
- ///
- /// Convert Host to IPv4 Using JSON Format
- ///
- /// Host
- /// A List of DoH Addresses
- /// Timeout (Sec)
- /// Use Proxy to Get IP
- /// Returns string.Empty if fail
- public static async Task GetIpFromDohUsingJsonFormat(string host, List dohs, int timeoutSec, string? proxyScheme = null)
- {
- for (int n = 0; n < dohs.Count; n++)
- {
- string doh = dohs[n];
- string ip = await GetIpFromDohUsingJsonFormat(host, doh, timeoutSec, proxyScheme);
- if (!string.IsNullOrEmpty(ip)) return ip;
- }
- return string.Empty;
- }
-
- ///
- /// Convert Host to IPv4 Using JSON Format
- ///
- /// Host
- /// DoH Address
- /// Timeout (Sec)
- /// Use Proxy to Get IP
- /// Returns string.Empty if fail
- public static async Task GetIpFromDohUsingJsonFormat(string host, string doh, int timeoutSec, string? proxyScheme = null)
- {
- string apiPath1 = "/dns-query";
- string apiPath2 = "/resolve";
-
- doh = doh.Trim();
- if (doh.EndsWith(apiPath1))
- doh = doh.Replace(apiPath1, string.Empty);
- else if (doh.EndsWith(apiPath2))
- doh = doh.Replace(apiPath2, string.Empty);
-
- string jsonString = await GetIpFromDohUsingJsonFormatInternal(host, doh, timeoutSec, apiPath1, proxyScheme);
- if (string.IsNullOrEmpty(jsonString))
- {
- jsonString = await GetIpFromDohUsingJsonFormatInternal(host, doh, timeoutSec, apiPath2, proxyScheme);
- }
-
- return GetIpFromJson(jsonString);
- }
-
- private static async Task GetIpFromDohUsingJsonFormatInternal(string host, string dohWithoutPath, int timeoutSec, string apiPath, string? proxyScheme = null)
- {
- if (string.IsNullOrEmpty(proxyScheme))
- return await GetIpFromDohUsingJsonFormatInternalNoProxy(host, dohWithoutPath, timeoutSec, apiPath);
- else
- return await GetIpFromDohUsingJsonFormatInternalProxy(host, dohWithoutPath, timeoutSec, apiPath, proxyScheme);
- }
-
- private static async Task GetIpFromDohUsingJsonFormatInternalNoProxy(string host, string dohWithoutPath, int timeoutSec, string apiPath)
- {
- try
- {
- host = Uri.EscapeDataString(host);
- string path = $"{apiPath}?name={host}&type=A";
- Uri uri = new(dohWithoutPath + path);
-
- HttpClient httpClient = new();
- httpClient.Timeout = new TimeSpan(0, 0, timeoutSec);
-
- HttpRequestMessage message = new();
- message.Method = HttpMethod.Get;
- message.RequestUri = uri;
- message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/dns-json"));
-
- using HttpResponseMessage r = await httpClient.SendAsync(message);
-
- if (r.IsSuccessStatusCode)
- {
- string contents = await r.Content.ReadAsStringAsync();
- httpClient.Dispose();
- return contents;
- }
- httpClient.Dispose();
- return string.Empty;
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- return string.Empty;
- }
- }
-
- private static async Task GetIpFromDohUsingJsonFormatInternalProxy(string host, string dohWithoutPath, int timeoutSec, string apiPath, string? proxyScheme = null)
- {
- try
- {
- host = Uri.EscapeDataString(host);
- string path = $"{apiPath}?name={host}&type=A";
- Uri uri = new(dohWithoutPath + path);
-
- using SocketsHttpHandler socketsHttpHandler = new();
- socketsHttpHandler.Proxy = new WebProxy(proxyScheme, true);
-
- using HttpClient httpClient = new(socketsHttpHandler);
- httpClient.Timeout = new TimeSpan(0, 0, timeoutSec);
-
- HttpRequestMessage message = new();
- message.Method = HttpMethod.Get;
- message.RequestUri = uri;
- message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/dns-json"));
-
- using HttpResponseMessage r = await httpClient.SendAsync(message);
-
- if (r.IsSuccessStatusCode)
- {
- string contents = await r.Content.ReadAsStringAsync();
- httpClient.Dispose();
- return contents;
- }
- httpClient.Dispose();
- return string.Empty;
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- return string.Empty;
- }
- }
-
- private static string GetIpFromJson(string jsonContent)
- {
- string ip = string.Empty;
- try
- {
- using JsonDocument jd = JsonDocument.Parse(jsonContent);
- JsonElement rootElement = jd.RootElement;
- if (rootElement.ValueKind == JsonValueKind.Object)
- {
- JsonProperty[] properties = rootElement.EnumerateObject().ToArray();
- for (int n = 0; n < properties.Length; n++)
- {
- JsonProperty property = properties[n];
- if (property.Name == "Answer")
- {
- JsonElement[] elementsProperties = property.Value.EnumerateArray().ToArray();
- for (int n2 = 0; n2 < elementsProperties.Length; n2++)
- {
- JsonElement elementProperty = elementsProperties[n2];
- if (elementProperty.ValueKind == JsonValueKind.Object)
- {
- JsonProperty[] answerProperties = elementProperty.EnumerateObject().ToArray();
- for (int n3 = 0; n3 < answerProperties.Length; n3++)
- {
- JsonProperty answerProperty = answerProperties[n3];
- if (answerProperty.Name == "data")
- {
- ip = answerProperty.Value.ToString();
- if (IPAddress.TryParse(ip, out IPAddress _))
- return ip;
- }
- }
- }
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- return ip;
- }
-
- //================================================= Get From Plain DNS
-
- private struct Question
- {
- public string qName;
- public int qType;
- public int qClass;
- }
-
- private struct Answer
- {
- //public List aName;
- public int aType;
- public int aClass;
- public int aTtl;
- public int rdLength;
- public byte[] rData;
- }
-
- ///
- /// Get First IP in Answer Section
- ///
- /// Host
- /// Plain DNS IP
- /// Plain DNS Port
- /// Timeout (ms)
- /// Returns string.Empty if fail
- public static string GetIpFromPlainDNS(string host, string dnsIP, int dnsPort, int timeoutMS)
- {
- List ips = GetIpsFromPlainDNS(host, dnsIP, dnsPort, timeoutMS);
- if (ips.Any()) return ips[0];
- return string.Empty;
- }
-
- ///
- /// Get a List of IPs
- ///
- /// Host
- /// Plain DNS IP
- /// Plain DNS Port
- /// Timeout (ms)
- /// Returns an Empty List if fail
- public static List GetIpsFromPlainDNS(string host, string dnsIP, int dnsPort, int timeoutMS)
- {
- List ips = new();
- try
- {
- var task = Task.Run(() =>
- {
- Socket sock = new(SocketType.Dgram, ProtocolType.Udp);
-
- IPEndPoint ep = new(IPAddress.Parse(dnsIP), dnsPort);
- sock.Connect(ep);
-
- byte[] hostnameLength = new byte[1];
- byte[] hostdomainLength = new byte[1];
-
- byte[] tranactionID1 = { 0x46, 0x62 };
- byte[] queryType1 = { 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
- byte[] hostname = Encoding.Default.GetBytes(host.Split('.')[0]);
- hostnameLength[0] = (byte)hostname.Length;
- byte[] hostdomain = Encoding.Default.GetBytes(host.Split('.')[1]);
- hostdomainLength[0] = (byte)hostdomain.Length;
- byte[] queryEnd = { 0x00, 0x00, 0x01, 0x00, 0x01 };
- byte[] dnsQueryString = tranactionID1.Concat(queryType1).Concat(hostnameLength).Concat(hostname).Concat(hostdomainLength).Concat(hostdomain).Concat(queryEnd).ToArray();
-
- sock.Send(dnsQueryString);
-
- byte[] rBuffer = new byte[1000];
-
- int receivedLength = sock.Receive(rBuffer);
-
- //ushort transId = (ushort)BitConverter.ToInt16(new[] { rBuffer[1], rBuffer[0] }, 0);
- ushort queCount = (ushort)BitConverter.ToInt16(new[] { rBuffer[5], rBuffer[4] }, 0);
- ushort ansCount = (ushort)BitConverter.ToInt16(new[] { rBuffer[7], rBuffer[6] }, 0);
- //ushort authCount = (ushort)BitConverter.ToInt16(new[] { rBuffer[9], rBuffer[8] }, 0);
- //ushort addCount = (ushort)BitConverter.ToInt16(new[] { rBuffer[11], rBuffer[10] }, 0);
-
- // Header read, now on to handling questions
- int byteCount = 12;
-
- Question[] questions = new Question[queCount];
-
- for (int i = 0; i < queCount; i++)
- {
- // Read Name
- while (true)
- {
- int stringLength = rBuffer[byteCount];
- byteCount++;
-
- if (stringLength == 0)
- {
- if (questions[i].qName[^1] == '.')
- {
- questions[i].qName = new string(questions[i].qName.Take(questions[i].qName.Length - 1).ToArray());
- }
-
- break;
- }
-
- byte[] tempName = new byte[stringLength];
-
- for (int k = 0; k < stringLength; k++)
- {
- tempName[k] = rBuffer[byteCount];
- byteCount++;
- }
-
- questions[i].qName += Encoding.ASCII.GetString(tempName) + '.';
- }
-
- // Name read now read Type
- questions[i].qType = rBuffer[byteCount] + rBuffer[byteCount + 1];
- byteCount += 2;
-
- questions[i].qClass = rBuffer[byteCount] + rBuffer[byteCount + 1];
- byteCount += 2;
- }
-
- Answer[] answers = new Answer[ansCount];
-
- for (int i = 0; i < ansCount; i++)
- {
- // Skip reading Name, since it points to the Name given in question
- byteCount += 2;
-
- answers[i].aType = rBuffer[byteCount] + rBuffer[byteCount + 1];
- byteCount += 2;
-
- answers[i].aClass = rBuffer[byteCount] + rBuffer[byteCount + 1];
- byteCount += 2;
-
- answers[i].aTtl = BitConverter.ToInt32(rBuffer.Skip(byteCount).Take(4).Reverse().ToArray());
- byteCount += 4;
-
- answers[i].rdLength = BitConverter.ToInt16(rBuffer.Skip(byteCount).Take(2).Reverse().ToArray());
- byteCount += 2;
-
- answers[i].rData = rBuffer.Skip(byteCount).Take(answers[i].rdLength).ToArray();
- byteCount += answers[i].rdLength;
- }
-
- foreach (var a in answers)
- {
- // the canonical name for an alias
- if (a.aType == 5)
- {
- string namePortion = "";
- for (int bytePosition = 0; bytePosition < a.rData.Length;)
- {
- int length = a.rData[bytePosition];
- bytePosition++;
-
- if (length == 0) continue;
-
- namePortion += Encoding.ASCII.GetString(a.rData.Skip(bytePosition).Take(length).ToArray()) + ".";
-
- bytePosition += length;
- }
-
- Debug.WriteLine(new string(namePortion.Take(namePortion.Length - 1).ToArray()));
- }
-
- // Skip any answer that's not IP adress since it's irrelevant for this excercise
- if (a.aType == 1)
- {
- // First byte tells the lenghth of data (Usually length of 4 since type 1 describes IP4 adresses)
- string ipString = "";
-
- foreach (var b in a.rData.ToArray())
- {
- int number = b;
-
- ipString += number + ".";
- }
-
- string ip = new(ipString.Take(ipString.Length - 1).ToArray());
- ips.Add(ip);
- }
- }
-
- sock.Close();
- });
-
- if (task.Wait(TimeSpan.FromMilliseconds(timeoutMS)))
- return ips;
-
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- return ips;
- }
-
-
-
-
- }
-}
diff --git a/MsmhTools/MsmhTools/Drawing.cs b/MsmhTools/MsmhTools/Drawing.cs
deleted file mode 100644
index aac56b4..0000000
--- a/MsmhTools/MsmhTools/Drawing.cs
+++ /dev/null
@@ -1,109 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-
-namespace MsmhTools
-{
- public static class Drawing
- {
- //-----------------------------------------------------------------------------------
- public static GraphicsPath RoundedRectangle(Rectangle bounds, int radiusTopLeft, int radiusTopRight, int radiusBottomRight, int radiusBottomLeft)
- {
- int diameterTopLeft = radiusTopLeft * 2;
- int diameterTopRight = radiusTopRight * 2;
- int diameterBottomRight = radiusBottomRight * 2;
- int diameterBottomLeft = radiusBottomLeft * 2;
-
- Rectangle arc1 = new(bounds.Location, new Size(diameterTopLeft, diameterTopLeft));
- Rectangle arc2 = new(bounds.Location, new Size(diameterTopRight, diameterTopRight));
- Rectangle arc3 = new(bounds.Location, new Size(diameterBottomRight, diameterBottomRight));
- Rectangle arc4 = new(bounds.Location, new Size(diameterBottomLeft, diameterBottomLeft));
- GraphicsPath path = new();
-
- // Top Left Arc
- if (radiusTopLeft == 0)
- {
- path.AddLine(arc1.Location, arc1.Location);
- }
- else
- {
- path.AddArc(arc1, 180, 90);
- }
- // Top Right Arc
- arc2.X = bounds.Right - diameterTopRight;
- if (radiusTopRight == 0)
- {
- path.AddLine(arc2.Location, arc2.Location);
- }
- else
- {
- path.AddArc(arc2, 270, 90);
- }
- // Bottom Right Arc
- arc3.X = bounds.Right - diameterBottomRight;
- arc3.Y = bounds.Bottom - diameterBottomRight;
- if (radiusBottomRight == 0)
- {
- path.AddLine(arc3.Location, arc3.Location);
- }
- else
- {
- path.AddArc(arc3, 0, 90);
- }
- // Bottom Left Arc
- arc4.X = bounds.Right - diameterBottomLeft;
- arc4.Y = bounds.Bottom - diameterBottomLeft;
- arc4.X = bounds.Left;
- if (radiusBottomLeft == 0)
- {
- path.AddLine(arc4.Location, arc4.Location);
- }
- else
- {
- path.AddArc(arc4, 90, 90);
- }
- path.CloseFigure();
- return path;
- }
- //-----------------------------------------------------------------------------------
- public static Bitmap Invert(Bitmap source)
- {
- //create a blank bitmap the same size as original
- Bitmap newBitmap = new(source.Width, source.Height);
- //get a graphics object from the new image
- Graphics g = Graphics.FromImage(newBitmap);
- // create the negative color matrix
- ColorMatrix colorMatrix = new(new float[][]
- {
- new float[] {-1, 0, 0, 0, 0},
- new float[] {0, -1, 0, 0, 0},
- new float[] {0, 0, -1, 0, 0},
- new float[] {0, 0, 0, 1, 0},
- new float[] {1, 1, 1, 0, 1}
- });
- // create some image attributes
- ImageAttributes attributes = new();
- attributes.SetColorMatrix(colorMatrix);
- g.DrawImage(source, new Rectangle(0, 0, source.Width, source.Height),
- 0, 0, source.Width, source.Height, GraphicsUnit.Pixel, attributes);
- //dispose the Graphics object
- g.Dispose();
- return newBitmap;
- }
- //-----------------------------------------------------------------------------------
- [DllImport("user32.dll")]
- private static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);
- private const int WM_SETREDRAW = 11;
- public static void SuspendDrawing(Control parent)
- {
- _ = SendMessage(parent.Handle, WM_SETREDRAW, false, 0);
- }
- public static void ResumeDrawing(Control parent)
- {
- _ = SendMessage(parent.Handle, WM_SETREDRAW, true, 0);
- parent.Refresh();
- }
- //-----------------------------------------------------------------------------------
- }
-}
diff --git a/MsmhTools/MsmhTools/EncodingTool.cs b/MsmhTools/MsmhTools/EncodingTool.cs
deleted file mode 100644
index 4b7d948..0000000
--- a/MsmhTools/MsmhTools/EncodingTool.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-using Force.Crc32;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Cryptography;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- public class EncodingTool
- {
- public static string GetCRC32(string text)
- {
- var bytes = Encoding.UTF8.GetBytes(text);
- uint crc32 = Crc32Algorithm.Compute(bytes);
- return crc32.ToString();
- }
-
- public static string GetSHA1(string text)
- {
- byte[] bytes = Encoding.UTF8.GetBytes(text);
- using SHA1 hash = SHA1.Create();
- byte[] hashedInputBytes = hash.ComputeHash(bytes);
- return Convert.ToHexString(hashedInputBytes);
- }
-
- public static string GetSHA256(string text)
- {
- byte[] bytes = Encoding.UTF8.GetBytes(text);
- using SHA256 hash = SHA256.Create();
- byte[] hashedInputBytes = hash.ComputeHash(bytes);
- return Convert.ToHexString(hashedInputBytes);
- }
-
- public static string GetSHA384(string text)
- {
- byte[] bytes = Encoding.UTF8.GetBytes(text);
- using SHA384 hash = SHA384.Create();
- byte[] hashedInputBytes = hash.ComputeHash(bytes);
- return Convert.ToHexString(hashedInputBytes);
- }
-
- public static string GetSHA512(string text)
- {
- byte[] bytes = Encoding.UTF8.GetBytes(text);
- using SHA512 hash = SHA512.Create();
- byte[] hashedInputBytes = hash.ComputeHash(bytes);
- return Convert.ToHexString(hashedInputBytes);
- }
-
- public static string Base64Encode(string plainText)
- {
- byte[] data = Encoding.UTF8.GetBytes(plainText);
- string encodedString = Convert.ToBase64String(data);
- return encodedString;
- }
-
- public static string Base64Decode(string encodedString)
- {
- byte[] data = Convert.FromBase64String(encodedString);
- string decodedString = Encoding.UTF8.GetString(data);
- return decodedString;
- }
-
- public static string UrlEncode(byte[] arg)
- {
- if (arg == null) throw new ArgumentNullException(nameof(arg));
-
- var s = Convert.ToBase64String(arg);
- return s.Replace("=", "").Replace("/", "_").Replace("+", "-");
- }
-
- public static string UrlToBase64(string arg)
- {
- if (arg == null) throw new ArgumentNullException(nameof(arg));
-
- var s = arg.PadRight(arg.Length + (4 - arg.Length % 4) % 4, '=').Replace("_", "/").Replace("-", "+");
- return s;
- }
-
- public static byte[] UrlDecode(string arg)
- {
- var decrypted = UrlToBase64(arg);
- return Convert.FromBase64String(decrypted);
- }
-
- public static T[] SubArray(T[] arr, int start, int length)
- {
- var result = new T[length];
- Buffer.BlockCopy(arr, start, result, 0, length);
-
- return result;
- }
-
- public static T[] SubArray(T[] arr, int start)
- {
- return SubArray(arr, start, arr.Length - start);
- }
- }
-
-}
diff --git a/MsmhTools/MsmhTools/Extensions.cs b/MsmhTools/MsmhTools/Extensions.cs
deleted file mode 100644
index 89dd8ea..0000000
--- a/MsmhTools/MsmhTools/Extensions.cs
+++ /dev/null
@@ -1,674 +0,0 @@
-using System;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-using System.Text.RegularExpressions;
-using System.Runtime.InteropServices;
-using System.ComponentModel;
-using System.Drawing.Drawing2D;
-using System.Data;
-using System.Xml.Serialization;
-using CustomControls;
-using System.Diagnostics.CodeAnalysis;
-using System.Runtime.CompilerServices;
-using System.Xml.Linq;
-using System.Diagnostics;
-
-namespace MsmhTools
-{
- public static class Methods
- {
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- internal extern static int SetWindowTheme(IntPtr controlHandle, string appName, string? idList);
- }
- public static class Extensions
- {
- //-----------------------------------------------------------------------------------
- public static TimeSpan Round(this TimeSpan timeSpan, int precision)
- {
- return TimeSpan.FromSeconds(Math.Round(timeSpan.TotalSeconds, precision));
- }
- //-----------------------------------------------------------------------------------
- public static void AppendText(this RichTextBox richTextBox, string text, Color color)
- {
- richTextBox.SelectionStart = richTextBox.TextLength;
- richTextBox.SelectionLength = 0;
- richTextBox.SelectionColor = color;
- richTextBox.AppendText(text);
- richTextBox.SelectionColor = richTextBox.ForeColor;
- }
- //-----------------------------------------------------------------------------------
- public static List> SplitToLists(this List list, int nSize)
- {
- var listOut = new List>();
-
- for (int n = 0; n < list.Count; n += nSize)
- {
- listOut.Add(list.GetRange(n, Math.Min(nSize, list.Count - n)));
- }
-
- return listOut;
- }
- //-----------------------------------------------------------------------------------
- public static List SplitToLines(this string s)
- {
- // Original non-optimized version: return source.Replace("\r\r\n", "\n").Replace("\r\n", "\n").Replace('\r', '\n').Replace('\u2028', '\n').Split('\n');
- var lines = new List();
- int start = 0;
- int max = s.Length;
- int i = 0;
- while (i < max)
- {
- var ch = s[i];
- if (ch == '\r')
- {
- if (i < s.Length - 2 && s[i + 1] == '\r' && s[i + 2] == '\n') // \r\r\n
- {
- lines.Add(start < i ? s[start..i] : string.Empty); // s[start..i] = s.Substring(start, i - start)
- i += 3;
- start = i;
- continue;
- }
-
- if (i < s.Length - 1 && s[i + 1] == '\n') // \r\n
- {
- lines.Add(start < i ? s[start..i] : string.Empty);
- i += 2;
- start = i;
- continue;
- }
-
- lines.Add(start < i ? s[start..i] : string.Empty);
- i++;
- start = i;
- continue;
- }
-
- if (ch == '\n' || ch == '\u2028')
- {
- lines.Add(start < i ? s[start..i] : string.Empty);
- i++;
- start = i;
- continue;
- }
-
- i++;
- }
-
- lines.Add(start < i ? s[start..i] : string.Empty);
- return lines;
- }
-
- public static List SplitToLines(this string s, int maxCount)
- {
- var lines = new List();
- int start = 0;
- int max = Math.Min(maxCount, s.Length);
- int i = 0;
- while (i < max)
- {
- var ch = s[i];
- if (ch == '\r')
- {
- if (i < s.Length - 2 && s[i + 1] == '\r' && s[i + 2] == '\n') // \r\r\n
- {
- lines.Add(start < i ? s[start..i] : string.Empty);
- i += 3;
- start = i;
- continue;
- }
-
- if (i < s.Length - 1 && s[i + 1] == '\n') // \r\n
- {
- lines.Add(start < i ? s[start..i] : string.Empty);
- i += 2;
- start = i;
- continue;
- }
-
- lines.Add(start < i ? s[start..i] : string.Empty);
- i++;
- start = i;
- continue;
- }
-
- if (ch == '\n' || ch == '\u2028')
- {
- lines.Add(start < i ? s[start..i] : string.Empty);
- i++;
- start = i;
- continue;
- }
-
- i++;
- }
-
- lines.Add(start < i ? s[start..i] : string.Empty);
- return lines;
- }
- //-----------------------------------------------------------------------------------
- public static string ToBase64String(this string text)
- {
- return Convert.ToBase64String(Encoding.UTF8.GetBytes(text));
- }
- //-----------------------------------------------------------------------------------
- public static string FromBase64String(this string base64String)
- {
- return Encoding.UTF8.GetString(Convert.FromBase64String(base64String));
- }
- //-----------------------------------------------------------------------------------
- public static string RemoveWhiteSpaces(this string text)
- {
- string findWhat = @"\s+";
- return Regex.Replace(text, findWhat, "");
- }
- //-----------------------------------------------------------------------------------
- public static void SetDarkTitleBar(this Control form, bool darkMode)
- {
- UseImmersiveDarkMode(form.Handle, darkMode);
- }
- private const int DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19;
- private const int DWMWA_USE_IMMERSIVE_DARK_MODE = 20;
- private static bool UseImmersiveDarkMode(IntPtr handle, bool enabled)
- {
- if (IsWindows10OrGreater(17763))
- {
- var attribute = DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1;
- if (IsWindows10OrGreater(18985))
- {
- attribute = DWMWA_USE_IMMERSIVE_DARK_MODE;
- }
-
- int useImmersiveDarkMode = enabled ? 1 : 0;
- return NativeMethods.DwmSetWindowAttribute(handle, attribute, ref useImmersiveDarkMode, sizeof(int)) == 0;
- }
- return false;
- }
- private static bool IsWindows10OrGreater(int build = -1)
- {
- return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= build;
- }
- //-----------------------------------------------------------------------------------
- public static void SetDarkControl(this Control control)
- {
- _ = Methods.SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
- foreach (Control c in Controllers.GetAllControls(control))
- {
- _ = Methods.SetWindowTheme(c.Handle, "DarkMode_Explorer", null);
- }
- }
- //-----------------------------------------------------------------------------------
- public static XmlDocument ToXmlDocument(this XDocument xDocument)
- {
- var xmlDocument = new XmlDocument();
- using var xmlReader = xDocument.CreateReader();
- xmlDocument.Load(xmlReader);
- return xmlDocument;
- }
- //-----------------------------------------------------------------------------------
- public static XDocument ToXDocument(this XmlDocument xmlDocument)
- {
- using var nodeReader = new XmlNodeReader(xmlDocument);
- nodeReader.MoveToContent();
- return XDocument.Load(nodeReader);
- }
- //-----------------------------------------------------------------------------------
- public static string? AssemblyDescription(this Assembly assembly)
- {
- if (assembly != null && Attribute.IsDefined(assembly, typeof(AssemblyDescriptionAttribute)))
- {
- AssemblyDescriptionAttribute? descriptionAttribute = (AssemblyDescriptionAttribute?)Attribute.GetCustomAttribute(assembly, typeof(AssemblyDescriptionAttribute));
- if (descriptionAttribute != null)
- {
- return descriptionAttribute.Description;
- }
- }
- return null;
- }
- //-----------------------------------------------------------------------------------
- public static T IsNotNull([NotNull] this T? value, [CallerArgumentExpression(parameterName: "value")] string? paramName = null)
- {
- if (value == null)
- throw new ArgumentNullException(paramName);
- else
- return value;
- } // Usage: someVariable.IsNotNull();
- //-----------------------------------------------------------------------------------
- public static void EnableDoubleBuffer(this Control.ControlCollection controls)
- {
- foreach (Control control in controls)
- {
- typeof(Control).InvokeMember("DoubleBuffered",
- BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
- null, control, new object[] { true });
- }
- }
- //-----------------------------------------------------------------------------------
- public static GraphicsPath Shrink(this GraphicsPath path, float width)
- {
- using GraphicsPath gp = new();
- gp.AddPath(path, false);
- gp.CloseAllFigures();
- gp.Widen(new Pen(Color.Black, width * 2));
- int position = 0;
- GraphicsPath result = new();
- while (position < gp.PointCount)
- {
- // skip outer edge
- position += CountNextFigure(gp.PathData, position);
- // count inner edge
- int figureCount = CountNextFigure(gp.PathData, position);
- var points = new PointF[figureCount];
- var types = new byte[figureCount];
-
- Array.Copy(gp.PathPoints, position, points, 0, figureCount);
- Array.Copy(gp.PathTypes, position, types, 0, figureCount);
- position += figureCount;
- result.AddPath(new GraphicsPath(points, types), false);
- }
- path.Reset();
- path.AddPath(result, false);
- return path;
- }
-
- private static int CountNextFigure(PathData data, int position)
- {
- int count = 0;
- for (int i = position; i < data?.Types?.Length; i++)
- {
- count++;
- if (0 != (data.Types[i] & (int)PathPointType.CloseSubpath))
- return count;
- }
- return count;
- }
- //-----------------------------------------------------------------------------------
- public static void DrawRoundedRectangle(this Graphics graphics, Pen pen, Rectangle bounds, int radiusTopLeft, int radiusTopRight, int radiusBottomRight, int radiusBottomLeft)
- {
- GraphicsPath path;
- path = Drawing.RoundedRectangle(bounds, radiusTopLeft, radiusTopRight, radiusBottomRight, radiusBottomLeft);
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- graphics.DrawPath(pen, path);
- graphics.SmoothingMode = SmoothingMode.Default;
- }
- //-----------------------------------------------------------------------------------
- public static void FillRoundedRectangle(this Graphics graphics, Brush brush, Rectangle bounds, int radiusTopLeft, int radiusTopRight, int radiusBottomRight, int radiusBottomLeft)
- {
- GraphicsPath path;
- path = Drawing.RoundedRectangle(bounds, radiusTopLeft, radiusTopRight, radiusBottomRight, radiusBottomLeft);
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- graphics.FillPath(brush, path);
- graphics.SmoothingMode = SmoothingMode.Default;
- }
- //-----------------------------------------------------------------------------------
- public static void DrawCircle(this Graphics g, Pen pen, float centerX, float centerY, float radius)
- {
- g.DrawEllipse(pen, centerX - radius, centerY - radius, radius + radius, radius + radius);
- }
- //-----------------------------------------------------------------------------------
- public static void FillCircle(this Graphics g, Brush brush, float centerX, float centerY, float radius)
- {
- g.FillEllipse(brush, centerX - radius, centerY - radius, radius + radius, radius + radius);
- }
- //-----------------------------------------------------------------------------------
- public static string ToXml(this DataSet ds)
- {
- using var memoryStream = new MemoryStream();
- using TextWriter streamWriter = new StreamWriter(memoryStream);
- var xmlSerializer = new XmlSerializer(typeof(DataSet));
- xmlSerializer.Serialize(streamWriter, ds);
- return Encoding.UTF8.GetString(memoryStream.ToArray());
- }
- //-----------------------------------------------------------------------------------
- public static string ToXmlWithWriteMode(this DataSet ds, XmlWriteMode xmlWriteMode)
- {
- using var ms = new MemoryStream();
- using TextWriter sw = new StreamWriter(ms);
- ds.WriteXml(sw, xmlWriteMode);
- return new UTF8Encoding(false).GetString(ms.ToArray());
- }
- //-----------------------------------------------------------------------------------
- public static DataSet ToDataSet(this DataSet ds, string xmlFile, XmlReadMode xmlReadMode)
- {
- ds.ReadXml(xmlFile, xmlReadMode);
- return ds;
- }
- //-----------------------------------------------------------------------------------
- //-----------------------------------------------------------------------------------
- public static void AddVScrollBar(this DataGridView dataGridView, CustomVScrollBar customVScrollBar)
- {
- customVScrollBar.Dock = DockStyle.Right;
- customVScrollBar.Visible = true;
- customVScrollBar.BringToFront();
- dataGridView.Controls.Add(customVScrollBar);
- dataGridView.ScrollBars = ScrollBars.None;
- dataGridView.SelectionChanged += (object? sender, EventArgs e) =>
- {
- // To update ScrollBar position
- customVScrollBar.Value = dataGridView.FirstDisplayedScrollingRowIndex;
- };
- dataGridView.SizeChanged += (object? sender, EventArgs e) =>
- {
- // To update LargeChange on form resize
- customVScrollBar.LargeChange = dataGridView.DisplayedRowCount(false);
- };
- dataGridView.Invalidated += (object? sender, InvalidateEventArgs e) =>
- {
- // To update LargeChange on invalidation
- customVScrollBar.LargeChange = dataGridView.DisplayedRowCount(false);
- };
- dataGridView.RowsAdded += (object? sender, DataGridViewRowsAddedEventArgs e) =>
- {
- customVScrollBar.Maximum = dataGridView.RowCount;
- customVScrollBar.LargeChange = dataGridView.DisplayedRowCount(false);
- customVScrollBar.SmallChange = 1;
- };
- dataGridView.Scroll += (object? sender, ScrollEventArgs e) =>
- {
- if (e.ScrollOrientation == ScrollOrientation.VerticalScroll)
- {
- if (dataGridView.Rows.Count > 0)
- {
- customVScrollBar.Value = e.NewValue;
- // To update LargeChange on scroll
- customVScrollBar.LargeChange = dataGridView.DisplayedRowCount(false);
- }
- }
- };
- customVScrollBar.Scroll += (object? sender, EventArgs e) =>
- {
- if (dataGridView.Rows.Count > 0)
- if (customVScrollBar.Value < dataGridView.Rows.Count)
- dataGridView.FirstDisplayedScrollingRowIndex = customVScrollBar.Value;
- };
- }
- //-----------------------------------------------------------------------------------
- public static Icon? GetApplicationIcon(this Form _)
- {
- return Icon.ExtractAssociatedIcon(Application.ExecutablePath);
- }
- //-----------------------------------------------------------------------------------
- public static Icon? GetDefaultIcon(this Form _)
- {
- return (Icon?)typeof(Form).GetProperty("DefaultIcon", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null, null);
- }
- //-----------------------------------------------------------------------------------
- public static void SetDefaultIcon(this Form _, Icon icon)
- {
- if (icon != null)
- typeof(Form).GetField("defaultIcon", BindingFlags.NonPublic | BindingFlags.Static)?.SetValue(null, icon);
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Invalidate Controls. Use on Form_SizeChanged event.
- ///
- public static void Invalidate(this Control.ControlCollection controls)
- {
- foreach (Control c in controls)
- c.Invalidate();
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Creates color with corrected brightness.
- ///
- /// Color to correct.
- /// The brightness correction factor. Must be between -1 and 1.
- /// Negative values produce darker colors.
- ///
- /// Corrected structure.
- ///
- public static Color ChangeBrightness(this Color color, float correctionFactor)
- {
- float red = (float)color.R;
- float green = (float)color.G;
- float blue = (float)color.B;
-
- if (correctionFactor < 0)
- {
- correctionFactor = 1 + correctionFactor;
- red *= correctionFactor;
- green *= correctionFactor;
- blue *= correctionFactor;
- }
- else
- {
- red = (255 - red) * correctionFactor + red;
- green = (255 - green) * correctionFactor + green;
- blue = (255 - blue) * correctionFactor + blue;
- }
- return Color.FromArgb(color.A, (int)red, (int)green, (int)blue);
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Check Color is Light or Dark.
- ///
- ///
- /// Returns "Dark" or "Light" as string.
- ///
- public static string DarkOrLight(this Color color)
- {
- if (color.R * 0.2126 + color.G * 0.7152 + color.B * 0.0722 < 255 / 2)
- {
- return "Dark";
- }
- else
- {
- return "Light";
- }
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Change Color Hue. (0f - 360f)
- ///
- ///
- /// Returns Modified Color.
- ///
- public static Color ChangeHue(this Color color, float hue)
- {
- //float hueO = color.GetHue();
- float saturationO = color.GetSaturation();
- float lightnessO = color.GetBrightness();
- return Colors.FromHsl(255, hue, saturationO, lightnessO);
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Change Color Saturation. (0f - 1f)
- ///
- ///
- /// Returns Modified Color.
- ///
- public static Color ChangeSaturation(this Color color, float saturation)
- {
- float hueO = color.GetHue();
- //float saturationO = color.GetSaturation();
- float lightnessO = color.GetBrightness();
- return Colors.FromHsl(255, hueO, saturation, lightnessO);
- }
- //-----------------------------------------------------------------------------------
- public static void AutoSizeLastColumn(this ListView listView)
- {
- if (listView.Columns.Count > 1)
- {
- //ListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
- //ListView1.Columns[ListView1.Columns.Count - 1].AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
- //ListView1.Columns[ListView1.Columns.Count - 1].Width = -2; // -2 = Fill remaining space
- int cs = 0;
- for (int n = 0; n < listView.Columns.Count - 1; n++)
- {
- var column = listView.Columns[n];
- cs += column.Width;
- }
- listView.BeginUpdate();
- listView.Columns[^1].Width = Math.Max(400, listView.ClientRectangle.Width - cs);
- listView.EndUpdate();
- }
- }
- //-----------------------------------------------------------------------------------
- public static void AutoSizeLastColumn(this DataGridView dataGridView)
- {
- if (dataGridView.Columns.Count > 0)
- {
- int cs = 0;
- for (int n = 0; n < dataGridView.Columns.Count - 1; n++)
- {
- var columnWidth = dataGridView.Columns[n].Width;
- var columnDivider = dataGridView.Columns[n].DividerWidth;
- cs += columnWidth + columnDivider;
- }
- cs += (dataGridView.Margin.Left + dataGridView.Margin.Right) * 2;
- foreach (var scroll in dataGridView.Controls.OfType())
- {
- if (scroll.Visible == true)
- cs += SystemInformation.VerticalScrollBarWidth;
- }
- dataGridView.Columns[dataGridView.Columns.Count - 1].Width = Math.Max(400, dataGridView.ClientRectangle.Width - cs);
- }
- }
- //-----------------------------------------------------------------------------------
- public static void SaveToFile(this List list, string filePath)
- {
- try
- {
- FileStreamOptions streamOptions = new();
- streamOptions.Access = FileAccess.ReadWrite;
- streamOptions.Share = FileShare.ReadWrite;
- streamOptions.Mode = FileMode.Create;
- streamOptions.Options = FileOptions.RandomAccess;
- using StreamWriter file = new(filePath, streamOptions);
- for (int n = 0; n < list.Count; n++)
- if (list[n] != null)
- {
- file.WriteLine(list[n]);
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Save List to File: {ex.Message}");
- }
- }
- //-----------------------------------------------------------------------------------
- public static void LoadFromFile(this List list, string filePath, bool ignoreEmptyLines, bool trimLines)
- {
- if (!File.Exists(filePath)) return;
- string content = File.ReadAllText(filePath);
- List lines = content.SplitToLines();
- for (int n = 0; n < lines.Count; n++)
- {
- string line = lines[n];
- if (ignoreEmptyLines)
- {
- if (!string.IsNullOrWhiteSpace(line))
- {
- if (trimLines)
- list.Add(line.Trim());
- else
- list.Add(line);
- }
- }
- else
- {
- if (trimLines)
- list.Add(line.Trim());
- else
- list.Add(line);
- }
- }
- }
- //-----------------------------------------------------------------------------------
- public static void LoadFromFile(this List
", string.Empty);
- s = s.Replace("", string.Empty);
- s = s.Replace("", string.Empty);
- s = s.Replace("
", string.Empty);
-
- while (s.ToLower().Contains("
"), startIndex + 4);
- s = s.Remove(startIndex, endIndex - startIndex + 1);
- }
- return s;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/CommonTools.cs b/MsmhTools/MsmhTools/HTTPProxyServer/CommonTools.cs
deleted file mode 100644
index 195d53a..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/CommonTools.cs
+++ /dev/null
@@ -1,327 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Net;
-using System.Net.NetworkInformation;
-using System.Net.Sockets;
-using System.Text;
-
-namespace MsmhTools.HTTPProxyServer
-{
- internal static class CommonTools
- {
- internal static async Task IsIpBlocked(string ip, int port, HttpMethod httpMethod, int timeoutMS)
- {
- bool canPing = await CanPing(ip, timeoutMS);
-
- if (canPing)
- {
- bool canTcpConnect;
- try
- {
- canTcpConnect = await CanTcpConnect(ip, port, timeoutMS);
- }
- catch (Exception)
- {
- canTcpConnect = false;
- }
-
- return !canTcpConnect;
- }
- else
- return true;
- }
-
- internal static async Task IsHostBlocked(string host, int port, HttpMethod httpMethod, int timeoutMS)
- {
- IPAddress? ip = HostToIP(host);
- if (ip != null)
- {
- return await IsIpBlocked(ip.ToString(), port, httpMethod, timeoutMS);
- }
- else
- return true;
- }
-
- internal static async Task IsHostBlockedBySNI(string host, int port, HttpMethod httpMethod, int timeoutMS)
- {
- bool canPing = await CanPing(host, timeoutMS);
-
- if (canPing)
- {
- bool canConnect;
- try
- {
- canConnect = await CanConnect(host, port, httpMethod, timeoutMS);
- }
- catch (Exception)
- {
- canConnect = false;
- }
-
- return !canConnect;
- }
- else
- return true;
- }
-
- private static async Task CanPing(string host, int timeoutMS)
- {
- var task = Task.Run(() =>
- {
- try
- {
- Ping ping = new();
- PingReply reply = ping.Send(host, timeoutMS);
- if (reply == null) return false;
-
- return reply.Status == IPStatus.Success;
- }
- catch (PingException)
- {
- return false;
- }
- });
-
- if (await task.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS + 500)))
- return task.Result;
- else
- return false;
- }
-
- private static async Task CanTcpConnect(string host, int port, int timeoutMS)
- {
- var task = Task.Run(() =>
- {
- try
- {
- using TcpClient client = new(host, port);
- client.SendTimeout = timeoutMS;
- return true;
- }
- catch (Exception)
- {
- return false;
- }
- });
-
- if (await task.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS + 500)))
- return task.Result;
- else
- return false;
- }
-
- public static async Task CanConnect(string host, int port, HttpMethod httpMethod, int timeoutMS)
- {
- var task = Task.Run(async () =>
- {
- try
- {
- if (httpMethod == HttpMethod.Post)
- {
- string url = $"https://{host}:{port}";
- Uri uri = new(url, UriKind.Absolute);
-
- // Ignore Cert
- using HttpClientHandler handler = new();
- handler.ClientCertificateOptions = ClientCertificateOption.Manual;
- handler.ServerCertificateCustomValidationCallback =
- (httpRequestMessage, cert, cetChain, policyErrors) => true;
-
- using HttpClient httpClient = new(handler);
- httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutMS);
-
- await httpClient.GetAsync(uri);
- return true;
- }
- else
- {
- string url = $"http://{host}:{port}";
- Uri uri = new(url, UriKind.Absolute);
-
- using HttpClient httpClient = new();
- httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutMS);
-
- await httpClient.GetAsync(uri);
- return true;
- }
- }
- catch (Exception)
- {
- try
- {
- if (port != 80)
- {
- string url = $"http://{host}";
- Uri uri = new(url, UriKind.Absolute);
-
- using HttpClient httpClient = new();
- httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutMS);
-
- await httpClient.GetAsync(uri);
- return true;
- }
- }
- catch (Exception)
- {
- return false;
- }
-
- return false;
- }
- });
-
- if (await task.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS + 500)))
- return task.Result;
- else
- return false;
- }
-
- internal static IPAddress? HostToIP(string host, bool getIPv6 = false)
- {
- IPAddress? result = null;
-
- try
- {
- //IPAddress[] ipAddresses = Dns.GetHostEntry(host).AddressList;
- IPAddress[] ipAddresses = Dns.GetHostAddresses(host);
-
- if (ipAddresses == null || ipAddresses.Length == 0)
- return null;
-
- if (!getIPv6)
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetwork)
- {
- result = ipAddresses[n];
- break;
- }
- }
- }
- else
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetworkV6)
- {
- result = ipAddresses[n];
- break;
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- return result;
- }
-
- internal static byte[] AppendBytes(byte[] orig, byte[] append)
- {
- if (append == null) return orig;
- if (orig == null) return append;
-
- byte[] ret = new byte[orig.Length + append.Length];
- Buffer.BlockCopy(orig, 0, ret, 0, orig.Length);
- Buffer.BlockCopy(append, 0, ret, orig.Length, append.Length);
- return ret;
- }
-
- ///
- /// Fully read a stream into a byte array.
- ///
- /// The input stream.
- /// A byte array containing the data read from the stream.
- internal static byte[] StreamToBytes(Stream input)
- {
- if (input == null) throw new ArgumentNullException(nameof(input));
- if (!input.CanRead) throw new InvalidOperationException("Input stream is not readable");
-
- byte[] buffer = new byte[16 * 1024];
- using MemoryStream ms = new();
- int read;
-
- while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
- {
- ms.Write(buffer, 0, read);
- }
-
- return ms.ToArray();
- }
-
- ///
- /// Add a key-value pair to a supplied Dictionary.
- ///
- /// The key.
- /// The value.
- /// An existing dictionary.
- /// The existing dictionary with a new key and value, or, a new dictionary with the new key value pair.
- internal static Dictionary AddToDict(string key, string? val, Dictionary existing)
- {
- if (string.IsNullOrEmpty(key)) return existing;
-
- Dictionary ret = new();
-
- if (existing == null)
- {
- ret.Add(key, val);
- return ret;
- }
- else
- {
- if (existing.ContainsKey(key))
- {
- if (string.IsNullOrEmpty(val)) return existing;
- string tempVal = existing[key];
- tempVal += "," + val;
- existing.Remove(key);
- existing.Add(key, tempVal);
- return existing;
- }
- else
- {
- existing.Add(key, val);
- return existing;
- }
- }
- }
-
- internal static bool IsWin7()
- {
- bool result = false;
- OperatingSystem os = Environment.OSVersion;
- Version vs = os.Version;
-
- if (os.Platform == PlatformID.Win32NT)
- {
- if (vs.Minor == 1 && vs.Major == 6)
- result = true;
- }
-
- return result;
- }
-
- internal static int Search(byte[] src, byte[] pattern)
- {
- int maxFirstCharSlot = src.Length - pattern.Length + 1;
- for (int i = 0; i < maxFirstCharSlot; i++)
- {
- if (src[i] != pattern[0]) // compare only first byte
- continue;
-
- // found a match on first byte, now try to match rest of the pattern
- for (int j = pattern.Length - 1; j >= 1; j--)
- {
- if (src[i + j] != pattern[j]) break;
- if (j == 1) return i;
- }
- }
- return -1;
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/DPIBypass.cs b/MsmhTools/MsmhTools/HTTPProxyServer/DPIBypass.cs
deleted file mode 100644
index 13bf33a..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/DPIBypass.cs
+++ /dev/null
@@ -1,557 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Net.Sockets;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.HTTPProxyServer
-{
- public partial class HTTPProxyServer
- {
- public partial class Program
- {
- //======================================= DPI Bypass Support
- public class DPIBypass
- {
- public Mode DPIBypassMode { get; private set; } = Mode.Disable;
- public ChunkMode DPIChunkMode { get; private set; }
- private int BeforeSniChunks { get; set; } = 0;
- private int SniChunks { get; set; } = 0;
- public int AntiPatternOffset { get; private set; } = 2;
- public int FragmentDelay { get; private set; } = 0;
- public string? DestHostname { get; set; }
- public int DestPort { get; set; }
-
- public event EventHandler? OnChunkDetailsReceived;
-
- public DPIBypass() { }
-
- public void Set(Mode mode, int beforeSniChunks, ChunkMode chunkMode, int sniChunks, int antiPatternOffset, int fragmentDelay)
- {
- DPIBypassMode = mode;
- BeforeSniChunks = beforeSniChunks;
- DPIChunkMode = chunkMode;
- SniChunks = sniChunks;
- AntiPatternOffset = antiPatternOffset;
- FragmentDelay = fragmentDelay;
- }
-
- // Max Data Length = 65536
- private const int MaxDataLength = 65536;
- public enum Mode
- {
- Program,
- Disable
- }
-
- public enum ChunkMode
- {
- SNI,
- SniExtension,
- AllExtensions
- }
-
- public class ProgramMode
- {
- private byte[] Data { get; set; }
- private Socket Socket { get; set; }
-
- public ProgramMode(byte[] data, Socket socket)
- {
- Data = data;
- Socket = socket;
- }
-
- public void Send(DPIBypass bp)
- {
- int offset = bp.AntiPatternOffset;
- Random random = new();
-
- // Anti Pattern Fragment Chunks
- int beforeSniChunks = random.Next(bp.BeforeSniChunks - offset, bp.BeforeSniChunks + offset);
- if (beforeSniChunks <= 0) beforeSniChunks = 1;
- if (beforeSniChunks > Data.Length) beforeSniChunks = Data.Length;
-
- int sniChunks = random.Next(bp.SniChunks - offset, bp.SniChunks + offset);
- if (sniChunks <= 0) sniChunks = 1;
- if (sniChunks > Data.Length) sniChunks = Data.Length;
-
- //Test(Data, Socket, beforeSniChunks, sniChunks, offset, bp);
-
- if (bp.DPIChunkMode == ChunkMode.AllExtensions)
- SendDataInFragmentAllExtensions(Data, Socket, beforeSniChunks, sniChunks, offset, bp);
- else if (bp.DPIChunkMode == ChunkMode.SniExtension)
- SendDataInFragmentSniExtension(Data, Socket, beforeSniChunks, sniChunks, offset, bp);
- else if (bp.DPIChunkMode == ChunkMode.SNI)
- SendDataInFragmentSNI(Data, Socket, beforeSniChunks, sniChunks, offset, bp);
- }
-
- private void Test(byte[] data, Socket socket, int beforeSniChunks, int sniChunks, int offset, DPIBypass bp)
- {
- Debug.WriteLine("Send Data in TEST");
- // Create packets
- List packets = new();
- packets.Clear();
-
- SniModifire sniModifire = new(data);
- if (sniModifire.HasSni)
- {
- packets.Add(sniModifire.ModifiedData);
- SendPackets(sniModifire.ModifiedData, socket, bp, packets);
- }
- else
- {
- packets.Add(data);
- SendPackets(data, socket, bp, packets);
- }
-
- }
-
- private void SendDataInFragmentAllExtensions(byte[] data, Socket socket, int beforeSniChunks, int sniChunks, int offset, DPIBypass bp)
- {
- //Debug.WriteLine("SendDataInFragmentAllExtensions");
- // Create packets
- List packets = new();
- packets.Clear();
-
- SniReader sniReader = new(data);
-
- if (beforeSniChunks == 1 && sniChunks == 1)
- {
- packets.Add(data);
- }
- else
- {
- if (sniReader.HasTlsExtensions)
- {
- int prevIndex;
- int pos = 0;
- SniReader.TlsExtensions allExtensions = sniReader.AllExtensions;
-
- pos += allExtensions.StartIndex;
- prevIndex = pos - allExtensions.StartIndex;
-
- // Create packet before SNI
- int beforeSniLength = allExtensions.StartIndex - prevIndex;
- if (beforeSniLength > 0)
- {
- byte[] beforeSNI = new byte[beforeSniLength];
- Buffer.BlockCopy(data, prevIndex, beforeSNI, 0, beforeSniLength);
-
- List chunkedbeforeSNI = ChunkDataNormal(beforeSNI, beforeSniChunks, offset);
- packets = packets.Concat(chunkedbeforeSNI).ToList();
- //Debug.WriteLine($"{prevIndex} ======> {beforeSniLength}");
- }
-
- // Create SNI packet
- List chunkedSNI = ChunkDataNormal(allExtensions.Data, sniChunks, offset);
- packets = packets.Concat(chunkedSNI).ToList();
-
- //Debug.WriteLine($"{beforeSniLength} ====== {sni.SniStartIndex}");
- //Debug.WriteLine($"{sni.SniStartIndex} ======> {sni.SniStartIndex + sni.SniLength}");
- Debug.WriteLine("==-----== " + (sniReader.AllExtensions.StartIndex + sniReader.AllExtensions.Length) + " of " + data.Length);
- pos = allExtensions.StartIndex + allExtensions.Length;
-
- // Create packet after SNI
- if (pos < data.Length)
- {
- int afterSniStartIndex = pos;
- int afterSniLength = data.Length - pos;
- byte[] afterSni = new byte[afterSniLength];
- Buffer.BlockCopy(data, afterSniStartIndex, afterSni, 0, afterSniLength);
- packets.Add(afterSni);
-
- //Debug.WriteLine($"{sni.SniStartIndex + sni.SniLength} ====== {afterSniStartIndex}");
- //Debug.WriteLine($"{afterSniStartIndex} ======> {afterSniStartIndex + afterSniLength}");
- //Debug.WriteLine($"{afterSniStartIndex + afterSniLength} ====== {data.Length}");
- }
- }
- else
- {
- packets.Add(data);
- }
- }
-
- SendPackets(data, socket, bp, packets);
- }
-
- private void SendDataInFragmentSniExtension(byte[] data, Socket socket, int beforeSniChunks, int sniChunks, int offset, DPIBypass bp)
- {
- //Debug.WriteLine("SendDataInFragmentSniExtension");
- // Create packets
- List packets = new();
- packets.Clear();
-
- SniReader sniReader = new(data);
- if (sniReader.SniExtensionList.Count > 1) Debug.WriteLine($"=======================> We Have {sniReader.SniExtensionList.Count} SNI Extensions.");
-
- if (beforeSniChunks == 1 && sniChunks == 1)
- {
- packets.Add(data);
- }
- else
- {
- if (sniReader.HasSniExtension)
- {
- int prevIndex;
- int pos = 0;
- for (int n = 0; n < sniReader.SniExtensionList.Count; n++)
- {
- SniReader.SniExtension sniExtension = sniReader.SniExtensionList[n];
-
- pos += sniExtension.StartIndex;
- prevIndex = pos - sniExtension.StartIndex;
-
- // Create packet before SNI
- int beforeSniLength = sniExtension.StartIndex - prevIndex;
- if (beforeSniLength > 0)
- {
- byte[] beforeSNI = new byte[beforeSniLength];
- Buffer.BlockCopy(data, prevIndex, beforeSNI, 0, beforeSniLength);
-
- List chunkedbeforeSNI = ChunkDataNormal(beforeSNI, beforeSniChunks, offset);
- packets = packets.Concat(chunkedbeforeSNI).ToList();
- //Debug.WriteLine($"{prevIndex} ======> {beforeSniLength}");
- }
-
- // Create SNI packet
- List chunkedSNI = ChunkDataNormal(sniExtension.Data, sniChunks, offset);
- packets = packets.Concat(chunkedSNI).ToList();
-
- //Debug.WriteLine($"{beforeSniLength} ====== {sni.SniStartIndex}");
- //Debug.WriteLine($"{sni.SniStartIndex} ======> {sni.SniStartIndex + sni.SniLength}");
-
- pos = sniExtension.StartIndex + sniExtension.Length;
-
- // Last round
- if (n == sniReader.SniExtensionList.Count - 1)
- {
- // Create packet after SNI
- if (pos < data.Length)
- {
- int afterSniStartIndex = pos;
- int afterSniLength = data.Length - pos;
- byte[] afterSni = new byte[afterSniLength];
- Buffer.BlockCopy(data, afterSniStartIndex, afterSni, 0, afterSniLength);
- packets.Add(afterSni);
-
- //Debug.WriteLine($"{sni.SniStartIndex + sni.SniLength} ====== {afterSniStartIndex}");
- //Debug.WriteLine($"{afterSniStartIndex} ======> {afterSniStartIndex + afterSniLength}");
- //Debug.WriteLine($"{afterSniStartIndex + afterSniLength} ====== {data.Length}");
- }
- }
- }
- }
- else
- {
- packets.Add(data);
- }
- }
-
- SendPackets(data, socket, bp, packets);
- }
-
- private void SendDataInFragmentSNI(byte[] data, Socket socket, int beforeSniChunks, int sniChunks, int offset, DPIBypass bp)
- {
- //Debug.WriteLine("SendDataInFragmentSNI");
- // Create packets
- List packets = new();
- packets.Clear();
-
- SniReader sniReader = new(data);
- if (sniReader.SniList.Count > 1) Debug.WriteLine($"=======================> We Have {sniReader.SniList.Count} SNIs.");
-
- if (beforeSniChunks == 1 && sniChunks == 1)
- {
- packets.Add(data);
- }
- else
- {
- if (sniReader.HasSni)
- {
- int prevIndex;
- int pos = 0;
- for (int n = 0; n < sniReader.SniList.Count; n++)
- {
- SniReader.SNI sni = sniReader.SniList[n];
-
- pos += sni.StartIndex;
- prevIndex = pos - sni.StartIndex;
-
- // Create packet before SNI
- int beforeSniLength = sni.StartIndex - prevIndex;
- if (beforeSniLength > 0)
- {
- byte[] beforeSNI = new byte[beforeSniLength];
- Buffer.BlockCopy(data, prevIndex, beforeSNI, 0, beforeSniLength);
-
- List chunkedbeforeSNI = ChunkDataNormal(beforeSNI, beforeSniChunks, offset);
- packets = packets.Concat(chunkedbeforeSNI).ToList();
- //Debug.WriteLine($"{prevIndex} ======> {beforeSniLength}");
- }
-
- // Create SNI packet
- List chunkedSNI = ChunkDataNormal(sni.Data, sniChunks, offset);
- packets = packets.Concat(chunkedSNI).ToList();
-
- //Debug.WriteLine($"{beforeSniLength} ====== {sni.SniStartIndex}");
- //Debug.WriteLine($"{sni.SniStartIndex} ======> {sni.SniStartIndex + sni.SniLength}");
-
- pos = sni.StartIndex + sni.Length;
-
- // Last round
- if (n == sniReader.SniList.Count - 1)
- {
- // Create packet after SNI
- if (pos < data.Length)
- {
- int afterSniStartIndex = pos;
- int afterSniLength = data.Length - pos;
- byte[] afterSni = new byte[afterSniLength];
- Buffer.BlockCopy(data, afterSniStartIndex, afterSni, 0, afterSniLength);
- packets.Add(afterSni);
-
- //Debug.WriteLine($"{sni.SniStartIndex + sni.SniLength} ====== {afterSniStartIndex}");
- //Debug.WriteLine($"{afterSniStartIndex} ======> {afterSniStartIndex + afterSniLength}");
- //Debug.WriteLine($"{afterSniStartIndex + afterSniLength} ====== {data.Length}");
- }
- }
- }
- }
- else
- {
- packets.Add(data);
- }
- }
-
- SendPackets(data, socket, bp, packets);
- }
-
- private List ChunkDataNormal(byte[] data, int chunks, int offset)
- {
- //Debug.WriteLine("ChunkDataNormal");
- // Create chunk packets
- Random random = new();
- List chunkPackets = new();
- chunkPackets.Clear();
- int prevIndex;
- int nn = 0;
- int sum = 0;
- for (int n = 0; n < data.Length; n++)
- {
- try
- {
- // Anti Pattern Fragment Size
- int fragmentSize = data.Length / chunks;
-
- int fragmentSizeOut = random.Next(fragmentSize - offset, fragmentSize + offset);
- if (fragmentSizeOut <= 0) fragmentSizeOut = 1;
- if (fragmentSizeOut > data.Length) fragmentSizeOut = data.Length;
- nn += fragmentSizeOut;
-
- if (nn > data.Length)
- {
- fragmentSizeOut = data.Length - (nn - fragmentSizeOut);
- //Debug.WriteLine(fragmentSizeOut);
- }
- //Debug.WriteLine(fragmentSizeOut);
-
- sum += fragmentSizeOut;
- byte[] fragmentData = new byte[fragmentSizeOut];
- prevIndex = sum - fragmentSizeOut;
- Buffer.BlockCopy(data, prevIndex, fragmentData, 0, fragmentSizeOut);
- chunkPackets.Add(fragmentData);
-
- if (sum >= data.Length) break;
- }
- catch (Exception ex)
- {
- chunkPackets.Clear();
- string msgEvent = $"Error, Creating normal packets: {ex.Message}";
- Debug.WriteLine(msgEvent);
- return chunkPackets;
- }
- }
-
- return chunkPackets;
- }
-
- private List ChunkDataNormal2(byte[] data, int fragmentSize)
- {
- Debug.WriteLine("ChunkDataNormal2");
- // Create chunk packets
- List chunkPackets = new();
- chunkPackets.Clear();
- var fragments = data.Chunk(fragmentSize);
- for (int n = 0; n < fragments.Count(); n++)
- {
- try
- {
- byte[] fragment = fragments.ToArray()[n];
- chunkPackets.Add(fragment);
- }
- catch (Exception ex)
- {
- chunkPackets.Clear();
- string msgEvent = $"Error, Creating normal2 packets: {ex.Message}";
- Debug.WriteLine(msgEvent);
- return chunkPackets;
- }
- }
-
- return chunkPackets;
- }
-
- private List ChunkDataNormal3(byte[] data, int fragmentSize)
- {
- Debug.WriteLine("ChunkDataNormal3");
- // Create chunk packets
- List chunkPackets = new();
- chunkPackets.Clear();
- var fragments = ChunkViaMemory(data, fragmentSize);
- for (int n = 0; n < fragments.Count(); n++)
- {
- try
- {
- byte[] fragment = fragments.ToArray()[n].ToArray();
- chunkPackets.Add(fragment);
- }
- catch (Exception ex)
- {
- chunkPackets.Clear();
- string msgEvent = $"Error, Creating normal3 packets: {ex.Message}";
- Debug.WriteLine(msgEvent);
- return chunkPackets;
- }
- }
-
- return chunkPackets;
- }
-
- private List ChunkDataRandom(byte[] data, int fragmentChunks)
- {
- Debug.WriteLine("ChunkDataRandom");
- //// Calculate fragment chunks from size
- //int fragmentChunks = data.Length / fragmentSize;
- //if (fragmentChunks <= 0) fragmentChunks = 1;
- //if (fragmentChunks > data.Length) fragmentChunks = data.Length;
-
- // Create chunk packets
- List packets = new();
- packets.Clear();
- fragmentChunks = Math.Min(fragmentChunks, data.Length);
- List indices;
- if (fragmentChunks < data.Length)
- indices = GenerateRandomIndices(1, data.Length - 1, fragmentChunks - 1);
- else
- indices = Enumerable.Range(0, data.Length - 1).ToList();
- indices.Sort();
-
- int prevIndex = 0;
- for (int n = 0; n < indices.Count; n++)
- {
- try
- {
- int index = indices[n];
- byte[] fragmentData = new byte[index - prevIndex];
- Buffer.BlockCopy(data, prevIndex, fragmentData, 0, fragmentData.Length);
- packets.Add(fragmentData);
- prevIndex = index;
- }
- catch (Exception ex)
- {
- packets.Clear();
- string msgEvent = $"Error, Creating random packets: {ex.Message}";
- Debug.WriteLine(msgEvent);
- return packets;
- }
- }
-
- try
- {
- byte[] lastFragmentData = new byte[data.Length - prevIndex];
- Buffer.BlockCopy(data, prevIndex, lastFragmentData, 0, lastFragmentData.Length);
- packets.Add(lastFragmentData);
- }
- catch (Exception ex)
- {
- packets.Clear();
- string msgEvent = $"Error, Creating last random packet: {ex.Message}";
- Debug.WriteLine(msgEvent);
- return packets;
- }
-
- return packets;
- }
-
- private void SendPackets(byte[] data, Socket socket, DPIBypass bp, List packets)
- {
- // Check packets
- int allLength = 0;
- for (int i = 0; i < packets.Count; i++)
- allLength += packets[i].Length;
-
- if (allLength != data.Length)
- {
- Debug.WriteLine($"{allLength} == {data.Length}, Chunks: {packets.Count}");
- packets.Clear();
- return;
- }
-
- // Send packets
- for (int i = 0; i < packets.Count; i++)
- {
- try
- {
- byte[] fragmentData = packets[i];
- if (socket == null) return;
- socket.Send(fragmentData);
- if (bp.FragmentDelay > 0)
- Task.Delay(bp.FragmentDelay).Wait();
- }
- catch (Exception ex)
- {
- string msgEvent = $"Error, Send Packets: {ex.Message}";
- Debug.WriteLine(msgEvent);
- return;
- }
- }
-
- string chunkDetailsEvent = $"{bp.DestHostname}:{bp.DestPort} Length: {data.Length}";
- if (packets.Count > 1)
- chunkDetailsEvent += $", Chunks: {packets.Count}";
- bp.OnChunkDetailsReceived?.Invoke(chunkDetailsEvent, EventArgs.Empty);
- }
- }
-
- private static List GenerateRandomIndices(int minValue, int maxValue, int count)
- {
- Random random = new();
- HashSet indicesSet = new();
-
- while (indicesSet.Count < count)
- {
- indicesSet.Add(random.Next(minValue, maxValue));
- }
-
- return new List(indicesSet);
- }
-
- private static IEnumerable> ChunkViaMemory(T[] data, int size)
- {
- var chunks = data.Length / size;
- for (int i = 0; i < chunks; i++)
- {
- yield return data.AsMemory(i * size, size);
- }
- var leftOver = data.Length % size;
- if (leftOver > 0)
- {
- yield return data.AsMemory(chunks * size, leftOver);
- }
- }
-
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/Decoder.cs b/MsmhTools/MsmhTools/HTTPProxyServer/Decoder.cs
deleted file mode 100644
index 5ca5e79..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/Decoder.cs
+++ /dev/null
@@ -1,225 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Text;
-
-namespace MsmhTools.HTTPProxyServer
-{
- ///
- /// Decode chunk-transfer-encoded streams or byte arrays, particularly from HTTP data.
- ///
- public class ChunkDecoder
- {
- ///
- /// Callback to invoke to process signatures found in the chunk length line.
- /// Called before ProcessChunk.
- /// Return 'true' to continue operation.
- /// Return 'false' to terminate.
- ///
- public Func, byte[], bool>? ProcessSignature = null;
-
- ///
- /// Callback to invoke to process a chunk.
- /// Called after ProcessSignature.
- /// Return 'true' to continue operation.
- /// Return 'false' to terminate.
- ///
- public Func? ProcessChunk = null;
-
- ///
- /// Instantiate the object.
- ///
- public ChunkDecoder()
- {
-
- }
-
- ///
- /// Decode a chunk-transfer-encoded byte array to a non-chunked byte array.
- ///
- /// Original byte array with chunk-transfer-encoding.
- /// Data without encoding.
- /// True if successful.
- public bool Decode(byte[] data, out byte[]? outData)
- {
- outData = null;
- if (data == null || data.Length < 1) throw new ArgumentNullException(nameof(data));
-
- MemoryStream ms = new();
- ms.Write(data, 0, data.Length);
- ms.Seek(0, SeekOrigin.Begin);
-
- if (Decode(ms, out long contentLength, out MemoryStream outStream))
- {
- if (contentLength > 0)
- {
- outData = new byte[contentLength];
- outData = outStream.ToArray();
- }
-
- return true;
- }
- else
- {
- return false;
- }
- }
-
- ///
- /// Decode a chunk-transfer-encoded stream to a non-chunked stream.
- ///
- /// Original stream with chunk-transfer-encoding.
- /// Content length of the data in the output stream.
- /// Output stream containing data without encoding.
- /// True if successful.
- public bool Decode(Stream stream, out long contentLength, out MemoryStream outStream)
- {
- contentLength = 0;
- outStream = new MemoryStream();
-
- if (stream == null) throw new ArgumentNullException(nameof(stream));
- if (!stream.CanRead) throw new ArgumentException("Cannot read from supplied stream.");
- if (stream.CanSeek) stream.Seek(0, SeekOrigin.Begin);
-
- int bytesRead = 0;
- long segmentLength = 0;
- byte[] headerBuffer = new byte[1];
- string header = "";
- byte[]? dataBuffer = null;
- long bytesRemaining = 0;
-
- while (true)
- {
- // Read-Chunk-Length
- Log("Reading chunk length");
- headerBuffer = new byte[1];
- header = "";
-
- while (true)
- {
- bytesRead = stream.Read(headerBuffer, 0, headerBuffer.Length);
- if (bytesRead > 0)
- {
- Log("| Read " + bytesRead + ": " + Encoding.UTF8.GetString(headerBuffer).Trim());
- header += Convert.ToChar(headerBuffer[0]);
- if ((int)headerBuffer[0] == 10)
- {
- // end of header
- Log("| End of header detected");
- break;
- }
- }
- }
-
- // Check-for-Key-Value-Pairs
- header = header.Trim();
- string segmentLengthStr;
- Dictionary signatures = new();
-
- if (header.Contains(';'))
- {
- Log("Embedded key-value pairs detected");
- string[] vals = header.Split(';');
- segmentLengthStr = vals[0];
-
- if (vals.Length > 1)
- {
- for (int i = 1; i < vals.Length; i++)
- {
- string[] kvp = vals[i].Split('=');
- if (kvp.Length == 1)
- {
- Log("| " + kvp[0] + ": null");
- signatures.Add(kvp[0], null);
- }
- if (kvp.Length == 2)
- {
- Log("| " + kvp[0] + ": " + kvp[1]);
- signatures.Add(kvp[0], kvp[1]);
- }
- }
- }
- }
- else
- {
- segmentLengthStr = header;
- }
-
- Log("Reading data of length " + segmentLengthStr);
-
- // Check-for-End
- if (!string.IsNullOrEmpty(segmentLengthStr)) segmentLength = Convert.ToInt64(segmentLengthStr, 16);
- if (segmentLength < 1) // Segment length of 0 indicates end of message
- {
- // Read out the final \r\n
- Log("End of message detected");
- headerBuffer = new byte[2];
- bytesRead = stream.Read(headerBuffer, 0, headerBuffer.Length);
- break; // end of stream
- }
-
- // Read-Data
- dataBuffer = new byte[segmentLength];
- bytesRemaining = segmentLength;
-
- while (bytesRemaining > 0)
- {
- bytesRead = stream.Read(dataBuffer, 0, dataBuffer.Length);
- if (bytesRead > 0)
- {
- Log("| Read " + bytesRead + ": " + Encoding.UTF8.GetString(dataBuffer));
-
- if (ProcessSignature != null && signatures != null && signatures.Count > 0)
- {
- foreach (KeyValuePair currSignature in signatures)
- {
- if (!ProcessSignature(currSignature, dataBuffer))
- {
- Log("*** Failed to process signature " + currSignature.Key + ", exiting");
- return false;
- }
- }
- }
-
- if (ProcessChunk != null)
- {
- if (!ProcessChunk(dataBuffer))
- {
- Log("*** Failed to process chunk");
- return false;
- }
- }
-
- outStream.Write(dataBuffer, 0, bytesRead);
- bytesRemaining -= bytesRead;
- contentLength += bytesRead;
- Log("| Content length is now " + contentLength);
- }
- }
-
- // Read-CRLF-After-Data
- // Read out the final \r\n
- byte[] newlineBuffer = new byte[1];
- while (true)
- {
- bytesRead = stream.Read(newlineBuffer, 0, newlineBuffer.Length);
- if (bytesRead > 0)
- {
- if ((int)newlineBuffer[0] == 10) break;
- }
- }
- }
-
- outStream.Seek(0, SeekOrigin.Begin);
- return true;
- }
-
- // Private-Methods
- private void Log(string msg)
- {
- if (!string.IsNullOrEmpty(msg))
- {
- Debug.WriteLine(msg);
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/HTTPProxyServer.cs b/MsmhTools/MsmhTools/HTTPProxyServer/HTTPProxyServer.cs
deleted file mode 100644
index 7d4e20c..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/HTTPProxyServer.cs
+++ /dev/null
@@ -1,807 +0,0 @@
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Text;
-using System.Diagnostics;
-using MsmhTools.DnsTool;
-using MsmhTools.ProxifiedTcpClient;
-
-namespace MsmhTools.HTTPProxyServer
-{
- public partial class HTTPProxyServer
- {
- //======================================= DPI Bypass Support: Static
- public static Program.DPIBypass StaticDPIBypassProgram = new();
- public void EnableStaticDPIBypass(Program.DPIBypass dpiBypassProgram)
- {
- StaticDPIBypassProgram = dpiBypassProgram;
- }
-
- //--- Constant
- public Program.DPIBypass DPIBypassProgram = new();
- public void EnableDPIBypass(Program.DPIBypass dpiBypassProgram)
- {
- DPIBypassProgram = dpiBypassProgram;
- }
-
- //======================================= UpStream Proxy Support
- public Program.UpStreamProxy UpStreamProxyProgram = new();
- public void EnableUpStreamProxy(Program.UpStreamProxy upStreamProxyProgram)
- {
- UpStreamProxyProgram = upStreamProxyProgram;
- }
-
- //======================================= DNS Support
- public Program.Dns DNSProgram = new();
- public void EnableDNS(Program.Dns dnsProgram)
- {
- DNSProgram = dnsProgram;
- }
-
- //======================================= Fake DNS Support
- public Program.FakeDns FakeDNSProgram = new();
- public void EnableFakeDNS(Program.FakeDns fakeDnsProgram)
- {
- FakeDNSProgram = fakeDnsProgram;
- }
-
- //======================================= Black White List Support
- public Program.BlackWhiteList BWListProgram = new();
- public void EnableBlackWhiteList(Program.BlackWhiteList blackWhiteListProgram)
- {
- BWListProgram = blackWhiteListProgram;
- }
-
- //======================================= DontBypass Support
- public Program.DontBypass DontBypassProgram = new();
- public void EnableDontBypass(Program.DontBypass dontBypassProgram)
- {
- DontBypassProgram = dontBypassProgram;
- }
-
- //======================================= Start HTTP Proxy
- internal ProxySettings _Settings = new();
-
- private TunnelManager _TunnelManager = new();
- private TcpListener? _TcpListener;
-
- private CancellationTokenSource? _CancelTokenSource;
- private CancellationToken _CancelToken;
-
- private System.Timers.Timer KillOnOverloadTimer { get; set; } = new(5000);
- private PerformanceCounter PFC { get; set; } = new();
- private float CpuUsage { get; set; } = 0;
-
- private bool Cancel = false;
-
- //private readonly EventWaitHandle Terminator = new(false, EventResetMode.ManualReset);
-
- private Thread? MainThread;
- private List BlackList { get; set; } = new();
-
- public event EventHandler? OnRequestReceived;
- public event EventHandler? OnErrorOccurred;
- public event EventHandler? OnDebugInfoReceived;
- public readonly int MaxDataSize = 65536;
- public bool IsRunning { get; private set; } = false;
- public bool BlockPort80 { get; set; } = false;
-
- ///
- /// Kill Requests If CPU Usage is Higher than this Value.
- ///
- public float KillOnCpuUsage { get; set; } = 25;
-
- ///
- /// Kill Request if didn't receive data for n seconds. Default: 0 Sec (Disabled)
- ///
- public int RequestTimeoutSec { get; set; } = 0;
-
- public HTTPProxyServer()
- {
- // Captive Portal and others
- BlackList.Add("ipv6.msftconnecttest.com:80");
- BlackList.Add("msedge.b.tlu.dl.delivery.mp.microsoft.com:80");
- BlackList.Add("edgedl.me.gvt1.com:80");
- BlackList.Add("detectportal.firefox.com:80");
- BlackList.Add("gstatic.com:80");
- BlackList = BlackList.Distinct().ToList();
-
- // CPU
- PFC.CategoryName = "Process";
- PFC.CounterName = "% Processor Time";
- PFC.InstanceName = Process.GetCurrentProcess().ProcessName;
- PFC.ReadOnly = true;
- }
-
- public void Start(IPAddress ipAddress, int port, int maxThreads)
- {
- if (IsRunning) return;
- IsRunning = true;
-
- _Settings = new();
- _Settings.ListenerIpAddress = ipAddress;
- _Settings.ListenerPort = port;
- _Settings.MaxThreads = maxThreads;
-
- Welcome();
-
- _TunnelManager = new();
-
- _CancelTokenSource = new();
- _CancelToken = _CancelTokenSource.Token;
-
- Cancel = false;
-
- KillOnOverloadTimer.Elapsed += KillOnOverloadTimer_Elapsed;
- KillOnOverloadTimer.Start();
-
- //Task.Run(() => AcceptConnections(), _CancelToken);
-
- ThreadStart threadStart = new(AcceptConnections);
- MainThread = new(threadStart);
- MainThread.SetApartmentState(ApartmentState.STA);
- MainThread.Start();
-
- //Task.Run(() =>
- //{
- // Task.Run(() => AcceptConnections(), _CancelToken);
-
- // Terminator.Reset();
- // Terminator.WaitOne();
- //});
-
- }
-
- private void KillOnOverloadTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
- {
- CpuUsage = PFC.NextValue() / Environment.ProcessorCount;
- if (AllRequests >= _Settings.MaxThreads || CpuUsage > KillOnCpuUsage)
- {
- KillAll();
- }
- }
-
- ///
- /// Kill all active requests
- ///
- public void KillAll()
- {
- if (_TunnelManager != null)
- {
- var dic = _TunnelManager.GetTunnels();
- Debug.WriteLine(dic.Count);
- foreach (var item in dic)
- {
- Debug.WriteLine(item.Key);
- _TunnelManager.Remove(item.Key);
- }
- }
- }
-
- public void Stop()
- {
- if (IsRunning && _TcpListener != null && _CancelTokenSource != null)
- {
- IsRunning = false;
- //Terminator.Set();
- _CancelTokenSource.Cancel(true);
- Cancel = true;
- _TcpListener.Stop();
-
- KillAll();
-
- KillOnOverloadTimer.Stop();
-
- IsRunning = _TcpListener.Server.IsBound;
- Goodbye();
- }
- }
-
- public int ListeningPort
- {
- get => _Settings.ListenerPort;
- }
-
- public bool IsDpiActive
- {
- get => DPIBypassProgram.DPIBypassMode != Program.DPIBypass.Mode.Disable || StaticDPIBypassProgram.DPIBypassMode != Program.DPIBypass.Mode.Disable;
- }
-
- public int ActiveTunnels
- {
- get => _TunnelManager.Count;
- }
-
- public int AllRequests { get; private set; } = 0;
-
- public int MaxRequests
- {
- get => _Settings != null ? _Settings.MaxThreads : 0;
- }
-
- private void Welcome()
- {
- // Event
- string msgEvent = $"HTTP Proxy Server starting on {_Settings.ListenerIpAddress}:{_Settings.ListenerPort}";
- OnRequestReceived?.Invoke(msgEvent, EventArgs.Empty);
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
- }
-
- private void Goodbye()
- {
- // Event
- string msgEvent = "HTTP Proxy Server stopped.";
- OnRequestReceived?.Invoke(msgEvent, EventArgs.Empty);
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
- }
-
- private async void AcceptConnections()
- {
- if (Cancel) return;
-
- try
- {
- _TcpListener = new(_Settings.ListenerIpAddress, _Settings.ListenerPort);
- _TcpListener.Start();
- Task.Delay(200).Wait();
-
- if (_TcpListener != null)
- {
- IsRunning = _TcpListener.Server.IsBound;
-
- while (!Cancel)
- {
- TcpClient tcpClient = await _TcpListener.AcceptTcpClientAsync().ConfigureAwait(false);
- if (tcpClient.Connected) ProcessConnectionSync(tcpClient);
- if (_CancelToken.IsCancellationRequested || Cancel)
- break;
- }
- }
- else
- {
- IsRunning = false;
- }
- }
- catch (Exception eOuter)
- {
- // Event Error
- if (!_CancelToken.IsCancellationRequested || !Cancel)
- {
- string msgEventErr = $"Accept Connections: {eOuter.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- }
- }
- }
-
- private void ProcessConnectionSync(TcpClient tcpClient)
- {
- Task.Run(() => ProcessConnection(tcpClient));
- }
-
- private async void ProcessConnection(TcpClient client)
- {
- if (Cancel) return;
-
- AllRequests++;
-
- // Generate unique int
- int connectionId;
- try
- {
- connectionId = Guid.NewGuid().GetHashCode() + BitConverter.ToInt32(Guid.NewGuid().ToByteArray(), 0);
- }
- catch (Exception)
- {
- connectionId = Guid.NewGuid().GetHashCode();
- }
-
- Debug.WriteLine($"Active Requests: {AllRequests} of {_Settings.MaxThreads}");
-
- try
- {
- // Check if Max Exceeded
- if (AllRequests >= _Settings.MaxThreads || CpuUsage > KillOnCpuUsage)
- {
- // Event
- string msgEventErr = $"AcceptConnections Max Exceeded, {AllRequests} of {_Settings.MaxThreads} Requests. CPU: {CpuUsage} of {KillOnCpuUsage}.";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- Debug.WriteLine(msgEventErr);
-
- // Kill em
- try
- {
- client.Close();
- }
- catch (Exception)
- {
- // do nothing
- }
-
- if (AllRequests > 0) AllRequests--;
- return;
- }
-
- IPEndPoint? clientIpEndpoint = client.Client.RemoteEndPoint as IPEndPoint;
- IPEndPoint? serverIpEndpoint = client.Client.LocalEndPoint as IPEndPoint;
-
- string clientEndpoint = clientIpEndpoint != null ? clientIpEndpoint.ToString() : string.Empty;
- string serverEndpoint = serverIpEndpoint != null ? serverIpEndpoint.ToString() : string.Empty;
-
- string clientIp = clientIpEndpoint != null ? clientIpEndpoint.Address.ToString() : string.Empty;
- int clientPort = clientIpEndpoint != null ? clientIpEndpoint.Port : 0;
-
- string serverIp = serverIpEndpoint != null ? serverIpEndpoint.Address.ToString() : string.Empty;
- int serverPort = serverIpEndpoint != null ? serverIpEndpoint.Port : 0;
-
- Request? req = Request.FromTcpClient(client);
- if (req == null)
- {
- // Event Error
- string msgEventErr = $"{clientEndpoint} unable to build HTTP request.";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- return;
- }
-
- if (string.IsNullOrEmpty(req.DestHostname) || req.DestHostPort == 0)
- {
- // Event Error
- string msgEventErr = "Hostname is empty or Port is 0.";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- return;
- }
-
- if (req.Data != null && req.Data.Length < 1)
- {
- // Event Error
- string msgEventErr = "Data length is 0.";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- return;
- }
-
- req.SourceIp = clientIp;
- req.SourcePort = clientPort;
- req.DestIp = serverIp;
- req.DestPort = serverPort;
- req.TimeoutSec = RequestTimeoutSec;
-
- // Block Port 80
- if (BlockPort80 && req.DestHostPort == 80)
- {
- // Event
- string msgEvent = $"Block Port 80: {req.FullUrl}, request denied.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- return;
- }
-
- //// Block Built-in Black List
- for (int n = 0; n < BlackList.Count; n++)
- {
- string website = BlackList[n];
- string destWebsite = $"{req.DestHostname}:{req.DestHostPort}";
- if (destWebsite == website)
- {
- // Event
- string msgEvent = $"Black list: {req.FullUrl}, request denied.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- return;
- }
- }
-
- //// Black White List Program
- if (BWListProgram.ListMode != Program.BlackWhiteList.Mode.Disable)
- {
- bool isMatch = BWListProgram.IsMatch(req.DestHostname);
- if (isMatch)
- {
- // Event
- string msgEvent = $"Black White list: {req.FullUrl}, request denied.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- return;
- }
- }
-
- //// DontBypass Program
- req.ApplyDpiBypass = true;
- if (DontBypassProgram.DontBypassMode != Program.DontBypass.Mode.Disable)
- {
- bool isMatch = DontBypassProgram.IsMatch(req.DestHostname);
- if (isMatch) req.ApplyDpiBypass = false;
- }
-
- // Save Orig Hostname
- string origHostname = req.DestHostname;
-
- //// FakeDNS Program
- if (FakeDNSProgram.FakeDnsMode != Program.FakeDns.Mode.Disable)
- req.DestHostname = FakeDNSProgram.Get(req.DestHostname);
-
- //// DNS Program
- if (origHostname.Equals(req.DestHostname))
- {
- if (DNSProgram.DNSMode != Program.Dns.Mode.Disable)
- {
- string ipStr = await DNSProgram.Get(req.DestHostname);
- if (!ipStr.StartsWith("10.") && !ipStr.StartsWith("127.0.") && !ipStr.StartsWith("172.16.") && !ipStr.StartsWith("192.168."))
- req.DestHostname = ipStr;
- }
- }
-
- // Event
- string msgReqEvent = $"{origHostname}:{req.DestHostPort}";
- if (!origHostname.Equals(req.DestHostname))
- msgReqEvent = $"{origHostname}:{req.DestHostPort} => {req.DestHostname}";
-
- // Is Upstream Active
- bool isUpStreamProgramActive = UpStreamProxyProgram.UpStreamMode != Program.UpStreamProxy.Mode.Disable;
-
- // Check if Dest Host or IP is blocked
- bool isIp = IPAddress.TryParse(req.DestHostname, out IPAddress _);
- if (isIp)
- req.IsDestBlocked = await CommonTools.IsIpBlocked(req.DestHostname, req.DestHostPort, req.Method, 2000);
- else
- req.IsDestBlocked = await CommonTools.IsHostBlocked(req.DestHostname, req.DestHostPort, req.Method, 2000);
-
- if (req.IsDestBlocked && isIp)
- msgReqEvent += " (IP is blocked)";
- if (req.IsDestBlocked && !isIp)
- msgReqEvent += " (Host is blocked)";
-
- // Apply upstream?
- bool applyUpStreamProxy = false;
- if ((isUpStreamProgramActive && !UpStreamProxyProgram.OnlyApplyToBlockedIps) ||
- (isUpStreamProgramActive && UpStreamProxyProgram.OnlyApplyToBlockedIps && req.IsDestBlocked))
- applyUpStreamProxy = true;
-
- if (applyUpStreamProxy)
- msgReqEvent += " (Bypassing through Upstream Proxy)";
-
- //Debug.WriteLine(msgReqEvent);
- OnRequestReceived?.Invoke(msgReqEvent, EventArgs.Empty);
-
- // Not a good idea
- //if (req.IsDestBlocked && !applyUpStreamProxy)
- //{
- // if (client.Connected) client.Close();
- // if (AllRequests > 0) AllRequests--;
- // return;
- //}
-
- // Begin Connect
- if (req.Method == HttpMethod.Post)
- {
- // Event
- string msgEvent = $"{clientEndpoint} proxying request via CONNECT to {req.FullUrl}";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- ConnectHttpsRequest(connectionId, client, req, applyUpStreamProxy);
- //await ConnectHttpsRequest(connectionId, client, req, applyUpStreamProxy);
- }
- else
- {
- // Event
- string msgEvent = $"{clientEndpoint} proxying request to {req.FullUrl}";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- ConnectHttpRequestAsync(req, client);
- //await ConnectHttpRequestAsync(req, client);
- }
-
- //if (client.Connected) client.Close();
- //if (AllRequests > 0) AllRequests--;
- }
- catch (IOException)
- {
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- }
- catch (Exception ex)
- {
- // Event Error
- string msgEventErr = $"Process Connection: {ex.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
-
- if (client.Connected) client.Close();
- if (AllRequests > 0) AllRequests--;
- }
- }
-
- //======================================== Connect HTTPS Request
-
- private async void ConnectHttpsRequest(int connectionId, TcpClient client, Request req, bool applyUpStreamProxy = false)
- {
- if (Cancel) return;
- if (client.Client == null) return;
-
- TcpClient server = new();
-
- try
- {
- client.NoDelay = true;
- client.Client.NoDelay = true;
-
- try
- {
- if (!string.IsNullOrEmpty(req.DestHostname))
- {
- if (applyUpStreamProxy)
- {
- TcpClient? proxifiedTcpClient = UpStreamProxyProgram.Connect(req.DestHostname, req.DestHostPort);
- if (proxifiedTcpClient != null)
- {
- server = proxifiedTcpClient;
- }
- else
- {
- // Event Error
- string msgEventErr = $"Couldn't connect to upstream proxy.";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
-
- server.Connect(req.DestHostname, req.DestHostPort);
- }
- }
- else
- {
- server.Connect(req.DestHostname, req.DestHostPort);
- }
- }
- else
- {
- // Event Error
- string msgEventErr = $"Hostname was null or empty.";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- disposeIt();
- return;
- }
- }
- catch (Exception)
- {
- // Event Error
- string msgEventErr = $"Connect Request failed to {req.DestHostname}:{req.DestHostPort}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- disposeIt();
- return;
- }
-
- server.NoDelay = true;
- server.Client.NoDelay = true;
-
- byte[] connectResponse = ConnectResponse();
- static byte[] ConnectResponse()
- {
- string resp = "HTTP/1.1 200 Connection Established\r\nConnection: close\r\n\r\n";
- return Encoding.UTF8.GetBytes(resp);
- }
- if (client.Client == null)
- {
- disposeIt();
- return;
- }
- client.Client.Send(connectResponse);
-
- if (string.IsNullOrEmpty(req.SourceIp) || string.IsNullOrEmpty(req.DestIp))
- {
- // Event Error
- string msgEventErr = $"Source or dest IP were null or empty. SourceIp: {req.SourceIp} DestIp: {req.DestIp}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- disposeIt();
- return;
- }
-
- // Create Tunnel
- Tunnel currentTunnel = new(req, client, server);
-
- currentTunnel.EnableDPIBypass(DPIBypassProgram);
-
- // Tunnel Event OnDebugInfoReceived
- currentTunnel.OnDebugInfoReceived -= CurrentTunnel_OnDebugInfoReceived;
- currentTunnel.OnDebugInfoReceived += CurrentTunnel_OnDebugInfoReceived;
- void CurrentTunnel_OnDebugInfoReceived(object? sender, EventArgs e)
- {
- if (sender is string debugInfo)
- OnDebugInfoReceived?.Invoke(debugInfo, EventArgs.Empty);
- }
-
- // Tunnel Event OnErrorOccurred
- currentTunnel.OnErrorOccurred -= CurrentTunnel_OnErrorOccurred;
- currentTunnel.OnErrorOccurred += CurrentTunnel_OnErrorOccurred;
- void CurrentTunnel_OnErrorOccurred(object? sender, EventArgs e)
- {
- if (sender is string error)
- OnErrorOccurred?.Invoke(error, EventArgs.Empty);
- }
-
- if (_TunnelManager != null)
- _TunnelManager.Add(connectionId, currentTunnel);
-
- while (currentTunnel.IsActive())
- {
- await Task.Delay(100);
- }
- }
- catch (SocketException)
- {
- disposeIt();
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"Connect Request: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- disposeIt();
- }
- finally
- {
- disposeIt();
- }
-
- void disposeIt()
- {
- if (_TunnelManager != null) _TunnelManager.Remove(connectionId);
- if (client != null) client.Dispose();
- if (server != null) server.Dispose();
- if (AllRequests > 0) AllRequests--;
- }
- }
-
- //======================================== Connect HTTP Request
-
- private async void ConnectHttpRequestAsync(Request req, TcpClient client)
- {
- if (Cancel) return;
-
- RestResponse? resp = await proxyRequest(req);
- if (resp != null)
- {
- NetworkStream ns = client.GetStream();
- await sendRestResponse(resp, ns);
- await ns.FlushAsync();
- ns.Close();
-
- if (client != null) client.Dispose();
- if (AllRequests > 0) AllRequests--;
- }
-
- async Task proxyRequest(Request request)
- {
- if (Cancel) return null;
-
- try
- {
- if (request.Headers != null)
- {
- string foundVal = string.Empty;
-
- foreach (KeyValuePair currKvp in request.Headers)
- {
- if (string.IsNullOrEmpty(currKvp.Key)) continue;
- if (currKvp.Key.ToLower().Equals("expect"))
- {
- foundVal = currKvp.Key;
- break;
- }
- }
-
- if (!string.IsNullOrEmpty(foundVal)) request.Headers.Remove(foundVal);
- }
-
- if (string.IsNullOrEmpty(request.FullUrl))
- {
- // Evemt Error
- string msgEventErr = $"Full Url was null or empty. FullUrl: {request.FullUrl}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- return null;
- }
-
- //(HttpMethod)(Enum.Parse(typeof(RestWrapper.HttpMethod), request.Method.ToString())),
- RestRequest rRequest = new(
- request.FullUrl,
- request.Method,
- request.Headers,
- request.ContentType);
-
- if (request.ContentLength > 0)
- {
- return await rRequest.SendAsync(request.ContentLength, request.DataStream);
- }
- else
- {
- return await rRequest.SendAsync();
- }
- }
- catch (Exception e)
- {
- // Evemt Error
- string msgEventErr = $"{e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- return null;
- }
- }
-
- async Task sendRestResponse(RestResponse resp, NetworkStream ns)
- {
- if (Cancel) return;
-
- try
- {
- byte[]? ret = Array.Empty();
- string statusLine = resp.ProtocolVersion + " " + resp.StatusCode + " " + resp.StatusDescription + "\r\n";
- ret = CommonTools.AppendBytes(ret, Encoding.UTF8.GetBytes(statusLine));
-
- if (!string.IsNullOrEmpty(resp.ContentType))
- {
- string contentTypeLine = "Content-Type: " + resp.ContentType + "\r\n";
- ret = CommonTools.AppendBytes(ret, Encoding.UTF8.GetBytes(contentTypeLine));
- }
-
- if (resp.ContentLength > 0)
- {
- string contentLenLine = "Content-Length: " + resp.ContentLength + "\r\n";
- ret = CommonTools.AppendBytes(ret, Encoding.UTF8.GetBytes(contentLenLine));
- }
-
- if (resp.Headers != null && resp.Headers.Count > 0)
- {
- foreach (KeyValuePair currHeader in resp.Headers)
- {
- if (string.IsNullOrEmpty(currHeader.Key)) continue;
- if (currHeader.Key.ToLower().Trim().Equals("content-type")) continue;
- if (currHeader.Key.ToLower().Trim().Equals("content-length")) continue;
-
- string headerLine = currHeader.Key + ": " + currHeader.Value + "\r\n";
- ret = CommonTools.AppendBytes(ret, Encoding.UTF8.GetBytes(headerLine));
- }
- }
-
- ret = CommonTools.AppendBytes(ret, Encoding.UTF8.GetBytes("\r\n"));
-
- await ns.WriteAsync(ret);
- await ns.FlushAsync();
-
- if (resp.Data != null && resp.ContentLength > 0)
- {
- long bytesRemaining = resp.ContentLength;
- byte[] buffer = new byte[65536];
-
- while (bytesRemaining > 0)
- {
- int bytesRead = await resp.Data.ReadAsync(buffer);
- if (bytesRead > 0)
- {
- bytesRemaining -= bytesRead;
- await ns.WriteAsync(buffer.AsMemory(0, bytesRead));
- await ns.FlushAsync();
- }
- }
- }
-
- return;
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"Send Rest Response: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- return;
- }
- }
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/HTTPProxyServerProgram.cs b/MsmhTools/MsmhTools/HTTPProxyServer/HTTPProxyServerProgram.cs
deleted file mode 100644
index 82f4173..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/HTTPProxyServerProgram.cs
+++ /dev/null
@@ -1,598 +0,0 @@
-using MsmhTools.DnsTool;
-using MsmhTools.ProxifiedTcpClient;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Net.Sockets;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools.HTTPProxyServer
-{
- public partial class HTTPProxyServer
- {
- public partial class Program
- {
- //======================================= UpStream Proxy Support
- public class UpStreamProxy
- {
- public enum Mode
- {
- HTTP,
- SOCKS5,
- Disable
- }
-
- public Mode UpStreamMode { get; private set; } = Mode.Disable;
- public string? ProxyHost { get; private set; }
- public int ProxyPort { get; private set; }
- public string? ProxyUsername { get; private set; }
- public string? ProxyPassword { get; private set; }
- public bool OnlyApplyToBlockedIps { get; set; }
-
- public UpStreamProxy() { }
-
- public void Set(Mode mode, string proxyHost, int proxyPort, bool onlyApplyToBlockedIps)
- {
- //Set
- UpStreamMode = mode;
- ProxyHost = proxyHost;
- ProxyPort = proxyPort;
- OnlyApplyToBlockedIps = onlyApplyToBlockedIps;
- }
-
- public void Set(Mode mode, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, bool onlyApplyToBlockedIps)
- {
- //Set
- UpStreamMode = mode;
- ProxyHost = proxyHost;
- ProxyPort = proxyPort;
- ProxyUsername = proxyUsername;
- ProxyPassword = proxyPassword;
- OnlyApplyToBlockedIps = onlyApplyToBlockedIps;
- }
-
- ///
- /// Connect TcpClient through Proxy
- ///
- ///
- ///
- /// Returns null if cannot connect to proxy
- internal TcpClient? Connect(string destHostname, int destHostPort)
- {
- if (string.IsNullOrEmpty(ProxyHost)) return null;
-
- if (UpStreamMode == Mode.HTTP)
- {
- HttpProxyClient httpProxyClient = new(ProxyHost, ProxyPort, ProxyUsername, ProxyPassword);
- return httpProxyClient.CreateConnection(destHostname, destHostPort);
- }
- else if (UpStreamMode == Mode.SOCKS5)
- {
- Socks5ProxyClient socks5ProxyClient = new(ProxyHost, ProxyPort, ProxyUsername, ProxyPassword);
- return socks5ProxyClient.CreateConnection(destHostname, destHostPort);
- }
- else
- return null;
- }
- }
-
- //======================================= DNS Support
- public class Dns
- {
- public enum Mode
- {
- System,
- DoH,
- PlainDNS,
- Disable
- }
-
- public Mode DNSMode { get; private set; } = Mode.Disable;
- public string? DNS { get; private set; }
- public string? DnsCleanIp { get; private set; }
- public int Timeout { get; private set; } = 10;
- public bool ChangeCloudflareIP { get; set; } = false;
-
- ///
- /// Only for DoH Mode
- ///
- public string? ProxyScheme { get; private set; }
- public string? Host { get; protected set; }
- private string? CloudflareCleanIP { get; set; }
- private List CloudflareIPs { get; set; } = new();
-
- public Dns() { }
-
- public void Set(Mode mode, string? dns, string? dnsCleanIp, int timeoutSec, string? proxyScheme = null)
- {
- // Set
- DNSMode = mode;
- DNS = dns;
- DnsCleanIp = dnsCleanIp ?? string.Empty;
- Timeout = timeoutSec;
- ProxyScheme = proxyScheme;
-
- if (DNSMode == Mode.Disable) return;
- if (string.IsNullOrEmpty(dns)) return;
-
- // Get Host
- string host = dns;
- if (DNSMode == Mode.DoH)
- {
- if (host.StartsWith("https://")) host = host[8..];
- if (host.Contains('/'))
- {
- string[] split = host.Split('/');
- host = split[0];
- }
- }
- else if (DNSMode == Mode.PlainDNS)
- {
- if (host.Contains(':'))
- {
- string[] split = host.Split(':');
- host = split[0];
- }
- }
- Host = host;
- }
-
- ///
- /// Redirect all Cloudflare IPs to a clean IP
- ///
- /// CF Clean IP
- /// e.g. 103.21.244.0 - 103.21.244.255\n198.41.128.0 - 198.41.143.255
- public void SetCloudflareIPs(string cfCleanIP, string? cfIpRange = null)
- {
- if (!string.IsNullOrEmpty(cfIpRange))
- cfIpRange += Environment.NewLine;
- ChangeCloudflareIP = true;
- CloudflareCleanIP = cfCleanIP;
-
- // Built-in CF IPs
- string defaultCfIPs = "103.21.244.0 - 103.21.244.255\n";
- defaultCfIPs += "103.22.200.0 - 103.22.200.255\n";
- defaultCfIPs += "103.31.4.0 - 103.31.5.255\n";
- defaultCfIPs += "104.16.0.0 - 104.31.255.255\n";
- defaultCfIPs += "108.162.192.0 - 108.162.207.255\n";
- defaultCfIPs += "131.0.72.0 - 131.0.75.255\n";
- defaultCfIPs += "141.101.64.0 - 141.101.65.255\n";
- defaultCfIPs += "162.158.0.0 - 162.158.3.255\n";
- defaultCfIPs += "172.64.0.0 - 172.67.255.255\n";
- defaultCfIPs += "173.245.48.0 - 173.245.48.255\n";
- defaultCfIPs += "188.114.96.0 - 188.114.99.255\n";
- defaultCfIPs += "190.93.240.0 - 190.93.243.255\n";
- defaultCfIPs += "197.234.240.0 - 197.234.243.255\n";
- defaultCfIPs += "198.41.128.0 - 198.41.143.255";
-
- if (string.IsNullOrEmpty(cfIpRange) || string.IsNullOrWhiteSpace(cfIpRange))
- CloudflareIPs = defaultCfIPs.SplitToLines();
- else
- CloudflareIPs = cfIpRange.SplitToLines();
- }
-
- private bool IsCfIP(string ipString)
- {
- try
- {
- string[] ips = ipString.Split('.');
- int ip1 = int.Parse(ips[0]);
- int ip2 = int.Parse(ips[1]);
- int ip3 = int.Parse(ips[2]);
- int ip4 = int.Parse(ips[3]);
-
- for (int n = 0; n < CloudflareIPs.Count; n++)
- {
- string ipRange = CloudflareIPs[n].Trim();
-
- if (!string.IsNullOrEmpty(ipRange))
- {
- string[] split = ipRange.Split('-');
- string ipMin = split[0].Trim();
- string ipMax = split[1].Trim();
-
- string[] ipMins = ipMin.Split('.');
- int ipMin1 = int.Parse(ipMins[0]);
- int ipMin2 = int.Parse(ipMins[1]);
- int ipMin3 = int.Parse(ipMins[2]);
- int ipMin4 = int.Parse(ipMins[3]);
-
- string[] ipMaxs = ipMax.Split('.');
- int ipMax1 = int.Parse(ipMaxs[0]);
- int ipMax2 = int.Parse(ipMaxs[1]);
- int ipMax3 = int.Parse(ipMaxs[2]);
- int ipMax4 = int.Parse(ipMaxs[3]);
-
- if (ip1 >= ipMin1 && ip1 <= ipMax1)
- if (ip2 >= ipMin2 && ip2 <= ipMax2)
- if (ip3 >= ipMin3 && ip3 <= ipMax3)
- if (ip4 >= ipMin4 && ip4 <= ipMax4)
- return true;
- }
- }
- return false;
- }
- catch (Exception)
- {
- return false;
- }
- }
-
- internal async Task Get(string destHostname)
- {
- if (string.IsNullOrEmpty(destHostname)) return string.Empty;
-
- // Don't resolve current Dns to avoid loop
- if (destHostname.Equals(Host)) return destHostname;
- if (destHostname.Equals(DnsCleanIp)) return destHostname;
-
- // Get
- if (DNSMode == Mode.System)
- {
- string ipString = GetIP.GetIpFromSystem(destHostname, false);
- if (!ChangeCloudflareIP)
- return string.IsNullOrEmpty(ipString) ? destHostname : ipString;
- else
- {
- if (string.IsNullOrEmpty(ipString)) return destHostname;
- else
- {
- return IsCfIP(ipString) ? CloudflareCleanIP ?? ipString : ipString;
- }
- }
- }
- else if (DNSMode == Mode.DoH)
- {
- if (string.IsNullOrEmpty(DNS)) return string.Empty;
-
- string ipString = await GetIP.GetIpFromDoH(destHostname, DNS, Timeout, ProxyScheme);
- if (!ChangeCloudflareIP)
- return string.IsNullOrEmpty(ipString) ? destHostname : ipString;
- else
- {
- if (string.IsNullOrEmpty(ipString)) return destHostname;
- else
- {
- return IsCfIP(ipString) ? CloudflareCleanIP ?? ipString : ipString;
- }
- }
- }
- else if (DNSMode == Mode.PlainDNS)
- {
- if (string.IsNullOrEmpty(DNS)) return string.Empty;
-
- string plainDnsIP = DNS;
- int plainDnsPort = 53;
-
- if (DNS.Contains(':'))
- {
- string[] dnsIpPort = DNS.Split(':');
- plainDnsIP = dnsIpPort[0];
- plainDnsPort = int.Parse(dnsIpPort[1]);
- }
-
- string ipString = GetIP.GetIpFromPlainDNS(destHostname, plainDnsIP, plainDnsPort, Timeout);
- if (!ChangeCloudflareIP)
- return string.IsNullOrEmpty(ipString) ? destHostname : ipString;
- else
- {
- if (string.IsNullOrEmpty(ipString)) return destHostname;
- else
- {
- return IsCfIP(ipString) ? CloudflareCleanIP ?? ipString : ipString;
- }
- }
- }
- else if (DNSMode == Mode.Disable) return destHostname;
- else return destHostname;
- }
- }
-
- //======================================= Fake DNS Support
- public class FakeDns
- {
- public enum Mode
- {
- File,
- Text,
- Disable
- }
-
- public Mode FakeDnsMode { get; private set; } = Mode.Disable;
- public string TextContent { get; private set; } = string.Empty;
- private List HostIpList { get; set; } = new();
-
- public FakeDns() { }
-
- ///
- /// Set Fake DNS Database
- ///
- /// Mode
- /// e.g. Each line: dns.google.com|8.8.8.8
- public void Set(Mode mode, string filePathOrText)
- {
- FakeDnsMode = mode;
-
- if (FakeDnsMode == Mode.Disable) return;
-
- if (FakeDnsMode == Mode.File)
- {
- try
- {
- TextContent = File.ReadAllText(Path.GetFullPath(filePathOrText));
- }
- catch (Exception)
- {
- // do nothing
- }
- }
- else if (FakeDnsMode == Mode.Text)
- TextContent = filePathOrText;
-
- if (!string.IsNullOrEmpty(TextContent) || !string.IsNullOrWhiteSpace(TextContent))
- {
- TextContent += Environment.NewLine;
- HostIpList = TextContent.SplitToLines();
- }
- }
-
- internal string Get(string destHostname)
- {
- string destHostnameNoWWW = destHostname;
- if (destHostnameNoWWW.StartsWith("www."))
- destHostnameNoWWW = destHostnameNoWWW.Replace("www.", string.Empty);
-
- if (HostIpList.Any())
- {
- for (int n = 0; n < HostIpList.Count; n++)
- {
- string hostIP = HostIpList[n].Trim();
- if (!string.IsNullOrEmpty(hostIP))
- if (split(hostIP, out string destIP))
- return destIP;
- }
- }
-
- return destHostname;
-
- bool split(string hostIP, out string destIP)
- {
- // Add Support Comment //
- if (hostIP.StartsWith("//"))
- {
- destIP = destHostname; return false;
- }
- else
- {
- if (hostIP.Contains('|'))
- {
- string[] split = hostIP.Split('|');
- string host = split[0].Trim();
- if (host.StartsWith("www."))
- host = host.Replace("www.", string.Empty);
- string ip = split[1].Trim();
-
- if (!host.StartsWith("*."))
- {
- // No Wildcard
- if (destHostnameNoWWW.Equals(host))
- {
- destIP = ip; return true;
- }
- else
- {
- destIP = destHostname; return false;
- }
- }
- else
- {
- // Wildcard
- string destMainHost = string.Empty;
- string[] splitByDot = destHostnameNoWWW.Split('.');
-
- if (splitByDot.Length >= 3)
- {
- host = host[2..];
-
- for (int n = 1; n < splitByDot.Length; n++)
- destMainHost += $"{splitByDot[n]}.";
- if (destMainHost.EndsWith('.')) destMainHost = destMainHost[0..^1];
-
- if (destMainHost.Equals(host))
- {
- destIP = ip;
- return true;
- }
- else
- {
- destIP = destHostname; return false;
- }
- }
- else
- {
- destIP = destHostname; return false;
- }
- }
- }
- else
- {
- destIP = destHostname; return false;
- }
- }
- }
- }
- }
-
- //======================================= Black White List Support
- public class BlackWhiteList
- {
- public enum Mode
- {
- BlackListFile,
- BlackListText,
- WhiteListFile,
- WhiteListText,
- Disable
- }
-
- public Mode ListMode { get; private set; } = Mode.Disable;
- public string TextContent { get; private set; } = string.Empty;
- private List BWList { get; set; } = new();
-
- public BlackWhiteList() { }
-
- ///
- /// Set Black White List Database
- ///
- /// Mode
- /// e.g. Each line: google.com
- public void Set(Mode mode, string filePathOrText)
- {
- ListMode = mode;
-
- if (ListMode == Mode.Disable) return;
-
- if (ListMode == Mode.BlackListFile || ListMode == Mode.WhiteListFile)
- {
- try
- {
- TextContent = File.ReadAllText(Path.GetFullPath(filePathOrText));
- }
- catch (Exception)
- {
- // do nothing
- }
- }
- else if (ListMode == Mode.BlackListText || ListMode == Mode.WhiteListText)
- TextContent = filePathOrText;
-
- if (!string.IsNullOrEmpty(TextContent) || !string.IsNullOrWhiteSpace(TextContent))
- {
- TextContent += Environment.NewLine;
- BWList = TextContent.SplitToLines();
- }
- }
-
- // If True Return, If false Continue
- internal bool IsMatch(string destHostname)
- {
- string destHostnameNoWWW = destHostname;
- if (destHostnameNoWWW.StartsWith("www."))
- destHostnameNoWWW = destHostnameNoWWW.Replace("www.", string.Empty);
-
- if (BWList.Any())
- {
- for (int n = 0; n < BWList.Count; n++)
- {
- string host = BWList[n].Trim();
- if (!string.IsNullOrEmpty(host) && !host.StartsWith("//")) // Add Support Comment //
- {
- if (host.StartsWith("www."))
- host = host.Replace("www.", string.Empty);
-
- // If Match
- if (destHostnameNoWWW.Equals(host)) return match();
- }
- }
- }
-
- // If Not Match
- return notMatch();
-
- bool match()
- {
- return ListMode == Mode.BlackListFile || ListMode == Mode.BlackListText;
- }
-
- bool notMatch()
- {
- return ListMode == Mode.WhiteListFile || ListMode == Mode.WhiteListText;
- }
- }
- }
-
- public class DontBypass
- {
- public enum Mode
- {
- File,
- Text,
- Disable
- }
-
- public Mode DontBypassMode { get; private set; } = Mode.Disable;
- public string TextContent { get; private set; } = string.Empty;
- private List DontBypassList { get; set; } = new();
-
- public DontBypass() { }
-
- ///
- /// Set DontBypass Database
- ///
- /// Mode
- /// e.g. Each line: google.com
- public void Set(Mode mode, string filePathOrText)
- {
- DontBypassMode = mode;
-
- if (DontBypassMode == Mode.Disable) return;
-
- if (DontBypassMode == Mode.File)
- {
- try
- {
- TextContent = File.ReadAllText(Path.GetFullPath(filePathOrText));
- }
- catch (Exception)
- {
- // do nothing
- }
- }
- else if (DontBypassMode == Mode.Text)
- TextContent = filePathOrText;
-
- if (!string.IsNullOrEmpty(TextContent) || !string.IsNullOrWhiteSpace(TextContent))
- {
- TextContent += Environment.NewLine;
- DontBypassList = TextContent.SplitToLines();
- }
- }
-
- // If True Don't Bypass, If false Bypass
- internal bool IsMatch(string destHostname)
- {
- string destHostnameNoWWW = destHostname;
- if (destHostnameNoWWW.StartsWith("www."))
- destHostnameNoWWW = destHostnameNoWWW.Replace("www.", string.Empty);
-
- if (DontBypassList.Any())
- {
- for (int n = 0; n < DontBypassList.Count; n++)
- {
- string host = DontBypassList[n].Trim();
- if (!string.IsNullOrEmpty(host) && !host.StartsWith("//")) // Add Support Comment //
- {
- if (host.StartsWith("www."))
- host = host.Replace("www.", string.Empty);
-
- // If Match
- if (destHostnameNoWWW.Equals(host)) return true;
- }
- }
- }
-
- // If Not Match
- return false;
- }
-
- }
-
-
-
-
- }
- }
-
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/ParseHttpMethod.cs b/MsmhTools/MsmhTools/HTTPProxyServer/ParseHttpMethod.cs
deleted file mode 100644
index b54a0aa..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/ParseHttpMethod.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Runtime.Serialization;
-
-namespace MsmhTools.HTTPProxyServer
-{
- ///
- /// HTTP methods, i.e. GET, PUT, POST, DELETE, etc.
- ///
- public enum HttpMethodReq
- {
- [EnumMember(Value = "GET")]
- GET,
- [EnumMember(Value = "HEAD")]
- HEAD,
- [EnumMember(Value = "PUT")]
- PUT,
- [EnumMember(Value = "POST")]
- POST,
- [EnumMember(Value = "DELETE")]
- DELETE,
- [EnumMember(Value = "PATCH")]
- PATCH,
- [EnumMember(Value = "CONNECT")]
- CONNECT,
- [EnumMember(Value = "OPTIONS")]
- OPTIONS,
- [EnumMember(Value = "TRACE")]
- TRACE,
- [EnumMember(Value = "UNKNOWN")]
- UNKNOWN
- }
-
- public static class GetHttpMethod
- {
- public static HttpMethod Parse(string method)
- {
- method = method.Trim().ToLower();
- var httpMethod = method switch
- {
- "get" => HttpMethod.Get,
- "head" => HttpMethod.Head,
- "put" => HttpMethod.Put,
- "post" => HttpMethod.Post,
- "connect" => HttpMethod.Post,
- "delete" => HttpMethod.Delete,
- "patch" => HttpMethod.Patch,
- "options" => HttpMethod.Options,
- "trace" => HttpMethod.Trace,
- _ => HttpMethod.Get,
- };
- return httpMethod;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/Request.cs b/MsmhTools/MsmhTools/HTTPProxyServer/Request.cs
deleted file mode 100644
index a6136fd..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/Request.cs
+++ /dev/null
@@ -1,1317 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Net;
-using System.Net.Sockets;
-using System.Text;
-
-namespace MsmhTools.HTTPProxyServer
-{
- ///
- /// Data extracted from an incoming HTTP request.
- ///
- public class Request
- {
- ///
- /// UTC timestamp from when the request was received.
- ///
- public DateTime TimestampUtc { get; set; }
-
- ///
- /// Thread ID on which the request exists.
- ///
- public int ThreadId { get; set; }
-
- ///
- /// The protocol and version.
- ///
- public string? ProtocolVersion { get; set; }
-
- ///
- /// IP address of the requestor (client).
- ///
- public string? SourceIp { get; set; }
-
- ///
- /// TCP port from which the request originated on the requestor (client).
- ///
- public int SourcePort { get; set; }
-
- ///
- /// IP address of the recipient (server).
- ///
- public string? DestIp { get; set; }
-
- ///
- /// TCP port on which the request was received by the recipient (server).
- ///
- public int DestPort { get; set; }
-
- ///
- /// The destination hostname as found in the request line, if present.
- ///
- public string? DestHostname { get; set; }
-
- public bool IsDestBlocked { get; set; } = false;
-
- ///
- /// The destination host port as found in the request line, if present.
- ///
- public int DestHostPort { get; set; } = -1;
-
- ///
- /// Specifies whether or not the client requested HTTP keepalives.
- ///
- public bool Keepalive { get; set; }
-
- ///
- /// The HTTP method used in the request.
- ///
- public HttpMethod Method { get; set; } = HttpMethod.Get;
-
- ///
- /// The full URL as sent by the requestor (client).
- ///
- public string? FullUrl { get; set; }
-
- ///
- /// The raw (relative) URL with the querystring attached.
- ///
- public string? RawUrlWithQuery { get; set; }
-
- ///
- /// The raw (relative) URL without the querystring attached.
- ///
- public string? RawUrlWithoutQuery { get; set; }
-
- ///
- /// List of items found in the raw URL.
- ///
- public List? RawUrlEntries { get; set; }
-
- ///
- /// The querystring attached to the URL.
- ///
- public string? Querystring { get; set; }
-
- ///
- /// Dictionary containing key-value pairs from items found in the querystring.
- ///
- public Dictionary? QuerystringEntries { get; set; }
-
- ///
- /// The useragent specified in the request.
- ///
- public string? Useragent { get; set; }
-
- ///
- /// The number of bytes in the request body.
- ///
- public long ContentLength { get; set; }
-
- ///
- /// The content type as specified by the requestor (client).
- ///
- public string? ContentType { get; set; }
-
- ///
- /// The headers found in the request.
- ///
- public Dictionary? Headers { get; set; }
-
- ///
- /// The request body as sent by the requestor (client).
- ///
- public byte[]? Data { get; set; }
-
- ///
- /// The stream from which to read the request body sent by the requestor (client).
- ///
- public Stream? DataStream { get; set; }
-
- ///
- /// The request headers as sent by the requestor (client).
- ///
- public byte[]? HeadersData { get; set; }
-
- ///
- /// Apply DPI Bypass to this Request if DPI Bypass Program is available.
- ///
- public bool ApplyDpiBypass { get; set; } = false;
-
- ///
- /// The original HttpListenerContext from which the HttpRequest was constructed.
- ///
- public HttpListenerContext? ListenerContext { get; set; }
-
- ///
- /// Close request if didn't receive data for n seconds. Default: 0 Sec (Disabled)
- ///
- public int TimeoutSec { get; set; } = 0;
-
- private Uri? UriP { get; set; }
- private static readonly int _TimeoutDataReadMs = 2000;
- private static readonly int _DataReadSleepMs = 10;
-
- private ChunkDecoder DecoderP { get; set; } = new();
-
- ///
- /// Construct a new HTTP request.
- ///
- public Request()
- {
- ThreadId = Environment.CurrentManagedThreadId;
- TimestampUtc = DateTime.Now.ToUniversalTime();
- QuerystringEntries = new Dictionary();
- Headers = new Dictionary();
- }
-
- ///
- /// Construct a new HTTP request from a given HttpListenerContext.
- ///
- /// The HttpListenerContext for the request.
- /// Indicate whether or not the input stream should be read and converted to a byte array.
- public Request(HttpListenerContext ctx, bool readStreamFully)
- {
- // Check-for-Null-Values
- if (ctx == null) throw new ArgumentNullException(nameof(ctx));
- if (ctx.Request == null) throw new ArgumentNullException(nameof(ctx));
-
- // Parse-Variables
- int position = 0;
- int inQuery = 0;
- string tempString = "";
- string queryString = "";
-
- int inKey = 0;
- int inVal = 0;
- string tempKey = "";
- string tempVal = "";
-
- // Standard-Request-Items
- ThreadId = Environment.CurrentManagedThreadId;
- TimestampUtc = DateTime.Now.ToUniversalTime();
- ProtocolVersion = "HTTP/" + ctx.Request.ProtocolVersion.ToString();
- SourceIp = ctx.Request.RemoteEndPoint.Address.ToString();
- SourcePort = ctx.Request.RemoteEndPoint.Port;
- DestIp = ctx.Request.LocalEndPoint.Address.ToString();
- DestPort = ctx.Request.LocalEndPoint.Port;
- Method = (HttpMethod)Enum.Parse(typeof(HttpMethod), ctx.Request.HttpMethod, true);
- FullUrl = ctx.Request.Url != null ? new string(ctx.Request.Url.ToString().Trim()) : null;
- RawUrlWithQuery = ctx.Request.RawUrl != null ? new string(ctx.Request.RawUrl.ToString().Trim()) : null;
- RawUrlWithoutQuery = ctx.Request.RawUrl != null ? new string(ctx.Request.RawUrl.ToString().Trim()) : null;
- Keepalive = ctx.Request.KeepAlive;
- ContentLength = ctx.Request.ContentLength64;
- Useragent = ctx.Request.UserAgent;
- ContentType = ctx.Request.ContentType;
- ListenerContext = ctx;
-
- RawUrlEntries = new List();
- QuerystringEntries = new Dictionary();
- Headers = new Dictionary();
-
- // Raw-URL-and-Querystring
- if (!string.IsNullOrEmpty(RawUrlWithoutQuery))
- {
- // Initialize-Variables
- RawUrlEntries = new List();
- QuerystringEntries = new Dictionary();
-
- // Process-Raw-URL-and-Populate-Raw-URL-Elements
- while (RawUrlWithoutQuery.Contains("//"))
- {
- RawUrlWithoutQuery = RawUrlWithoutQuery.Replace("//", "/");
- }
-
- foreach (char c in RawUrlWithoutQuery)
- {
- if (inQuery == 1)
- {
- queryString += c;
- continue;
- }
-
- if ((position == 0) &&
- (string.Compare(tempString, "") == 0) &&
- (c == '/'))
- {
- // skip the first slash
- continue;
- }
-
- if ((c != '/') && (c != '?'))
- {
- tempString += c;
- }
-
- if ((c == '/') || (c == '?'))
- {
- if (!string.IsNullOrEmpty(tempString))
- {
- // add to raw URL entries list
- RawUrlEntries.Add(tempString);
- }
-
- position++;
- tempString = "";
- }
-
- if (c == '?')
- {
- inQuery = 1;
- }
- }
-
- if (!string.IsNullOrEmpty(tempString))
- {
- // add to raw URL entries list
- RawUrlEntries.Add(tempString);
- }
-
- // Populate-Querystring
- if (queryString.Length > 0) Querystring = queryString;
- else Querystring = null;
-
- // Parse-Querystring
- if (!string.IsNullOrEmpty(Querystring))
- {
- inKey = 1;
- inVal = 0;
- position = 0;
- tempKey = "";
- tempVal = "";
-
- foreach (char c in Querystring)
- {
- if (inKey == 1)
- {
- if (c == '&')
- {
- // key with no value
- if (!string.IsNullOrEmpty(tempKey))
- {
- inKey = 1;
- inVal = 0;
-
- tempKey = WebUtility.UrlDecode(tempKey);
- QuerystringEntries = CommonTools.AddToDict(tempKey, null, QuerystringEntries);
-
- tempKey = "";
- tempVal = "";
- position++;
- continue;
- }
- }
- else if (c != '=')
- {
- tempKey += c;
- }
- else
- {
- inKey = 0;
- inVal = 1;
- continue;
- }
- }
-
- if (inVal == 1)
- {
- if (c != '&')
- {
- tempVal += c;
- }
- else
- {
- inKey = 1;
- inVal = 0;
-
- tempKey = WebUtility.UrlDecode(tempKey);
- if (!string.IsNullOrEmpty(tempVal)) tempVal = WebUtility.UrlDecode(tempVal);
- QuerystringEntries = CommonTools.AddToDict(tempKey, tempVal, QuerystringEntries);
-
- tempKey = "";
- tempVal = "";
- position++;
- continue;
- }
- }
- }
-
- if (inVal == 0)
- {
- // val will be null
- if (!string.IsNullOrEmpty(tempKey))
- {
- tempKey = WebUtility.UrlDecode(tempKey);
- QuerystringEntries = CommonTools.AddToDict(tempKey, null, QuerystringEntries);
- }
- }
-
- if (inVal == 1)
- {
- if (!string.IsNullOrEmpty(tempKey))
- {
- tempKey = WebUtility.UrlDecode(tempKey);
- if (!string.IsNullOrEmpty(tempVal)) tempVal = WebUtility.UrlDecode(tempVal);
- QuerystringEntries = CommonTools.AddToDict(tempKey, tempVal, QuerystringEntries);
- }
- }
- }
- }
-
- // Remove-Querystring-from-Raw-URL
- if (RawUrlWithoutQuery != null && RawUrlWithoutQuery.Contains('?'))
- {
- RawUrlWithoutQuery = RawUrlWithoutQuery[..RawUrlWithoutQuery.IndexOf("?")];
- }
-
- // Check-for-Full-URL
- try
- {
- if (FullUrl != null)
- {
- UriP = new Uri(FullUrl);
- DestHostname = UriP.Host;
- DestHostPort = UriP.Port;
- }
- }
- catch (Exception)
- {
- // do nothing
- }
-
- // Headers
- Headers = new Dictionary();
- for (int i = 0; i < ctx.Request.Headers.Count; i++)
- {
- string key = new(ctx.Request.Headers.GetKey(i));
- string val = new(ctx.Request.Headers.Get(i));
- Headers = CommonTools.AddToDict(key, val, Headers);
- }
-
- // Payload
- bool chunkedXfer = false;
- bool gzip = false;
- bool deflate = false;
- string? xferEncodingHeader = RetrieveHeaderValue("Transfer-Encoding");
- if (!string.IsNullOrEmpty(xferEncodingHeader))
- {
- chunkedXfer = xferEncodingHeader.ToLower().Contains("chunked");
- gzip = xferEncodingHeader.ToLower().Contains("gzip");
- deflate = xferEncodingHeader.ToLower().Contains("deflate");
- }
-
- if (chunkedXfer
- && Method != HttpMethod.Get
- && Method != HttpMethod.Head)
- {
- Stream bodyStream = ctx.Request.InputStream;
-
- if (!readStreamFully)
- {
- MemoryStream ms = new();
-
- if (!DecoderP.Decode(bodyStream, out long contentLength, out ms))
- {
- throw new IOException("Unable to decode chunk-encoded stream");
- }
-
- ContentLength = contentLength;
- DataStream = ms;
- }
- else
- {
- byte[] encodedData = CommonTools.StreamToBytes(bodyStream);
-
- if (!DecoderP.Decode(encodedData, out byte[]? decodedData))
- {
- throw new IOException("Unable to decode chunk-encoded stream");
- }
-
- if (decodedData != null)
- {
- ContentLength = decodedData.Length;
- Data = new byte[ContentLength];
- Buffer.BlockCopy(decodedData, 0, Data, 0, decodedData.Length);
- }
- }
- }
- else if (ContentLength > 0)
- {
- if (readStreamFully)
- {
- if (Method != HttpMethod.Get && Method != HttpMethod.Head)
- {
- try
- {
- Data = new byte[ContentLength];
- Stream bodyStream = ctx.Request.InputStream;
- Data = CommonTools.StreamToBytes(bodyStream);
- }
- catch (Exception)
- {
- Data = null;
- }
- }
- }
- else
- {
- Data = null;
- DataStream = ctx.Request.InputStream;
- }
- }
- }
-
- ///
- /// Create an HttpRequest object from a TcpClient.
- ///
- /// TcpClient.
- /// A populated HttpRequest.
- public static Request? FromTcpClient(TcpClient client)
- {
- if (client == null) throw new ArgumentNullException(nameof(client));
-
- try
- {
- Request ret;
- byte[]? headerBytes = null;
- byte[] lastFourBytes = new byte[4];
- lastFourBytes[0] = 0x00;
- lastFourBytes[1] = 0x00;
- lastFourBytes[2] = 0x00;
- lastFourBytes[3] = 0x00;
-
- // Attach-Stream
- NetworkStream stream = client.GetStream();
-
- if (!stream.CanRead)
- {
- throw new IOException("Unable to read from stream.");
- }
-
- // Read-Headers
- using (MemoryStream headerMs = new())
- {
- // Read-Header-Bytes
- byte[] headerBuffer = new byte[1];
- int read = 0;
- int headerBytesRead = 0;
-
- while ((read = stream.Read(headerBuffer, 0, headerBuffer.Length)) > 0)
- {
- if (read > 0)
- {
- // Initialize-Header-Bytes-if-Needed
- headerBytesRead += read;
- if (headerBytes == null) headerBytes = new byte[1];
-
- // Update-Last-Four
- if (read == 1)
- {
- lastFourBytes[0] = lastFourBytes[1];
- lastFourBytes[1] = lastFourBytes[2];
- lastFourBytes[2] = lastFourBytes[3];
- lastFourBytes[3] = headerBuffer[0];
- }
-
- // Append-to-Header-Buffer
- byte[] tempHeader = new byte[headerBytes.Length + 1];
- Buffer.BlockCopy(headerBytes, 0, tempHeader, 0, headerBytes.Length);
- tempHeader[headerBytes.Length] = headerBuffer[0];
- headerBytes = tempHeader;
-
- // Check-for-End-of-Headers
- if ((int)(lastFourBytes[0]) == 13
- && (int)(lastFourBytes[1]) == 10
- && (int)(lastFourBytes[2]) == 13
- && (int)(lastFourBytes[3]) == 10)
- {
- break;
- }
- }
- }
- }
-
- // Process-Headers
- if (headerBytes == null || headerBytes.Length < 1)
- {
- //throw new IOException("No header data read from the stream.");
- return null;
- }
-
- ret = BuildHeaders(headerBytes);
- ret.HeadersData = headerBytes;
-
- // Read-Data
- ret.Data = null;
- if (ret.ContentLength > 0)
- {
- // Read-from-Stream
- ret.Data = new byte[ret.ContentLength];
-
- using (MemoryStream dataMs = new())
- {
- long bytesRemaining = ret.ContentLength;
- long bytesRead = 0;
- bool timeout = false;
- int currentTimeout = 0;
-
- int read = 0;
- byte[] buffer;
- long bufferSize = 2048;
- if (bufferSize > bytesRemaining) bufferSize = bytesRemaining;
- buffer = new byte[bufferSize];
-
- while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
- {
- if (read > 0)
- {
- dataMs.Write(buffer, 0, read);
- bytesRead += read;
- bytesRemaining -= read;
-
- // reduce buffer size if number of bytes remaining is
- // less than the pre-defined buffer size of 2KB
- if (bytesRemaining < bufferSize)
- {
- bufferSize = bytesRemaining;
- }
-
- buffer = new byte[bufferSize];
-
- // check if read fully
- if (bytesRemaining == 0) break;
- if (bytesRead == ret.ContentLength) break;
- }
- else
- {
- if (currentTimeout >= _TimeoutDataReadMs)
- {
- timeout = true;
- break;
- }
- else
- {
- currentTimeout += _DataReadSleepMs;
- Thread.Sleep(_DataReadSleepMs);
- }
- }
- }
-
- if (timeout)
- {
- throw new IOException("Timeout reading data from stream.");
- }
-
- ret.Data = dataMs.ToArray();
- }
-
- // Validate-Data
- if (ret.Data == null || ret.Data.Length < 1)
- {
- throw new IOException("Unable to read data from stream.");
- }
-
- if (ret.Data.Length != ret.ContentLength)
- {
- throw new IOException("Data read does not match specified content length.");
- }
- }
- else
- {
- // do nothing
- }
-
- return ret;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Create an HttpRequest object from a byte array.
- ///
- /// Byte data.
- /// A populated HttpRequest.
- public static Request FromBytes(byte[] bytes)
- {
- if (bytes == null) throw new ArgumentNullException(nameof(bytes));
- if (bytes.Length < 4) throw new ArgumentException("Too few bytes supplied to form a valid HTTP request.");
-
- bool endOfHeader = false;
- byte[] headerBytes = new byte[1];
-
- Request ret = new();
-
- for (int i = 0; i < bytes.Length; i++)
- {
- if (headerBytes.Length == 1)
- {
- // First-Byte
- headerBytes[0] = bytes[i];
- continue;
- }
-
- if (!endOfHeader && headerBytes.Length < 4)
- {
- // Fewer-Than-Four-Bytes
- byte[] tempHeader = new byte[i + 1];
- Buffer.BlockCopy(headerBytes, 0, tempHeader, 0, headerBytes.Length);
- tempHeader[i] = bytes[i];
- headerBytes = tempHeader;
- continue;
- }
-
- if (!endOfHeader)
- {
- // Check-for-End-of-Header
- // check if end of headers reached
- if (
- (int)headerBytes[(^1)] == 10
- && (int)headerBytes[(^2)] == 13
- && (int)headerBytes[(^3)] == 10
- && (int)headerBytes[(^4)] == 13
- )
- {
- // End-of-Header
- // end of headers reached
- endOfHeader = true;
- ret = BuildHeaders(headerBytes);
- }
- else
- {
- // Still-Reading-Header
- byte[] tempHeader = new byte[i + 1];
- Buffer.BlockCopy(headerBytes, 0, tempHeader, 0, headerBytes.Length);
- tempHeader[i] = bytes[i];
- headerBytes = tempHeader;
- continue;
- }
- }
- else
- {
- if (ret.ContentLength > 0)
- {
- // Append-Data
- if (ret.ContentLength != (bytes.Length - i))
- {
- throw new ArgumentException("Content-Length header does not match the number of data bytes.");
- }
-
- ret.Data = new byte[ret.ContentLength];
- Buffer.BlockCopy(bytes, i, ret.Data, 0, (int)ret.ContentLength);
- break;
- }
- else
- {
- // No-Data
- ret.Data = null;
- break;
- }
- }
- }
-
- return ret;
- }
-
- ///
- /// Create an HttpRequest object from a Stream.
- ///
- /// Stream.
- /// A populated HttpRequest.
- public static Request FromStream(Stream stream)
- {
- if (stream == null) throw new ArgumentNullException(nameof(stream));
-
- try
- {
- Request ret;
- byte[]? headerBytes = null;
- byte[] lastFourBytes = new byte[4];
- lastFourBytes[0] = 0x00;
- lastFourBytes[1] = 0x00;
- lastFourBytes[2] = 0x00;
- lastFourBytes[3] = 0x00;
-
- // Check-Stream
- if (!stream.CanRead)
- {
- throw new IOException("Unable to read from stream.");
- }
-
- // Read-Headers
- using (MemoryStream headerMs = new())
- {
- // Read-Header-Bytes
- byte[] headerBuffer = new byte[1];
- int read = 0;
- int headerBytesRead = 0;
-
- while ((read = stream.Read(headerBuffer, 0, headerBuffer.Length)) > 0)
- {
- if (read > 0)
- {
- // Initialize-Header-Bytes-if-Needed
- headerBytesRead += read;
- if (headerBytes == null) headerBytes = new byte[1];
-
- //Update-Last-Four
- if (read == 1)
- {
- lastFourBytes[0] = lastFourBytes[1];
- lastFourBytes[1] = lastFourBytes[2];
- lastFourBytes[2] = lastFourBytes[3];
- lastFourBytes[3] = headerBuffer[0];
- }
-
- // Append-to-Header-Buffer
- byte[] tempHeader = new byte[headerBytes.Length + 1];
- Buffer.BlockCopy(headerBytes, 0, tempHeader, 0, headerBytes.Length);
- tempHeader[headerBytes.Length] = headerBuffer[0];
- headerBytes = tempHeader;
-
- // Check-for-End-of-Headers
- if ((int)(lastFourBytes[0]) == 13
- && (int)(lastFourBytes[1]) == 10
- && (int)(lastFourBytes[2]) == 13
- && (int)(lastFourBytes[3]) == 10)
- {
- break;
- }
- }
- }
- }
-
- // Process-Headers
- if (headerBytes == null || headerBytes.Length < 1) throw new IOException("No header data read from the stream.");
- ret = BuildHeaders(headerBytes);
-
- // Read-Data
- ret.Data = null;
- if (ret.ContentLength > 0)
- {
- // Read-from-Stream
- ret.Data = new byte[ret.ContentLength];
-
- using (MemoryStream dataMs = new())
- {
- long bytesRemaining = ret.ContentLength;
- long bytesRead = 0;
- bool timeout = false;
- int currentTimeout = 0;
-
- int read = 0;
- byte[] buffer;
- long bufferSize = 2048;
- if (bufferSize > bytesRemaining) bufferSize = bytesRemaining;
- buffer = new byte[bufferSize];
-
- while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
- {
- if (read > 0)
- {
- dataMs.Write(buffer, 0, read);
- bytesRead += read;
- bytesRemaining -= read;
-
- // reduce buffer size if number of bytes remaining is
- // less than the pre-defined buffer size of 2KB
- if (bytesRemaining < bufferSize)
- {
- bufferSize = bytesRemaining;
- }
-
- buffer = new byte[bufferSize];
-
- // check if read fully
- if (bytesRemaining == 0) break;
- if (bytesRead == ret.ContentLength) break;
- }
- else
- {
- if (currentTimeout >= _TimeoutDataReadMs)
- {
- timeout = true;
- break;
- }
- else
- {
- currentTimeout += _DataReadSleepMs;
- Thread.Sleep(_DataReadSleepMs);
- }
- }
- }
-
- if (timeout)
- {
- throw new IOException("Timeout reading data from stream.");
- }
-
- ret.Data = dataMs.ToArray();
- }
-
- // Validate-Data
- if (ret.Data == null || ret.Data.Length < 1)
- {
- throw new IOException("Unable to read data from stream.");
- }
-
- if (ret.Data.Length != ret.ContentLength)
- {
- throw new IOException("Data read does not match specified content length.");
- }
- }
- else
- {
- // do nothing
- }
-
- return ret;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- ///
- /// Create an HttpRequest object from a NetworkStream.
- ///
- /// NetworkStream.
- /// A populated HttpRequest.
- public static Request FromStream(NetworkStream stream)
- {
- if (stream == null) throw new ArgumentNullException(nameof(stream));
-
- try
- {
- Request ret;
- byte[]? headerBytes = null;
- byte[] lastFourBytes = new byte[4];
- lastFourBytes[0] = 0x00;
- lastFourBytes[1] = 0x00;
- lastFourBytes[2] = 0x00;
- lastFourBytes[3] = 0x00;
-
- // Check-Stream
- if (!stream.CanRead)
- {
- throw new IOException("Unable to read from stream.");
- }
-
- // Read-Headers
- using (MemoryStream headerMs = new())
- {
- // Read-Header-Bytes
- byte[] headerBuffer = new byte[1];
- int read = 0;
- int headerBytesRead = 0;
-
- while ((read = stream.Read(headerBuffer, 0, headerBuffer.Length)) > 0)
- {
- if (read > 0)
- {
- // Initialize-Header-Bytes-if-Needed
- headerBytesRead += read;
- if (headerBytes == null) headerBytes = new byte[1];
-
- // Update-Last-Four
- if (read == 1)
- {
- lastFourBytes[0] = lastFourBytes[1];
- lastFourBytes[1] = lastFourBytes[2];
- lastFourBytes[2] = lastFourBytes[3];
- lastFourBytes[3] = headerBuffer[0];
- }
-
- // Append-to-Header-Buffer
- byte[] tempHeader = new byte[headerBytes.Length + 1];
- Buffer.BlockCopy(headerBytes, 0, tempHeader, 0, headerBytes.Length);
- tempHeader[headerBytes.Length] = headerBuffer[0];
- headerBytes = tempHeader;
-
- // Check-for-End-of-Headers
- if ((int)(lastFourBytes[0]) == 13
- && (int)(lastFourBytes[1]) == 10
- && (int)(lastFourBytes[2]) == 13
- && (int)(lastFourBytes[3]) == 10)
- {
- break;
- }
- }
- }
- }
-
- // Process-Headers
- if (headerBytes == null || headerBytes.Length < 1) throw new IOException("No header data read from the stream.");
- ret = BuildHeaders(headerBytes);
-
- // Read-Data
- ret.Data = null;
- if (ret.ContentLength > 0)
- {
- // Read-from-Stream
- ret.Data = new byte[ret.ContentLength];
-
- using (MemoryStream dataMs = new())
- {
- long bytesRemaining = ret.ContentLength;
- long bytesRead = 0;
- bool timeout = false;
- int currentTimeout = 0;
-
- int read = 0;
- byte[] buffer;
- long bufferSize = 2048;
- if (bufferSize > bytesRemaining) bufferSize = bytesRemaining;
- buffer = new byte[bufferSize];
-
- while ((read = stream.Read(buffer, 0, buffer.Length)) > 0)
- {
- if (read > 0)
- {
- dataMs.Write(buffer, 0, read);
- bytesRead += read;
- bytesRemaining -= read;
-
- // reduce buffer size if number of bytes remaining is
- // less than the pre-defined buffer size of 2KB
- if (bytesRemaining < bufferSize)
- {
- bufferSize = bytesRemaining;
- }
-
- buffer = new byte[bufferSize];
-
- // check if read fully
- if (bytesRemaining == 0) break;
- if (bytesRead == ret.ContentLength) break;
- }
- else
- {
- if (currentTimeout >= _TimeoutDataReadMs)
- {
- timeout = true;
- break;
- }
- else
- {
- currentTimeout += _DataReadSleepMs;
- Thread.Sleep(_DataReadSleepMs);
- }
- }
- }
-
- if (timeout)
- {
- throw new IOException("Timeout reading data from stream.");
- }
-
- ret.Data = dataMs.ToArray();
- }
-
- // Validate-Data
- if (ret.Data == null || ret.Data.Length < 1)
- {
- throw new IOException("Unable to read data from stream.");
- }
-
- if (ret.Data.Length != ret.ContentLength)
- {
- throw new IOException("Data read does not match specified content length.");
- }
- }
- else
- {
- // do nothing
- }
-
- return ret;
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- //==================================================== Methods Public
-
- ///
- /// Retrieve a specified header value from either the headers or the querystring.
- ///
- ///
- ///
- public string? RetrieveHeaderValue(string key)
- {
- if (string.IsNullOrEmpty(key)) throw new ArgumentNullException(nameof(key));
- if (Headers != null && Headers.Count > 0)
- {
- foreach (KeyValuePair curr in Headers)
- {
- if (string.IsNullOrEmpty(curr.Key)) continue;
- if (string.Compare(curr.Key.ToLower(), key.ToLower()) == 0) return curr.Value;
- }
- }
-
- if (QuerystringEntries != null && QuerystringEntries.Count > 0)
- {
- foreach (KeyValuePair curr in QuerystringEntries)
- {
- if (string.IsNullOrEmpty(curr.Key)) continue;
- if (string.Compare(curr.Key.ToLower(), key.ToLower()) == 0) return curr.Value;
- }
- }
-
- return null;
- }
-
- ///
- /// Retrieve the integer value of the last raw URL element, if found.
- ///
- /// A nullable integer.
- public int? RetrieveIdValue()
- {
- if (RawUrlEntries == null || RawUrlEntries.Count < 1) return null;
- string[] entries = RawUrlEntries.ToArray();
- int len = entries.Length;
- string entry = entries[(len - 1)];
- if (int.TryParse(entry, out int ret))
- {
- return ret;
- }
- return null;
- }
-
- //==================================================== Methods Private
-
- private static Request BuildHeaders(byte[] bytes)
- {
- if (bytes == null) throw new ArgumentNullException(nameof(bytes));
-
- // Initial-Values
- Request ret = new();
- ret.TimestampUtc = DateTime.Now.ToUniversalTime();
- ret.ThreadId = Environment.CurrentManagedThreadId;
- ret.SourceIp = "unknown";
- ret.SourcePort = 0;
- ret.DestIp = "unknown";
- ret.DestPort = 0;
- ret.Headers = new Dictionary();
-
- // Convert-to-String-List
- string str = Encoding.UTF8.GetString(bytes);
- string[] headers = str.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries);
-
- // Process-Each-Line
- for (int i = 0; i < headers.Length; i++)
- {
- if (i == 0)
- {
- // First-Line
- string[] requestLine = headers[i].Trim().Trim('\0').Split(' ');
- if (requestLine.Length < 3) throw new ArgumentException("Request line does not contain at least three parts (method, raw URL, protocol/version).");
-
- // (HttpMethod)Enum.Parse(typeof(HttpMethod), requestLine[0], true);
- ret.Method = GetHttpMethod.Parse(requestLine[0]);
- ret.FullUrl = requestLine[1];
- ret.ProtocolVersion = requestLine[2];
- ret.RawUrlWithQuery = ret.FullUrl;
- ret.RawUrlWithoutQuery = ExtractRawUrlWithoutQuery(ret.RawUrlWithQuery);
- ret.RawUrlEntries = ExtractRawUrlEntries(ret.RawUrlWithoutQuery);
- ret.Querystring = ExtractQuerystring(ret.RawUrlWithQuery);
- ret.QuerystringEntries = ExtractQuerystringEntries(ret.Querystring);
-
- try
- {
- string ipPort = ret.FullUrl;
- if (!ipPort.ToLower().StartsWith("http://") && !ipPort.ToLower().StartsWith("https://"))
- {
- Uri tempUri = new($"https://{ret.FullUrl}");
- if (tempUri.Port == 80)
- ret.FullUrl = $"http://{ret.FullUrl}";
- else
- ret.FullUrl = $"https://{ret.FullUrl}";
- }
- Uri uri = new(ret.FullUrl);
- ret.DestHostname = uri.Host;
- ret.DestHostPort = uri.Port;
- }
- catch (Exception)
- {
-
- }
-
- if (string.IsNullOrEmpty(ret.DestHostname))
- {
- if (!ret.FullUrl.Contains("://") & ret.FullUrl.Contains(':'))
- {
- string[] hostAndPort = ret.FullUrl.Split(':');
- if (hostAndPort.Length == 2)
- {
- ret.DestHostname = hostAndPort[0];
- bool isInt = int.TryParse(hostAndPort[1], out int port);
- if (isInt)
- ret.DestHostPort = port;
- else
- {
- Debug.WriteLine("Unable to parse destination hostname and port.");
- }
- }
- }
- }
- }
- else
- {
- // Subsequent-Line
- string[] headerLine = headers[i].Split(':');
- if (headerLine.Length == 2)
- {
- string key = headerLine[0].Trim();
- string val = headerLine[1].Trim();
-
- if (string.IsNullOrEmpty(key)) continue;
- string keyEval = key.ToLower();
-
- if (keyEval.Equals("keep-alive"))
- ret.Keepalive = Convert.ToBoolean(val);
- else if (keyEval.Equals("user-agent"))
- ret.Useragent = val;
- else if (keyEval.Equals("content-length"))
- ret.ContentLength = Convert.ToInt64(val);
- else if (keyEval.Equals("content-type"))
- ret.ContentType = val;
- else
- ret.Headers = CommonTools.AddToDict(key, val, ret.Headers);
- }
-
- }
- }
-
- return ret;
- }
-
- private static string? ExtractRawUrlWithoutQuery(string rawUrlWithQuery)
- {
- if (string.IsNullOrEmpty(rawUrlWithQuery)) return null;
- if (!rawUrlWithQuery.Contains('?')) return rawUrlWithQuery;
- return rawUrlWithQuery[..rawUrlWithQuery.IndexOf("?")];
- }
-
- private static List? ExtractRawUrlEntries(string? rawUrlWithoutQuery)
- {
- if (string.IsNullOrEmpty(rawUrlWithoutQuery)) return null;
-
- int position = 0;
- string tempString = "";
- List ret = new();
-
- foreach (char c in rawUrlWithoutQuery)
- {
- if ((position == 0) &&
- (string.Compare(tempString, "") == 0) &&
- (c == '/'))
- {
- // skip the first slash
- continue;
- }
-
- if ((c != '/') && (c != '?'))
- {
- tempString += c;
- }
-
- if ((c == '/') || (c == '?'))
- {
- if (!string.IsNullOrEmpty(tempString))
- {
- // add to raw URL entries list
- ret.Add(tempString);
- }
-
- position++;
- tempString = "";
- }
- }
-
- if (!string.IsNullOrEmpty(tempString))
- {
- // add to raw URL entries list
- ret.Add(tempString);
- }
-
- return ret;
- }
-
- private static string? ExtractQuerystring(string rawUrlWithQuery)
- {
- if (string.IsNullOrEmpty(rawUrlWithQuery)) return null;
- if (!rawUrlWithQuery.Contains('?')) return null;
-
- int qsStartPos = rawUrlWithQuery.IndexOf("?");
- if (qsStartPos >= (rawUrlWithQuery.Length - 1)) return null;
- return rawUrlWithQuery[(qsStartPos + 1)..];
- }
-
- private static Dictionary? ExtractQuerystringEntries(string? query)
- {
- if (string.IsNullOrEmpty(query)) return null;
-
- Dictionary ret = new();
-
- int inKey = 1;
- int inVal = 0;
- int position = 0;
- string tempKey = "";
- string tempVal = "";
-
- for (int i = 0; i < query.Length; i++)
- {
- char c = query[i];
- if (inKey == 1)
- {
- if (c != '=')
- {
- tempKey += c;
- }
- else
- {
- inKey = 0;
- inVal = 1;
- continue;
- }
- }
-
- if (inVal == 1)
- {
- if (c != '&')
- {
- tempVal += c;
- }
- else
- {
- inKey = 1;
- inVal = 0;
-
- if (!string.IsNullOrEmpty(tempVal)) tempVal = WebUtility.UrlEncode(tempVal);
- ret = CommonTools.AddToDict(tempKey, tempVal, ret);
-
- tempKey = "";
- tempVal = "";
- position++;
- continue;
- }
- }
-
- if (inVal == 1)
- {
- if (!string.IsNullOrEmpty(tempVal)) tempVal = WebUtility.UrlEncode(tempVal);
- ret = CommonTools.AddToDict(tempKey, tempVal, ret);
- }
- }
-
- return ret;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/RestRequest.cs b/MsmhTools/MsmhTools/HTTPProxyServer/RestRequest.cs
deleted file mode 100644
index 00c448e..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/RestRequest.cs
+++ /dev/null
@@ -1,699 +0,0 @@
-using System;
-using System.Net;
-using System.Net.Http;
-using System.Net.Security;
-using System.Net.Sockets;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Text.Json.Serialization;
-using System.Diagnostics;
-using System.Security.Authentication;
-using System.Net.Http.Headers;
-// https://github.com/jchristn/RestWrapper/blob/master/src/RestWrapper/RestRequest.cs
-
-namespace MsmhTools.HTTPProxyServer
-{
- ///
- /// Authorization header options.
- ///
- public class AuthorizationHeader
- {
- ///
- /// The username to use in the authorization header, if any.
- ///
- public string? User = null;
-
- ///
- /// The password to use in the authorization header, if any.
- ///
- public string? Password = null;
-
- ///
- /// The bearer token to use in the authorization header, if any.
- ///
- public string? BearerToken = null;
-
- ///
- /// Enable to encode credentials in the authorization header.
- ///
- public bool EncodeCredentials = true;
-
- ///
- /// Instantiate the object.
- ///
- public AuthorizationHeader()
- {
-
- }
- }
-
- ///
- /// RESTful HTTP request to be sent to a server.
- ///
- public class RestRequest
- {
- ///
- /// Method to invoke when sending log messages.
- ///
- [JsonIgnore]
- public Action? Logger { get; set; } = null;
-
- ///
- /// The URL to which the request should be directed.
- ///
- public string? Url { get; set; } = null;
-
- ///
- /// The HTTP method to use, also known as a verb (GET, PUT, POST, DELETE, etc).
- ///
- public HttpMethod Method = HttpMethod.Get;
-
-
- private AuthorizationHeader _Authorization = new();
-
- ///
- /// Authorization header parameters.
- ///
- public AuthorizationHeader Authorization
- {
- get
- {
- return _Authorization;
- }
- set
- {
- if (value == null) _Authorization = new AuthorizationHeader();
- else _Authorization = value;
- }
- }
-
- ///
- /// Ignore certificate errors such as expired certificates, self-signed certificates, or those that cannot be validated.
- ///
- public bool IgnoreCertificateErrors { get; set; } = false;
-
- ///
- /// The filename of the file containing the certificate.
- ///
- public string? CertificateFilename { get; set; } = null;
-
- ///
- /// The password to the certificate file.
- ///
- public string? CertificatePassword { get; set; } = null;
-
- ///
- /// The HTTP headers to attach to the request.
- ///
- public Dictionary? Headers
- {
- get
- {
- return _Headers;
- }
- set
- {
- if (value == null) _Headers = new Dictionary();
- else _Headers = value;
- }
- }
-
- ///
- /// The content type of the payload (i.e. Data or DataStream).
- ///
- public string? ContentType { get; set; } = null;
-
- ///
- /// The content length of the payload (i.e. Data or DataStream).
- ///
- public long ContentLength { get; private set; } = 0;
-
- ///
- /// The size of the buffer to use while reading from the DataStream and the response stream from the server.
- ///
- public int BufferSize
- {
- get
- {
- return _StreamReadBufferSize;
- }
- set
- {
- if (value < 1) throw new ArgumentException("StreamReadBufferSize must be at least one byte in size.");
- _StreamReadBufferSize = value;
- }
- }
-
- ///
- /// The number of milliseconds to wait before assuming the request has timed out.
- ///
- public int TimeoutMilliseconds
- {
- get
- {
- return _TimeoutMilliseconds;
- }
- set
- {
- if (value < 1) throw new ArgumentException("Timeout must be greater than 1ms.");
- _TimeoutMilliseconds = value;
- }
- }
-
- ///
- /// The user agent header to set on outbound requests.
- ///
- public string UserAgent { get; set; } = string.Empty;
-
- ///
- /// Enable or disable support for automatically handling redirects.
- ///
- public bool AllowAutoRedirect { get; set; } = true;
-
- private string _Header = string.Empty;
- private int _StreamReadBufferSize = 65536;
- private int _TimeoutMilliseconds = 30000;
- private Dictionary _Headers = new();
-
- ///
- /// A simple RESTful HTTP client.
- ///
- /// URL to access on the server.
- public RestRequest(string url)
- {
- if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url));
-
- Url = url;
- }
-
- ///
- /// A simple RESTful HTTP client.
- ///
- /// URL to access on the server.
- /// HTTP method to use.
- public RestRequest(string url, HttpMethod method)
- {
- if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url));
-
- Url = url;
- Method = method;
- }
-
- ///
- /// A simple RESTful HTTP client.
- ///
- /// URL to access on the server.
- /// HTTP method to use.
- /// Content type to use.
- public RestRequest(
- string url,
- HttpMethod method,
- string contentType)
- {
- if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url));
-
- Url = url;
- Method = method;
- ContentType = contentType;
- }
-
- ///
- /// A simple RESTful HTTP client.
- ///
- /// URL to access on the server.
- /// HTTP method to use.
- /// HTTP headers to use.
- /// Content type to use.
- public RestRequest(
- string url,
- HttpMethod method,
- Dictionary? headers,
- string? contentType)
- {
- //if (string.IsNullOrEmpty(url)) throw new ArgumentNullException(nameof(url));
-
- Url = url;
- Method = method;
- Headers = headers;
- ContentType = contentType;
- }
-
- ///
- /// Send the HTTP request with no data.
- ///
- /// RestResponse.
- public RestResponse? Send()
- {
- return SendInternal(0, null);
- }
-
- ///
- /// Send the HTTP request using form-encoded data.
- /// This method will automatically set the content-type header to 'application/x-www-form-urlencoded' if it is not already set.
- ///
- /// Dictionary.
- ///
- public RestResponse? Send(Dictionary form)
- {
- // refer to https://github.com/dotnet/runtime/issues/22811
- if (form == null) form = new Dictionary();
- var items = form.Select(i => WebUtility.UrlEncode(i.Key) + "=" + WebUtility.UrlEncode(i.Value));
- var content = new StringContent(string.Join("&", items), null, "application/x-www-form-urlencoded");
- byte[] bytes = Encoding.UTF8.GetBytes(content.ReadAsStringAsync().Result);
- ContentLength = bytes.Length;
- if (string.IsNullOrEmpty(ContentType)) ContentType = "application/x-www-form-urlencoded";
- return Send(bytes);
- }
-
- ///
- /// Send the HTTP request with the supplied data.
- ///
- /// A string containing the data you wish to send to the server (does not work with GET requests).
- /// RestResponse.
- public RestResponse? Send(string data)
- {
- if (string.IsNullOrEmpty(data)) return Send();
- return Send(Encoding.UTF8.GetBytes(data));
- }
-
- ///
- /// Send the HTTP request with the supplied data.
- ///
- /// A byte array containing the data you wish to send to the server (does not work with GET requests).
- /// RestResponse.
- public RestResponse? Send(byte[] data)
- {
- long contentLength = 0;
- MemoryStream stream = new(Array.Empty());
-
- if (data != null && data.Length > 0)
- {
- contentLength = data.Length;
- stream = new MemoryStream(data);
- stream.Seek(0, SeekOrigin.Begin);
- }
-
- return SendInternal(contentLength, stream);
- }
-
- ///
- /// Send the HTTP request with the supplied data.
- ///
- /// The number of bytes to read from the input stream.
- /// Stream containing the data you wish to send to the server (does not work with GET requests).
- /// RestResponse.
- public RestResponse? Send(long contentLength, Stream? stream)
- {
- return SendInternal(contentLength, stream);
- }
-
- ///
- /// Send the HTTP request with no data.
- ///
- /// Cancellation token.
- /// RestResponse.
- public Task SendAsync(CancellationToken token = default)
- {
- return SendInternalAsync(0, null, token);
- }
-
- ///
- /// Send the HTTP request using form-encoded data.
- /// This method will automatically set the content-type header.
- ///
- /// Dictionary.
- /// Cancellation token.
- /// RestResponse.
- public Task SendAsync(Dictionary form, CancellationToken token = default)
- {
- // refer to https://github.com/dotnet/runtime/issues/22811
- if (form == null) form = new Dictionary();
- var items = form.Select(i => WebUtility.UrlEncode(i.Key) + "=" + WebUtility.UrlEncode(i.Value));
- var content = new StringContent(string.Join("&", items), null, "application/x-www-form-urlencoded");
- byte[] bytes = Encoding.UTF8.GetBytes(content.ReadAsStringAsync(token).Result);
- ContentLength = bytes.Length;
- if (string.IsNullOrEmpty(ContentType)) ContentType = "application/x-www-form-urlencoded";
- return SendAsync(bytes, token);
- }
-
- ///
- /// Send the HTTP request with the supplied data.
- ///
- /// A string containing the data you wish to send to the server (does not work with GET requests).
- /// Cancellation token.
- /// RestResponse.
- public Task SendAsync(string data, CancellationToken token = default)
- {
- if (string.IsNullOrEmpty(data)) return SendAsync(token);
- return SendAsync(Encoding.UTF8.GetBytes(data), token);
- }
-
- ///
- /// Send the HTTP request with the supplied data.
- ///
- /// A byte array containing the data you wish to send to the server (does not work with GET requests).
- /// Cancellation token.
- /// RestResponse.
- public Task SendAsync(byte[] data, CancellationToken token = default)
- {
- long contentLength = 0;
- MemoryStream stream = new(Array.Empty());
-
- if (data != null && data.Length > 0)
- {
- contentLength = data.Length;
- stream = new MemoryStream(data);
- stream.Seek(0, SeekOrigin.Begin);
- }
-
- return SendInternalAsync(contentLength, stream, token);
- }
-
- ///
- /// Send the HTTP request with the supplied data.
- ///
- /// The number of bytes to read from the input stream.
- /// A stream containing the data you wish to send to the server (does not work with GET requests).
- /// Cancellation token.
- /// RestResponse.
- public Task SendAsync(long contentLength, Stream? stream, CancellationToken token = default)
- {
- return SendInternalAsync(contentLength, stream, token);
- }
-
- private bool Validator(object sender, X509Certificate? certificate, X509Chain? chain, SslPolicyErrors sslPolicyErrors)
- {
- return true;
- }
-
- private RestResponse? SendInternal(long contentLength, Stream? stream)
- {
- RestResponse? resp = SendInternalAsync(contentLength, stream, CancellationToken.None).Result;
- return resp;
- }
-
- private async Task SendInternalAsync(long contentLength, Stream? stream, CancellationToken token)
- {
- //if (string.IsNullOrEmpty(Url)) throw new ArgumentNullException(nameof(Url));
-
- //Timestamps ts = new Timestamps();
-
- Logger?.Invoke(_Header + Method.ToString() + " " + Url);
-
- try
- {
- // Setup-Webrequest
- Logger?.Invoke(_Header + "setting up web request");
-
- if (IgnoreCertificateErrors) ServicePointManager.ServerCertificateValidationCallback = Validator;
-
- ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
-
- HttpClientHandler handler = new();
- handler.AllowAutoRedirect = AllowAutoRedirect;
-
- if (!string.IsNullOrEmpty(CertificateFilename))
- {
- X509Certificate2? cert = null;
-
- if (!string.IsNullOrEmpty(CertificatePassword))
- {
- Logger?.Invoke(_Header + "adding certificate including password");
- cert = new X509Certificate2(CertificateFilename, CertificatePassword);
- }
- else
- {
- Logger?.Invoke(_Header + "adding certificate without password");
- cert = new X509Certificate2(CertificateFilename);
- }
-
- handler.ClientCertificateOptions = ClientCertificateOption.Manual;
- handler.SslProtocols = SslProtocols.Tls12;
- handler.ClientCertificates.Add(cert);
- }
-
- HttpClient client = new(handler);
- client.Timeout = TimeSpan.FromMilliseconds(_TimeoutMilliseconds);
- client.DefaultRequestHeaders.ExpectContinue = false;
- client.DefaultRequestHeaders.ConnectionClose = true;
-
- HttpRequestMessage? message = null;
-
- if (Method == HttpMethod.Delete)
- {
- message = new HttpRequestMessage(HttpMethod.Delete, Url);
- }
- else if (Method == HttpMethod.Get)
- {
- message = new HttpRequestMessage(HttpMethod.Get, Url);
- }
- else if (Method == HttpMethod.Head)
- {
- message = new HttpRequestMessage(HttpMethod.Head, Url);
- }
- else if (Method == HttpMethod.Options)
- {
- message = new HttpRequestMessage(HttpMethod.Options, Url);
- }
-#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
- else if (Method == HttpMethod.Patch)
- {
- message = new HttpRequestMessage(HttpMethod.Patch, Url);
- }
-#endif
- else if (Method == HttpMethod.Post)
- {
- message = new HttpRequestMessage(HttpMethod.Post, Url);
- }
- else if (Method == HttpMethod.Put)
- {
- message = new HttpRequestMessage(HttpMethod.Put, Url);
- }
- else if (Method == HttpMethod.Trace)
- {
- message = new HttpRequestMessage(HttpMethod.Trace, Url);
- }
- else
- {
- throw new ArgumentException("HTTP method '" + Method.ToString() + "' is not supported.");
- }
-
- // Write-Request-Body-Data
- HttpContent? content = null;
-
- if (Method != HttpMethod.Get && Method != HttpMethod.Head)
- {
- if (contentLength > 0 && stream != null)
- {
- Logger?.Invoke(_Header + "adding " + contentLength + " bytes to request");
- content = new StreamContent(stream, _StreamReadBufferSize);
- // content.Headers.ContentLength = ContentLength;
- if (!string.IsNullOrEmpty(ContentType))
- content.Headers.ContentType = new MediaTypeHeaderValue(ContentType);
- }
- }
-
- message.Content = content;
-
- if (Headers != null && Headers.Count > 0)
- {
- foreach (KeyValuePair pair in Headers)
- {
- if (string.IsNullOrEmpty(pair.Key)) continue;
- if (string.IsNullOrEmpty(pair.Value)) continue;
-
- Logger?.Invoke(_Header + "adding header " + pair.Key + ": " + pair.Value);
-
- if (pair.Key.ToLower().Trim().Equals("close"))
- {
- // do nothing
- }
- else if (pair.Key.ToLower().Trim().Equals("connection"))
- {
- // do nothing
- }
- else if (pair.Key.ToLower().Trim().Equals("content-length"))
- {
- // do nothing
- }
- else if (pair.Key.ToLower().Trim().Equals("content-type"))
- {
- if (message.Content != null)
- message.Content.Headers.ContentType = new MediaTypeHeaderValue(pair.Value);
- }
- else
- {
- client.DefaultRequestHeaders.Add(pair.Key, pair.Value);
- }
- }
- }
-
- // Add-Auth-Info
- if (!string.IsNullOrEmpty(_Authorization.User))
- {
- if (_Authorization.EncodeCredentials)
- {
- Logger?.Invoke(_Header + "adding encoded credentials for user " + _Authorization.User);
-
- string authInfo = _Authorization.User + ":" + _Authorization.Password;
- authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
- client.DefaultRequestHeaders.Add("Authorization", "Basic " + authInfo);
- }
- else
- {
- Logger?.Invoke(_Header + "adding plaintext credentials for user " + _Authorization.User);
- client.DefaultRequestHeaders.Add("Authorization", "Basic " + _Authorization.User + ":" + _Authorization.Password);
- }
- }
- else if (!string.IsNullOrEmpty(_Authorization.BearerToken))
- {
- Logger?.Invoke(_Header + "adding authorization bearer token " + _Authorization.BearerToken);
- client.DefaultRequestHeaders.Add("Authorization", "Bearer " + _Authorization.BearerToken);
- }
-
- // Submit-Request-and-Build-Response
- HttpResponseMessage? response = null;
- try
- {
- response = await client.SendAsync(message, token).ConfigureAwait(false);
- }
- catch (NotSupportedException)
- {
- // do nothing
- }
-
- if (response != null)
- {
- Logger?.Invoke(_Header + response.StatusCode + " response received after " + DateTime.Now);
-
- RestResponse ret = new();
- ret.ProtocolVersion = "HTTP/" + response.Version.ToString();
- ret.StatusCode = (int)response.StatusCode;
- ret.StatusDescription = response.StatusCode.ToString();
-
- if (response.Content != null && response.Content.Headers != null)
- {
- ret.ContentEncoding = string.Join(",", response.Content.Headers.ContentEncoding);
- if (response.Content.Headers.ContentType != null)
- ret.ContentType = response.Content.Headers.ContentType.ToString();
-
- if (response.Content.Headers.ContentLength != null)
- ret.ContentLength = response.Content.Headers.ContentLength.Value;
- }
-
- Logger?.Invoke(_Header + "processing response headers after " + DateTime.Now);
-
- foreach (var header in response.Headers)
- {
- string key = header.Key;
- string val = string.Join(",", header.Value);
- if (ret.Headers != null)
- ret.Headers.Add(key, val);
- }
-
- if (ret.ContentLength > 0)
- {
- if (response.Content != null)
- ret.Data = await response.Content.ReadAsStreamAsync(token);
- }
-
- return ret;
- }
-
- return null;
- }
- catch (TaskCanceledException)
- {
- Logger?.Invoke(_Header + "task canceled");
- return null;
- }
- catch (OperationCanceledException)
- {
- Logger?.Invoke(_Header + "operation canceled");
- return null;
- }
- catch (WebException we)
- {
- // WebException
- Logger?.Invoke(_Header + "web exception: " + we.Message);
-
- RestResponse ret = new();
- ret.Headers = null;
- ret.ContentEncoding = null;
- ret.ContentType = null;
- ret.ContentLength = 0;
- ret.StatusCode = 0;
- ret.StatusDescription = null;
- ret.Data = null;
-
- if (we.Response is HttpWebResponse exceptionResponse)
- {
- ret.ProtocolVersion = "HTTP/" + exceptionResponse.ProtocolVersion.ToString();
- ret.ContentEncoding = exceptionResponse.ContentEncoding;
- ret.ContentType = exceptionResponse.ContentType;
- ret.ContentLength = exceptionResponse.ContentLength;
- ret.StatusCode = (int)exceptionResponse.StatusCode;
- ret.StatusDescription = exceptionResponse.StatusDescription;
-
- Logger?.Invoke(_Header + "server returned status code " + ret.StatusCode);
-
- if (exceptionResponse.Headers != null && exceptionResponse.Headers.Count > 0)
- {
- for (int i = 0; i < exceptionResponse.Headers.Count; i++)
- {
- string key = exceptionResponse.Headers.GetKey(i);
- string val = "";
- int valCount = 0;
-
- string[]? getValues = exceptionResponse.Headers.GetValues(i);
- if (getValues != null)
- {
- foreach (string value in getValues)
- {
- if (valCount == 0)
- {
- val += value;
- valCount++;
- }
- else
- {
- val += "," + value;
- valCount++;
- }
- }
- }
-
- Logger?.Invoke(_Header + "adding exception header " + key + ": " + val);
- if (ret.Headers != null)
- ret.Headers.Add(key, val);
- }
- }
-
- if (exceptionResponse.ContentLength > 0)
- {
- Logger?.Invoke(_Header + "attaching exception response stream to response with content length " + exceptionResponse.ContentLength + " bytes");
- ret.ContentLength = exceptionResponse.ContentLength;
- ret.Data = exceptionResponse.GetResponseStream();
- }
- else
- {
- ret.ContentLength = 0;
- ret.Data = null;
- }
- }
-
- return ret;
- }
- catch (Exception)
- {
- return null;
- }
- finally
- {
- Logger?.Invoke(_Header + "complete (" + DateTime.Now + ")");
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/RestResponse.cs b/MsmhTools/MsmhTools/HTTPProxyServer/RestResponse.cs
deleted file mode 100644
index 44cf3ce..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/RestResponse.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-using System;
-using System.Text;
-
-namespace MsmhTools.HTTPProxyServer
-{
- ///
- /// RESTful response from the server.
- ///
- public class RestResponse
- {
- ///
- /// The protocol and version.
- ///
- public string? ProtocolVersion { get; internal set; } = null;
-
- ///
- /// User-supplied headers.
- ///
- public Dictionary? Headers { get; internal set; } = new Dictionary();
-
- ///
- /// The content encoding returned from the server.
- ///
- public string? ContentEncoding { get; internal set; } = null;
-
- ///
- /// The content type returned from the server.
- ///
- public string? ContentType { get; internal set; } = null;
-
- ///
- /// The number of bytes contained in the response body byte array.
- ///
- public long ContentLength { get; internal set; } = 0;
-
- ///
- /// The response URI of the responder.
- ///
- public string? ResponseURI { get; internal set; } = null;
-
- ///
- /// The HTTP status code returned with the response.
- ///
- public int StatusCode { get; internal set; } = 0;
-
- ///
- /// The HTTP status description associated with the HTTP status code.
- ///
- public string? StatusDescription { get; internal set; } = null;
-
- ///
- /// The stream containing the response data returned from the server.
- ///
- public Stream? Data { get; internal set; } = null;
-
- ///
- /// Read the data stream fully into a byte array.
- /// If you use this property, the 'Data' property will be fully read.
- ///
- public byte[]? DataAsBytes
- {
- get
- {
- if (_Data == null && ContentLength > 0 && Data != null && Data.CanRead)
- {
- _Data = StreamToBytes(Data);
- }
-
- return _Data;
- }
- }
-
- ///
- /// Read the data stream fully into a string.
- /// If you use this property, the 'Data' property will be fully read.
- ///
- public string? DataAsString
- {
- get
- {
- if (_Data == null && ContentLength > 0 && Data != null && Data.CanRead)
- {
- _Data = StreamToBytes(Data);
- }
-
- if (_Data != null)
- {
- return Encoding.UTF8.GetString(_Data);
- }
-
- return null;
- }
- }
-
- private byte[]? _Data = null;
-
- ///
- /// An organized object containing frequently used response parameters from a RESTful HTTP request.
- ///
- public RestResponse()
- {
-
- }
-
- private byte[] StreamToBytes(Stream input)
- {
- byte[] buffer = new byte[16 * 1024];
- using MemoryStream ms = new();
- int read;
-
- while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
- {
- ms.Write(buffer, 0, read);
- }
-
- byte[] ret = ms.ToArray();
- return ret;
- }
-
- ///
- /// Creates a human-readable string of the object.
- ///
- /// String.
- public override string ToString()
- {
- string ret = "";
- ret += "REST Response" + Environment.NewLine;
-
- if (Headers != null && Headers.Count > 0)
- {
- ret += " Headers" + Environment.NewLine;
- foreach (KeyValuePair curr in Headers)
- {
- ret += " | " + curr.Key + ": " + curr.Value + Environment.NewLine;
- }
- }
-
- if (!string.IsNullOrEmpty(ContentEncoding))
- ret += " Content Encoding : " + ContentEncoding + Environment.NewLine;
- if (!string.IsNullOrEmpty(ContentType))
- ret += " Content Type : " + ContentType + Environment.NewLine;
- if (!string.IsNullOrEmpty(ResponseURI))
- ret += " Response URI : " + ResponseURI + Environment.NewLine;
-
- ret += " Status Code : " + StatusCode + Environment.NewLine;
- ret += " Status Description : " + StatusDescription + Environment.NewLine;
- ret += " Content Length : " + ContentLength + Environment.NewLine;
-
- ret += " Data : ";
- if (Data != null && ContentLength > 0) ret += "[stream]";
- else ret += "[none]";
- ret += Environment.NewLine;
-
- return ret;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/Settings.cs b/MsmhTools/MsmhTools/HTTPProxyServer/Settings.cs
deleted file mode 100644
index 183644e..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/Settings.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-using System;
-using System.Net;
-using System.Text;
-
-namespace MsmhTools.HTTPProxyServer
-{
- ///
- /// Proxy server settings.
- ///
- public class ProxySettings
- {
- private IPAddress _ListenerIpAddress { get; set; } = IPAddress.Any;
- private int _ListenerPort { get; set; } = 8080;
- private int _MaxThreads { get; set; } = 256;
-
- ///
- /// The DNS hostname or IP address on which to listen.
- ///
- public IPAddress ListenerIpAddress
- {
- get
- {
- return _ListenerIpAddress;
- }
- set
- {
- _ListenerIpAddress = value ?? throw new ArgumentNullException(nameof(ListenerIpAddress));
- }
- }
-
- ///
- /// The TCP port on which to listen.
- ///
- public int ListenerPort
- {
- get
- {
- return _ListenerPort;
- }
- set
- {
- if (value < 0 || value > 65535) throw new ArgumentOutOfRangeException(nameof(ListenerPort));
- _ListenerPort = value;
- }
- }
-
- ///
- /// Maximum number of threads to support.
- ///
- public int MaxThreads
- {
- get
- {
- return _MaxThreads;
- }
- set
- {
- if (value < 1) throw new ArgumentOutOfRangeException(nameof(MaxThreads));
- _MaxThreads = value;
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/Tunnel.cs b/MsmhTools/MsmhTools/HTTPProxyServer/Tunnel.cs
deleted file mode 100644
index 3b4c594..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/Tunnel.cs
+++ /dev/null
@@ -1,667 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Net;
-using System.Net.NetworkInformation;
-using System.Net.Security;
-using System.Net.Sockets;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-
-namespace MsmhTools.HTTPProxyServer
-{
- ///
- /// CONNECT tunnel.
- ///
- public class Tunnel : IDisposable
- {
- ///
- /// UTC timestamp when the session was started.
- ///
- public DateTime TimestampUtc { get; set; }
-
- public Request Request { get; set; }
-
- ///
- /// The TCP client instance for the requestor.
- ///
- public TcpClient ClientTcpClient { get; set; }
-
- ///
- /// The TCP client instance for the server.
- ///
- public TcpClient ServerTcpClient { get; set; }
-
- ///
- /// The data stream for the client.
- ///
- public Stream ClientStream { get; set; }
-
- ///
- /// The data stream for the server.
- ///
- public Stream ServerStream { get; set; }
-
- private bool _Active = true;
- private readonly Stopwatch KillOnTimeout = new();
-
- public event EventHandler? OnErrorOccurred;
- public event EventHandler? OnDebugInfoReceived;
-
- ///
- /// Construct a Tunnel object.
- ///
- /// Request.
- /// TCP client instance of the client.
- /// TCP client instance of the server.
- public Tunnel(
- Request request,
- TcpClient client,
- TcpClient server)
- {
- if (request == null) throw new ArgumentNullException(nameof(request));
- if (string.IsNullOrEmpty(request.SourceIp)) throw new ArgumentNullException(nameof(request));
- if (string.IsNullOrEmpty(request.DestIp)) throw new ArgumentNullException(nameof(request));
- if (string.IsNullOrEmpty(request.DestHostname)) throw new ArgumentNullException(nameof(request));
- if (request.SourcePort < 0) throw new ArgumentOutOfRangeException(nameof(request));
- if (request.DestPort < 0) throw new ArgumentOutOfRangeException(nameof(request));
- if (request.DestHostPort < 0) throw new ArgumentOutOfRangeException(nameof(request));
-
- Request = request;
- TimestampUtc = DateTime.Now.ToUniversalTime();
-
- ClientTcpClient = client ?? throw new ArgumentNullException(nameof(client));
- ClientTcpClient.NoDelay = true;
- ClientTcpClient.Client.NoDelay = true;
-
- ServerTcpClient = server ?? throw new ArgumentNullException(nameof(server));
- ServerTcpClient.NoDelay = true;
- ServerTcpClient.Client.NoDelay = true;
-
- ClientStream = client.GetStream();
- ServerStream = server.GetStream();
-
- Parallel.Invoke(
- () => ClientReaderAsync(),
- () => ServerReaderAsync()
- );
-
- //Task.Run(async () => await ClientReaderAsync());
- //Task.Run(async () => await ServerReaderAsync());
-
- _Active = true;
- }
-
- ///
- /// Human-readable string.
- ///
- /// String.
- public override string ToString()
- {
- return TimestampUtc.ToString("MM/dd/yyyy HH:mm:ss") + " " + Source() + " to " + Destination();
- }
-
- ///
- /// Returns the source IP and port.
- ///
- /// String.
- public string Source()
- {
- return Request.SourceIp + ":" + Request.SourcePort;
- }
-
- ///
- /// Returns the destination IP and port along wit destination hostname and port.
- ///
- /// String.
- public string Destination()
- {
- return Request.DestIp + ":" + Request.DestPort + " [" + Request.DestHostname + ":" + Request.DestHostPort + "]";
- }
-
- ///
- /// Determines whether or not the tunnel is active.
- ///
- /// True if both connections are active.
- public bool IsActive()
- {
- bool clientActive = false;
- bool serverActive = false;
- bool clientSocketActive = false;
- bool serverSocketActive = false;
-
- if (ClientTcpClient != null)
- {
- clientActive = ClientTcpClient.Connected;
-
- if (ClientTcpClient.Client != null)
- {
- TcpState clientState = GetTcpRemoteState(ClientTcpClient);
-
- if (clientState == TcpState.Established
- || clientState == TcpState.Listen
- || clientState == TcpState.SynReceived
- || clientState == TcpState.SynSent
- || clientState == TcpState.TimeWait)
- {
- clientSocketActive = true;
- }
- }
- }
-
- if (ServerTcpClient != null)
- {
- serverActive = ServerTcpClient.Connected;
-
- if (ServerTcpClient.Client != null)
- {
- // see https://github.com/jchristn/PuppyProxy/compare/master...waldekmastykarz:PuppyProxy:master
-
- /*
- TcpState serverState = GetTcpRemoteState(ServerTcpClient);
-
- if (serverState == TcpState.Established
- || serverState == TcpState.Listen
- || serverState == TcpState.SynReceived
- || serverState == TcpState.SynSent
- || serverState == TcpState.TimeWait)
- {
- serverSocketActive = true;
- }
- */
-
- serverSocketActive = true;
- }
- }
-
- if (Request.TimeoutSec != 0 &&
- KillOnTimeout.ElapsedMilliseconds > TimeSpan.FromSeconds(Request.TimeoutSec).TotalMilliseconds)
- {
- string msg = $"Killed Request On Timeout({Request.TimeoutSec} Sec): {Request.DestHostname}:{Request.DestHostPort}";
- OnDebugInfoReceived?.Invoke(msg, EventArgs.Empty);
- Debug.WriteLine(msg);
- _Active = false;
- KillOnTimeout.Stop();
- }
- else
- _Active = clientActive && clientSocketActive && serverActive && serverSocketActive;
- return _Active;
- }
-
- ///
- /// Tear down the tunnel object and resources.
- ///
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- if (ClientStream != null)
- {
- ClientStream.Close();
- ClientStream.Dispose();
- }
-
- if (ServerStream != null)
- {
- ServerStream.Close();
- ServerStream.Dispose();
- }
-
- if (ClientTcpClient != null)
- ClientTcpClient.Dispose();
-
- if (ServerTcpClient != null)
- ServerTcpClient.Dispose();
- }
-
- private bool StreamReadSync(TcpClient client, out byte[]? data)
- {
- data = null;
- try
- {
- Stream stream = client.GetStream();
-
- int read = 0;
- long bufferSize = 65536;
- byte[] buffer = new byte[bufferSize];
-
- read = stream.Read(buffer, 0, buffer.Length);
- if (read > 0)
- {
- if (read == bufferSize)
- {
- data = buffer;
- return true;
- }
- else
- {
- data = new byte[read];
- Buffer.BlockCopy(buffer, 0, data, 0, read);
- return true;
- }
- }
- else
- {
- data = null;
- return true;
- }
- }
- catch (InvalidOperationException)
- {
- _Active = false;
- return false;
- }
- catch (IOException)
- {
- _Active = false;
- return false;
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"Stream Read Sync: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- _Active = false;
- return false;
- }
- finally
- {
- // do nothing
- }
- }
-
- private async Task StreamReadAsync(TcpClient client)
- {
- var task = await Task.Run(async () =>
- {
- try
- {
- Stream stream = client.GetStream();
- if (stream == null) return null;
-
- byte[] buffer = new byte[65536];
-
- using MemoryStream memStream = new();
- int read = await stream.ReadAsync(buffer);
- if (read > 0)
- {
- if (read == buffer.Length)
- {
- return buffer;
- }
- else
- {
- byte[] data = new byte[read];
- Buffer.BlockCopy(buffer, 0, data, 0, read);
- return data;
- }
- }
- else
- {
- return null;
- }
- }
- catch (InvalidOperationException)
- {
- _Active = false;
- return null;
- }
- catch (IOException)
- {
- _Active = false;
- return null;
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"Stream Read Async: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- _Active = false;
- return null;
- }
- finally
- {
- // do nothing
- }
- });
-
- return task;
- }
-
- private TcpState GetTcpLocalState(TcpClient tcpClient)
- {
- try
- {
- if (tcpClient.Client == null)
- return TcpState.Unknown;
-
- IPGlobalProperties ipgp = IPGlobalProperties.GetIPGlobalProperties();
- if (ipgp != null)
- {
- TcpConnectionInformation[]? tcis = ipgp.GetActiveTcpConnections();
- if (tcis != null)
- {
- for (int n = 0; n < tcis.Length; n++)
- {
- TcpConnectionInformation? tci = tcis[n];
- if (tci != null)
- {
- if (tcpClient.Client != null)
- {
- if (tci.LocalEndPoint.Equals(tcpClient.Client.LocalEndPoint))
- return tci.State;
- }
- }
- }
- }
- }
-
- return TcpState.Unknown;
- }
- catch (Exception)
- {
- return TcpState.Unknown;
- }
- }
-
- private TcpState GetTcpRemoteState(TcpClient tcpClient)
- {
- try
- {
- if (tcpClient.Client == null)
- return TcpState.Unknown;
-
- IPGlobalProperties ipgp = IPGlobalProperties.GetIPGlobalProperties();
- if (ipgp != null)
- {
- TcpConnectionInformation[]? tcis = ipgp.GetActiveTcpConnections();
- if (tcis != null)
- {
- for (int n = 0; n < tcis.Length; n++)
- {
- TcpConnectionInformation? tci = tcis[n];
- if (tci != null)
- {
- if (tcpClient.Client != null)
- {
- if (tci.RemoteEndPoint.Equals(tcpClient.Client.RemoteEndPoint))
- return tci.State;
- }
- }
- }
- }
- }
-
- return TcpState.Unknown;
- }
- catch (Exception)
- {
- return TcpState.Unknown;
- }
- }
-
- private void ClientReaderSync()
- {
- try
- {
- // Event
- string msgEvent = $"ClientReaderSync started for {Source()} to {Destination()}";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- byte[]? data = null;
- while (true)
- {
- if (StreamReadSync(ClientTcpClient, out data))
- {
- if (data != null && data.Length > 0)
- {
- // Event
- msgEvent = $"ClientReaderSync {Source()} to {Destination()} read {data.Length} bytes.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- ServerSend(data);
-
- data = null;
- }
- else
- {
- // Event
- msgEvent = "ClientReaderSync no data returned.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
- }
- }
- else
- {
- _Active = false;
- return;
- }
- }
- }
- catch (ObjectDisposedException)
- {
- _Active = false;
- }
- catch (SocketException)
- {
- _Active = false;
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"ClientReaderSync: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- _Active = false;
- }
- }
-
- private void ServerReaderSync()
- {
- try
- {
- // Event
- string msgEvent = $"ServerReaderSync started for {Source()} to {Destination()}";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- byte[]? data = null;
- while (true)
- {
- if (StreamReadSync(ServerTcpClient, out data))
- {
- if (data != null && data.Length > 0)
- {
- // Event
- msgEvent = $"ServerReaderSync {Destination()} to {Source()} read {data.Length} bytes.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- ClientSend(data);
-
- data = null;
- }
- else
- {
- // Event
- msgEvent = "ServerReaderSync no data returned.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
- }
- }
- else
- {
- _Active = false;
- return;
- }
- }
- }
- catch (ObjectDisposedException)
- {
- _Active = false;
- }
- catch (SocketException)
- {
- _Active = false;
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"ServerReaderSync: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- _Active = false;
- }
- }
-
- private async void ClientReaderAsync()
- {
- await Task.Run(async () =>
- {
- try
- {
- // Event
- string msgEvent = $"ClientReaderAsync started for {Source()} to {Destination()}";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- byte[]? data = null;
- while (true)
- {
- data = await StreamReadAsync(ClientTcpClient);
-
- if (data != null && data.Length > 0)
- {
- if (!KillOnTimeout.IsRunning) KillOnTimeout.Start();
- KillOnTimeout.Restart();
-
- // Event
- msgEvent = $"ClientReaderAsync {Source()} to {Destination()} read {data.Length} bytes.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- if (ClientTcpClient.Connected)
- ServerSend(data);
-
- data = null;
- }
-
- if (!_Active) break;
- }
- }
- catch (ObjectDisposedException)
- {
- _Active = false;
- }
- catch (SocketException)
- {
- _Active = false;
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"ClientReaderAsync: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- _Active = false;
- }
- });
- }
-
- private async void ServerReaderAsync()
- {
- await Task.Run(async () =>
- {
- try
- {
- // Event
- string msgEvent = $"ServerReaderAsync started for {Source()} to {Destination()}";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- byte[]? data = null;
- while (true)
- {
- data = await StreamReadAsync(ServerTcpClient);
-
- if (data != null && data.Length > 0)
- {
- // Event
- msgEvent = $"ServerReaderAsync {Destination()} to {Source()} read {data.Length} bytes.";
- OnDebugInfoReceived?.Invoke(msgEvent, EventArgs.Empty);
-
- if (ServerTcpClient.Connected)
- ClientSend(data);
-
- data = null;
- }
-
- if (!_Active) break;
- }
- }
- catch (ObjectDisposedException)
- {
- _Active = false;
- }
- catch (SocketException)
- {
- _Active = false;
- }
- catch (Exception e)
- {
- // Event Error
- string msgEventErr = $"ServerReaderAsync: {e.Message}";
- OnErrorOccurred?.Invoke(msgEventErr, EventArgs.Empty);
- _Active = false;
- }
- });
- }
-
- private void ClientSend(byte[] data)
- {
- // We don't have TLS Handshake here
- if (ClientTcpClient.Client == null) return;
- if (!ClientTcpClient.Connected) return;
- ClientTcpClient.Client.Send(data);
- }
-
- private void ServerSend(byte[] data)
- {
- // We do have TLS Handshake here
- if (ServerTcpClient.Client == null) return;
- if (!ServerTcpClient.Connected) return;
- if (Request.ApplyDpiBypass)
- Send(data, ServerTcpClient.Client);
- else
- ServerTcpClient.Client.Send(data);
- }
-
- public HTTPProxyServer.Program.DPIBypass ConstantDPIBypass { get; set; } = new();
- public void EnableDPIBypass(HTTPProxyServer.Program.DPIBypass dpiBypass)
- {
- ConstantDPIBypass = dpiBypass;
- ConstantDPIBypass.DestHostname = Request.DestHostname;
- ConstantDPIBypass.DestPort = Request.DestHostPort;
- }
-
- private void Send(byte[] data, Socket? socket)
- {
- if (socket != null)
- {
- if (ConstantDPIBypass.DPIBypassMode == HTTPProxyServer.Program.DPIBypass.Mode.Disable)
- {
- HTTPProxyServer.Program.DPIBypass bp = HTTPProxyServer.StaticDPIBypassProgram;
- bp.DestHostname = Request.DestHostname;
- bp.DestPort = Request.DestHostPort;
- if (bp.DPIBypassMode == HTTPProxyServer.Program.DPIBypass.Mode.Program)
- {
- HTTPProxyServer.Program.DPIBypass.ProgramMode programMode = new(data, socket);
- programMode.Send(bp);
- }
- else
- socket.Send(data);
- }
- else
- {
- HTTPProxyServer.Program.DPIBypass.ProgramMode programMode = new(data, socket);
- programMode.Send(ConstantDPIBypass);
- }
-
- }
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/HTTPProxyServer/TunnelManager.cs b/MsmhTools/MsmhTools/HTTPProxyServer/TunnelManager.cs
deleted file mode 100644
index 45aa36d..0000000
--- a/MsmhTools/MsmhTools/HTTPProxyServer/TunnelManager.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Collections.Concurrent;
-using System.Diagnostics;
-
-namespace MsmhTools.HTTPProxyServer
-{
- internal class TunnelManager
- {
- private readonly ConcurrentDictionary> Tunnels = new();
-
- ///
- /// Construct the Tunnel Manager.
- ///
- public TunnelManager()
- {
-
- }
-
- internal void Add(int threadId, Tunnel curr)
- {
- try
- {
- Tunnels.GetOrAdd(threadId, id => new Lazy(curr));
- }
- catch (Exception ex)
- {
- Debug.WriteLine("TunnelManager Add: " + ex.Message);
- }
- }
-
- internal void Remove(int threadId)
- {
- try
- {
- if (Tunnels.ContainsKey(threadId))
- {
- Tunnel curr = Tunnels[threadId].Value;
- if (curr != null)
- {
- if (curr.ClientTcpClient.Connected)
- curr.ClientTcpClient.Dispose();
- if (curr.ServerTcpClient.Connected)
- curr.ServerTcpClient.Dispose();
- Tunnels.TryRemove(threadId, out Lazy _);
- curr.Dispose();
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine("TunnelManager Remove: " + ex.Message);
- }
- }
-
- internal Dictionary> GetTunnels()
- {
- Dictionary> tempDic = new(Tunnels);
- return tempDic;
- }
-
- public int Count
- {
- get => Tunnels.ToList().Count;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/HtmlTools.cs b/MsmhTools/MsmhTools/HtmlTools.cs
deleted file mode 100644
index bbf0ff2..0000000
--- a/MsmhTools/MsmhTools/HtmlTools.cs
+++ /dev/null
@@ -1,614 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-
-namespace MsmhTools
-{
- ///
- /// HTML specific string manipulations.
- ///
- public static class HtmlTools
- {
- public static string TagItalic => "i";
- public static string TagBold => "b";
- public static string TagUnderline => "u";
- public static string TagFont => "font";
- public static string TagCyrillicI => "\u0456"; // Cyrillic Small Letter Byelorussian-Ukrainian i (http://graphemica.com/%D1%96)
-
- private static readonly Regex TagOpenRegex = new Regex(@"<\s*(?:/\s*)?(\w+)[^>]*>", RegexOptions.Compiled);
-
- ///
- /// Remove all of the specified opening and closing tags from the source HTML string.
- ///
- /// The source string to search for specified HTML tags.
- /// The HTML tags to remove.
- /// A new string without the specified opening and closing tags.
- public static string RemoveOpenCloseTags(string source, params string[] tags)
- {
- if (string.IsNullOrEmpty(source) || source.IndexOf('<') < 0)
- {
- return source;
- }
-
- // This pattern matches these tag formats:
- //
- // < tag*>
- //
- // < /tag*>
- // tag*>
- // < / tag*>
- return TagOpenRegex.Replace(source, m => tags.Contains(m.Groups[1].Value, StringComparer.OrdinalIgnoreCase) ? string.Empty : m.Value);
- }
-
- ///
- /// Converts a string to an HTML-encoded string using named character references.
- ///
- /// The string to encode.
- /// An encoded string.
- public static string EncodeNamed(string source)
- {
- if (string.IsNullOrEmpty(source))
- {
- return string.Empty;
- }
-
- var encoded = new StringBuilder(source.Length);
- foreach (var ch in source)
- {
- switch (ch)
- {
- case '<':
- encoded.Append("<");
- break;
- case '>':
- encoded.Append(">");
- break;
- case '"':
- encoded.Append(""");
- break;
- case '&':
- encoded.Append("&");
- break;
- case '\'':
- encoded.Append("'");
- break;
- case ' ':
- encoded.Append(" ");
- break;
- case '–':
- encoded.Append("–");
- break;
- case '—':
- encoded.Append("—");
- break;
- case '¡':
- encoded.Append("¡");
- break;
- case '¿':
- encoded.Append("¿");
- break;
- case '“':
- encoded.Append("“");
- break;
- case '”':
- encoded.Append("”");
- break;
- case '‘':
- encoded.Append("‘");
- break;
- case '’':
- encoded.Append("’");
- break;
- case '«':
- encoded.Append("«");
- break;
- case '»':
- encoded.Append("»");
- break;
- case '¢':
- encoded.Append("¢");
- break;
- case '©':
- encoded.Append("©");
- break;
- case '÷':
- encoded.Append("÷");
- break;
- case 'µ':
- encoded.Append("µ");
- break;
- case '·':
- encoded.Append("·");
- break;
- case '¶':
- encoded.Append("¶");
- break;
- case '±':
- encoded.Append("±");
- break;
- case '€':
- encoded.Append("€");
- break;
- case '£':
- encoded.Append("£");
- break;
- case '®':
- encoded.Append("®");
- break;
- case '§':
- encoded.Append("§");
- break;
- case '™':
- encoded.Append("™");
- break;
- case '¥':
- encoded.Append("¥");
- break;
- case 'á':
- encoded.Append("á");
- break;
- case 'Á':
- encoded.Append("Á");
- break;
- case 'à':
- encoded.Append("à");
- break;
- case 'À':
- encoded.Append("À");
- break;
- case 'â':
- encoded.Append("â");
- break;
- case 'Â':
- encoded.Append("Â");
- break;
- case 'å':
- encoded.Append("å");
- break;
- case 'Å':
- encoded.Append("Å");
- break;
- case 'ã':
- encoded.Append("ã");
- break;
- case 'Ã':
- encoded.Append("Ã");
- break;
- case 'ä':
- encoded.Append("ä");
- break;
- case 'Ä':
- encoded.Append("Ä");
- break;
- case 'æ':
- encoded.Append("æ");
- break;
- case 'Æ':
- encoded.Append("Æ");
- break;
- case 'ç':
- encoded.Append("ç");
- break;
- case 'Ç':
- encoded.Append("Ç");
- break;
- case 'é':
- encoded.Append("é");
- break;
- case 'É':
- encoded.Append("É");
- break;
- case 'è':
- encoded.Append("è");
- break;
- case 'È':
- encoded.Append("È");
- break;
- case 'ê':
- encoded.Append("ê");
- break;
- case 'Ê':
- encoded.Append("Ê");
- break;
- case 'ë':
- encoded.Append("ë");
- break;
- case 'Ë':
- encoded.Append("Ë");
- break;
- case 'í':
- encoded.Append("í");
- break;
- case 'Í':
- encoded.Append("Í");
- break;
- case 'ì':
- encoded.Append("ì");
- break;
- case 'Ì':
- encoded.Append("Ì");
- break;
- case 'î':
- encoded.Append("î");
- break;
- case 'Î':
- encoded.Append("Î");
- break;
- case 'ï':
- encoded.Append("ï");
- break;
- case 'Ï':
- encoded.Append("Ï");
- break;
- case 'ñ':
- encoded.Append("ñ");
- break;
- case 'Ñ':
- encoded.Append("Ñ");
- break;
- case 'ó':
- encoded.Append("ó");
- break;
- case 'Ó':
- encoded.Append("Ó");
- break;
- case 'ò':
- encoded.Append("ò");
- break;
- case 'Ò':
- encoded.Append("Ò");
- break;
- case 'ô':
- encoded.Append("ô");
- break;
- case 'Ô':
- encoded.Append("Ô");
- break;
- case 'ø':
- encoded.Append("ø");
- break;
- case 'Ø':
- encoded.Append("Ø");
- break;
- case 'õ':
- encoded.Append("õ");
- break;
- case 'Õ':
- encoded.Append("Õ");
- break;
- case 'ö':
- encoded.Append("ö");
- break;
- case 'Ö':
- encoded.Append("Ö");
- break;
- case 'ß':
- encoded.Append("ß");
- break;
- case 'ú':
- encoded.Append("ú");
- break;
- case 'Ú':
- encoded.Append("Ú");
- break;
- case 'ù':
- encoded.Append("ù");
- break;
- case 'Ù':
- encoded.Append("Ù");
- break;
- case 'û':
- encoded.Append("û");
- break;
- case 'Û':
- encoded.Append("Û");
- break;
- case 'ü':
- encoded.Append("ü");
- break;
- case 'Ü':
- encoded.Append("Ü");
- break;
- case 'ÿ':
- encoded.Append("ÿ");
- break;
- default:
- if (ch > 127)
- {
- encoded.Append("").Append((int)ch).Append(';');
- }
- else
- {
- encoded.Append(ch);
- }
- break;
- }
- }
- return encoded.ToString();
- }
-
- ///
- /// Converts a string to an HTML-encoded string using numeric character references.
- ///
- /// The string to encode.
- /// An encoded string.
- public static string EncodeNumeric(string source)
- {
- if (string.IsNullOrEmpty(source))
- {
- return string.Empty;
- }
-
- var encoded = new StringBuilder(source.Length);
- foreach (var ch in source)
- {
- if (ch == ' ')
- {
- encoded.Append("");
- encoded.Append(160); //
- encoded.Append(';');
- }
- else if (ch > 127 || ch == '<' || ch == '>' || ch == '"' || ch == '&' || ch == '\'')
- {
- encoded.Append("");
- encoded.Append((int)ch);
- encoded.Append(';');
- }
- else
- {
- encoded.Append(ch);
- }
- }
- return encoded.ToString();
- }
-
- ///
- /// Optimized method to remove common html tags, like , , , and
- ///
- /// Text to remove html tags from
- /// Text stripped from common html tags
- private static string RemoveCommonHtmlTags(string s)
- {
- char[] array = new char[s.Length];
- int arrayIndex = 0;
- bool inside = false;
-
- for (int i = 0; i < s.Length; i++)
- {
- char ch = s[i];
- if (ch == '<' && i < s.Length - 2)
- {
- var next = s[i + 1];
- var nextNext = s[i + 2];
- if (nextNext == '>' &&
- (next == 'i' || //
- next == 'I' || //
- next == 'b' || //
- next == 'B' || //
- next == 'u' || //
- next == 'U')) //
- {
- inside = true;
- continue;
- }
-
- if (next == '/' && i < s.Length - 3)
- {
- var nextNextNext = s[i + 3];
- if (nextNextNext == '>' &&
- (nextNext == 'i' || //
- nextNext == 'I' || //
- nextNext == 'b' || //
- nextNext == 'B' || //
- nextNext == 'u' || //
- nextNext == 'U')) //
- {
- inside = true;
- continue;
- }
-
- if (nextNext == 'c' && nextNextNext == '.')
- {
- inside = true;
- continue;
- }
- }
-
- if (nextNext == '/' && i < s.Length - 3)
- { // some bad end tags sometimes seen
- var nextNextNext = s[i + 3];
- if (nextNextNext == '>' &&
- (next == 'i' || //
- next == 'I' || //
- next == 'b' || //
- next == 'B' || //
- next == 'u' || //
- next == 'U')) //
- {
- inside = true;
- continue;
- }
- }
-
- if ((next == 'f' || next == 'F') && s.Substring(i).StartsWith("", StringComparison.OrdinalIgnoreCase) || //
- next == ' ' && nextNext == '/' && s.Substring(i).StartsWith("< /font>", StringComparison.OrdinalIgnoreCase) || // < /font>
- next == '/' && nextNext == ' ' && s.Substring(i).StartsWith(" font>", StringComparison.OrdinalIgnoreCase)) // font>
- {
- inside = true;
- continue;
- }
-
- if (next == 'c' && nextNext == '.')
- {
- inside = true;
- continue;
- }
- }
- if (inside && ch == '>')
- {
- inside = false;
- continue;
- }
- if (!inside)
- {
- array[arrayIndex] = ch;
- arrayIndex++;
- }
- }
- return new string(array, 0, arrayIndex);
- }
-
- public static bool IsUrl(string text)
- {
- if (string.IsNullOrWhiteSpace(text) || text.Length < 6 || text.IndexOf('.') < 0 || text.IndexOf(' ') >= 0)
- {
- return false;
- }
-
- var allLower = text.ToLowerInvariant();
- if (allLower.StartsWith("http://", StringComparison.Ordinal) || allLower.StartsWith("https://", StringComparison.Ordinal) ||
- allLower.StartsWith("www.", StringComparison.Ordinal) || allLower.EndsWith(".org", StringComparison.Ordinal) ||
- allLower.EndsWith(".com", StringComparison.Ordinal) || allLower.EndsWith(".net", StringComparison.Ordinal))
- {
- return true;
- }
-
- if (allLower.Contains(".org/") || allLower.Contains(".com/") || allLower.Contains(".net/"))
- {
- return true;
- }
-
- return false;
- }
-
- public static bool StartsWithUrl(string text)
- {
- if (string.IsNullOrWhiteSpace(text))
- {
- return false;
- }
-
- var arr = text.Trim().TrimEnd('.').TrimEnd().Split();
- if (arr.Length == 0)
- {
- return false;
- }
-
- return IsUrl(arr[0]);
- }
-
- private static readonly string[] UppercaseTags = { "", "", "", "", "", "", "" };
-
- public static string FixUpperTags(string input)
- {
- if (string.IsNullOrEmpty(input) || input.IndexOf('<') < 0)
- {
- return input;
- }
-
- var text = input;
- var idx = text.IndexOfAny(UppercaseTags, StringComparison.Ordinal);
- while (idx >= 0)
- {
- var endIdx = text.IndexOf('>', idx + 2);
- if (endIdx < idx)
- {
- break;
- }
-
- var tag = text.Substring(idx, endIdx - idx).ToLowerInvariant();
- text = text.Remove(idx, endIdx - idx).Insert(idx, tag);
- idx = text.IndexOfAny(UppercaseTags, StringComparison.Ordinal);
- }
- return text;
- }
-
- public static string ToggleTag(string input, string tag, bool wholeLine, bool assa)
- {
- var text = input;
-
- if (assa)
- {
- var onOffTags = new List { "i", "b", "u", "s", "be" };
- if (onOffTags.Contains(tag))
- {
- if (text.Contains($"\\{tag}1"))
- {
- text = text.Replace($"{{\\{tag}1}}", string.Empty);
- text = text.Replace($"{{\\{tag}0}}", string.Empty);
- text = text.Replace($"\\{tag}1", string.Empty);
- text = text.Replace($"\\{tag}0", string.Empty);
- }
- else
- {
- text = wholeLine ? $"{{\\{tag}1}}{text}" : $"{{\\{tag}1}}{text}{{\\{tag}0}}";
- }
- }
- else
- {
- if (text.Contains($"\\{tag}"))
- {
- text = text.Replace($"{{\\{tag}}}", string.Empty);
- text = text.Replace($"\\{tag}", string.Empty);
- }
- else
- {
- text = $"{{\\{tag}}}{text}";
- }
- }
-
- return text;
- }
-
- if (text.IndexOf("<" + tag + ">", StringComparison.OrdinalIgnoreCase) >= 0 ||
- text.IndexOf("" + tag + ">", StringComparison.OrdinalIgnoreCase) >= 0)
- {
- text = text.Replace("<" + tag + ">", string.Empty);
- text = text.Replace("" + tag + ">", string.Empty);
- text = text.Replace("<" + tag.ToUpperInvariant() + ">", string.Empty);
- text = text.Replace("" + tag.ToUpperInvariant() + ">", string.Empty);
- }
- else
- {
- int indexOfEndBracket = text.IndexOf('}');
- if (text.StartsWith("{\\", StringComparison.Ordinal) && indexOfEndBracket > 1 && indexOfEndBracket < 6)
- {
- text = $"{text.Substring(0, indexOfEndBracket + 1)}<{tag}>{text.Remove(0, indexOfEndBracket + 1)}{tag}>";
- }
- else
- {
- text = $"<{tag}>{text}{tag}>";
- }
- }
- return text;
- }
-
- public static Color GetColorFromString(string color)
- {
- Color c = Color.White;
- try
- {
- if (color.StartsWith("rgb(", StringComparison.Ordinal))
- {
- string[] arr = color.Remove(0, 4).TrimEnd(')').Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- c = Color.FromArgb(int.Parse(arr[0]), int.Parse(arr[1]), int.Parse(arr[2]));
- }
- else
- {
- c = ColorTranslator.FromHtml(color);
- }
- }
- catch
- {
- // ignored
- }
-
- return c;
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/INIFile.cs b/MsmhTools/MsmhTools/INIFile.cs
deleted file mode 100644
index 4eb7aef..0000000
--- a/MsmhTools/MsmhTools/INIFile.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- public class INIFile
- {
- private string Path;
- private string? EXE = Assembly.GetExecutingAssembly().GetName().Name;
-
- [DllImport("kernel32", CharSet = CharSet.Unicode)]
- private static extern long WritePrivateProfileString(string? Section, string? Key, string? Value, string FilePath);
-
- [DllImport("kernel32", CharSet = CharSet.Unicode)]
- private static extern int GetPrivateProfileString(string? Section, string Key, string Default, StringBuilder RetVal, int Size, string FilePath);
-
- public INIFile(string? IniPath = null)
- {
- Path = new FileInfo(IniPath ?? EXE + ".ini").FullName;
- }
-
- public string Read(string Key, string? Section = null)
- {
- var RetVal = new StringBuilder(255);
- GetPrivateProfileString(Section ?? EXE, Key, "", RetVal, 255, Path);
- return RetVal.ToString();
- }
-
- public void Write(string? Key, string? Value, string? Section = null)
- {
- WritePrivateProfileString(Section ?? EXE, Key, Value, Path);
- }
-
- public void DeleteKey(string Key, string? Section = null)
- {
- Write(Key, null, Section ?? EXE);
- }
-
- public void DeleteSection(string? Section = null)
- {
- Write(null, null, Section ?? EXE);
- }
-
- public bool KeyExists(string Key, string? Section = null)
- {
- return Read(Key, Section).Length > 0;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/Info.cs b/MsmhTools/MsmhTools/Info.cs
deleted file mode 100644
index eafee6e..0000000
--- a/MsmhTools/MsmhTools/Info.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using System;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Globalization;
-
-namespace MsmhTools
-{
- public static class Info
- {
- public static readonly string CurrentPath1 = AppContext.BaseDirectory;
- public static readonly string ApplicationName = Path.GetFileName(Application.ExecutablePath);
- public static readonly string ApplicationNameWithoutExtension = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
- public static readonly string ApplicationFullPath = Application.ExecutablePath;
- public static readonly string ApplicationFullPathWithoutExtension = Path.Combine(CurrentPath1, ApplicationNameWithoutExtension);
- public static AssemblyName CallingAssemblyName => Assembly.GetCallingAssembly().GetName();
- public static AssemblyName EntryAssemblyName => Assembly.GetEntryAssembly().GetName();
- public static AssemblyName ExecutingAssemblyName => Assembly.GetExecutingAssembly().GetName();
- public static FileVersionInfo InfoCallingAssembly => FileVersionInfo.GetVersionInfo(Assembly.GetCallingAssembly().Location);
- public static FileVersionInfo InfoEntryAssembly => FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);
- public static FileVersionInfo InfoExecutingAssembly2 => FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
-
- public static FileVersionInfo GetAppInfo(Assembly assembly)
- {
- return FileVersionInfo.GetVersionInfo(assembly.Location);
- }
-
- public static string GetAppGUID()
- {
- Assembly assembly = Assembly.GetExecutingAssembly();
- GuidAttribute attribute = (GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute), true)[0];
- return attribute.Value;
- }
-
- public static string GetUniqueIdString(bool getEncodedId)
- {
- string idPrincipal = Environment.MachineName + Environment.UserName;
- string idDateTime = DateTime.UtcNow.ToString("yyyyMMddHHmmssfffffff", CultureInfo.InvariantCulture);
- string idInt1 = $"{Guid.NewGuid().GetHashCode()}";
- if (idInt1.StartsWith('-')) idInt1 = idInt1.Replace("-", string.Empty);
- string idInt2 = $"{BitConverter.ToInt32(Guid.NewGuid().ToByteArray(), 0)}";
- if (idInt2.StartsWith('-')) idInt2 = idInt2.Replace("-", string.Empty);
- string result = idPrincipal + idDateTime + idInt1 + idInt2;
- return getEncodedId ? EncodingTool.GetSHA512(result).ToLower() : result;
- }
-
- public static int GetUniqueIdInt()
- {
- try
- {
- return Guid.NewGuid().GetHashCode() + BitConverter.ToInt32(Guid.NewGuid().ToByteArray(), 0);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("GetUniqueIdInt: " + ex.Message);
- return Guid.NewGuid().GetHashCode();
- }
- }
-
- ///
- /// 1 if newVersion > oldVersion.
- ///
0 if newVersion = oldVersion.
- ///
-1 if newVersion < oldVersion
- ///
- public static int VersionCompare(string newVersion, string oldVersion)
- {
- var versionNew = new Version(newVersion);
- var versionOld = new Version(oldVersion);
- var result = versionNew.CompareTo(versionOld);
- if (result > 0)
- return 1; // versionNew is greater
- else if (result < 0)
- return -1; // versionOld is greater
- else
- return 0; // versions are equal
- }
-
- public static bool IsRunningOnWindows
- {
- get
- {
- var platform = GetPlatform();
- if (platform == OSPlatform.Windows)
- return true;
- else
- return false;
- }
- }
-
- public static bool IsRunningOnLinux
- {
- get
- {
- var platform = GetPlatform();
- if (platform == OSPlatform.Linux)
- return true;
- else
- return false;
- }
- }
-
- public static bool IsRunningOnMac
- {
- get
- {
- var platform = GetPlatform();
- if (platform == OSPlatform.OSX)
- return true;
- else
- return false;
- }
- }
-
- private static OSPlatform GetPlatform()
- {
- // Current versions of Mono report MacOSX platform as Unix
- return Environment.OSVersion.Platform == PlatformID.MacOSX || (Environment.OSVersion.Platform == PlatformID.Unix && Directory.Exists("/Applications") && Directory.Exists("/System") && Directory.Exists("/Users"))
- ? OSPlatform.OSX
- : Environment.OSVersion.Platform == PlatformID.Unix
- ? OSPlatform.Linux
- : OSPlatform.Windows;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/IsolatedStorage.cs b/MsmhTools/MsmhTools/IsolatedStorage.cs
deleted file mode 100644
index 59af8cb..0000000
--- a/MsmhTools/MsmhTools/IsolatedStorage.cs
+++ /dev/null
@@ -1,315 +0,0 @@
-using System;
-using System.IO.IsolatedStorage;
-using System.Text;
-using System.Security.Cryptography;
-using Force.Crc32;
-using System.Diagnostics;
-
-namespace MsmhTools
-{
- public class IsolatedStorage
- {
- //-----------------------------------------------------------------------------------
- public static IDictionary? DicLineByLine(string fileName)
- {
- string? read = ReadIsolatedTextFile(fileName);
- if (read == null) return null;
- string[] split1 = read.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
- IDictionary Dic = new Dictionary();
- int a = 0;
- int b = 1;
- for (; b < split1.Length; a += 2, b += 2)
- {
- if (!Dic.ContainsKey(split1[a]))
- Dic.Add(split1[a], split1[b]);
- }
- return Dic;
- }
- //-----------------------------------------------------------------------------------
- public static List? ListLineByLine(string fileName)
- {
- string? read = ReadIsolatedTextFile(fileName);
- if (read == null) return null;
- string[] split1 = read.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
- List list = new();
- foreach (var line in split1)
- list.Add(line);
- return list;
- // Usage: List items = ListLineByLine();
- }
- //-----------------------------------------------------------------------------------
- public static int? CountLines(string fileName)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- if (isoStore.FileExists(fileName))
- {
- using IsolatedStorageFileStream isoStream = new(fileName, FileMode.Open, isoStore);
- using StreamReader reader = new(isoStream);
- int count = 0;
- while (reader.ReadLine() != null)
- {
- count++;
- }
- isoStore.Close();
- return count;
- }
- return null;
- }
- //-----------------------------------------------------------------------------------
- public static int FilesTotalNumber
- {
- get
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- int count = 0;
- // Retrieve all the files in the directory by calling the GetAllFiles
- foreach (string file in GetAllFiles("*", isoStore))
- {
- if (isoStore.FileExists(file))
- count++;
- }
- return count;
- }
- }
- //-----------------------------------------------------------------------------------
- public static bool IsFileExist(string fileName)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- if (isoStore.FileExists(fileName))
- {
- isoStore.Close();
- //Console.WriteLine("File Exist: " + fileName);
- return true;
- }
- isoStore.Close();
- Debug.WriteLine("File Not Exist: " + fileName);
- return false;
- }
- public static bool IsDirectoryExist(string directoryName)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- if (isoStore.DirectoryExists(directoryName))
- {
- isoStore.Close();
- Debug.WriteLine("Directory Exist: " + directoryName);
- return true;
- }
- isoStore.Close();
- Debug.WriteLine("Directory Not Exist: " + directoryName);
- return false;
- }
- //-----------------------------------------------------------------------------------
- public static string GetCRC32(string fileName)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- if (isoStore.FileExists(fileName))
- {
- IsolatedStorageFileStream isoStream = new(fileName, FileMode.Open, isoStore);
- StreamReader reader = new(isoStream);
- var r = reader.ReadToEnd();
- var bytes = Encoding.UTF8.GetBytes(r);
- uint crc32 = Crc32Algorithm.Compute(bytes);
- reader.Close();
- isoStream.Close();
- isoStore.Close();
- return crc32.ToString();
- }
- Console.WriteLine("File Not Exist: " + fileName);
- return string.Empty;
- }
- //-----------------------------------------------------------------------------------
- public static string GetSHA512(string fileName)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- if (isoStore.FileExists(fileName))
- {
- IsolatedStorageFileStream isoStream = new(fileName, FileMode.Open, isoStore);
- StreamReader reader = new(isoStream);
- var r = reader.ReadToEnd();
- var bytes = Encoding.UTF8.GetBytes(r);
- using var hash = SHA512.Create();
- var hashedInputBytes = hash.ComputeHash(bytes);
- // Convert to text
- // StringBuilder Capacity is 128, because 512 bits / 8 bits in byte * 2 symbols for byte
- var hashedInputStringBuilder = new StringBuilder(128);
- foreach (var b in hashedInputBytes)
- hashedInputStringBuilder.Append(b.ToString("X2"));
- reader.Close();
- isoStream.Close();
- isoStore.Close();
- return hashedInputStringBuilder.ToString();
- }
- return string.Empty;
- }
- //-----------------------------------------------------------------------------------
- public static async void SaveIsolatedTextFile(string fileName, string content, Encoding encoding)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- //if (isoStore.FileExists("multiple_replace.xml")) { isoStore.DeleteFile("multiple_replace.xml"); }
- using IsolatedStorageFileStream isoStream = new(fileName, FileMode.Create, isoStore);
- using StreamWriter writer = new(isoStream, encoding);
- await writer.WriteAsync(content);
- isoStore.Close();
- }
- //-----------------------------------------------------------------------------------
- public static void SaveIsolatedTextFileAppend(string fileName, string content)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- //if (isoStore.FileExists("multiple_replace.xml")) { isoStore.DeleteFile("multiple_replace.xml"); }
- if (isoStore.FileExists(fileName))
- {
- using IsolatedStorageFileStream isoStream = new(fileName, FileMode.Append, isoStore);
- using StreamWriter writer = new(isoStream);
- writer.Write(content);
- }
- else
- {
- using IsolatedStorageFileStream isoStream = new(fileName, FileMode.CreateNew, isoStore);
- using StreamWriter writer = new(isoStream);
- writer.Write(content);
- }
- isoStore.Close();
- }
- //-----------------------------------------------------------------------------------
- public static string? ReadIsolatedTextFile(string fileName)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- //if (isoStore.FileExists("multiple_replace.xml")) { isoStore.DeleteFile("multiple_replace.xml"); }
-
- if (isoStore.FileExists(fileName))
- {
- using IsolatedStorageFileStream isoStream = new(fileName, FileMode.Open, FileAccess.Read, isoStore);
- using StreamReader reader = new(isoStream);
- var r = reader.ReadToEnd();
- isoStore.Close();
- return r;
- }
- else
- {
- Debug.WriteLine("Isolated Storage File Does Not Exist.");
- isoStore.Close();
- return null;
- }
- }
- //-----------------------------------------------------------------------------------
- public static void RemoveIsolatedStorage()
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- try
- {
- isoStore.Remove();
- Debug.WriteLine("Isolated Storage removed.");
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Error: " + ex.Message);
- }
- isoStore.Close();
- isoStore.Dispose();
- }
- //-----------------------------------------------------------------------------------
- public static void DeleteFile(string fileName)
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- // Retrieve all the files in the directory by calling the GetAllFiles
- foreach (string file in GetAllFiles(fileName, isoStore))
- {
- try
- {
- if (isoStore.FileExists(file))
- isoStore.DeleteFile(file);
- if (!isoStore.FileExists(file))
- Debug.WriteLine("File Deleted: " + file);
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Error: " + ex.Message);
- }
- }
- }
- //-----------------------------------------------------------------------------------
- public static void DeleteIsolatedFilesAndDirectories()
- {
- IsolatedStorageFile isoStore = IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null);
- // Retrieve all the files in the directory by calling the GetAllFiles
- foreach (string file in GetAllFiles("*", isoStore))
- {
- try
- {
- if (isoStore.FileExists(file))
- isoStore.DeleteFile(file);
- if (!isoStore.FileExists(file))
- Console.WriteLine("File Deleted: " + file);
- }
- catch (Exception ex)
- {
- Console.WriteLine("Error: " + ex.Message);
- MessageBox.Show("Error: " + ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- // Retrieve all the directories in Isolated Storage by calling the GetAllDirectories
- foreach (string directory in GetAllDirectories("*", isoStore))
- { // Exception will thrown when directory in not empty or exist, so delete directories after deleting files.
- try
- {
- if (isoStore.DirectoryExists(directory))
- isoStore.DeleteDirectory(directory);
- if (!isoStore.DirectoryExists(directory))
- Console.WriteLine("Directory Deleted: " + directory);
- }
- catch (Exception ex)
- {
- Console.WriteLine("Error: " + ex.Message);
- MessageBox.Show("Error: " + ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- }
- //-----------------------------------------------------------------------------------
- // Method to retrieve all directories, recursively, within a store.
- private static List GetAllDirectories(string pattern, IsolatedStorageFile storeFile)
- {
- // Get the root of the search string.
- string root = Path.GetDirectoryName(pattern);
- if (root != "")
- {
- root += "/";
- }
- // Retrieve directories.
- List directoryList = new(storeFile.GetDirectoryNames(pattern));
- // Retrieve subdirectories of matches.
- for (int i = 0, max = directoryList.Count; i < max; i++)
- {
- string directory = directoryList[i] + "/";
- List more = GetAllDirectories(root + directory + "*", storeFile);
- // For each subdirectory found, add in the base path.
- for (int j = 0; j < more.Count; j++)
- {
- more[j] = directory + more[j];
- }
- // Insert the subdirectories into the list and
- // update the counter and upper bound.
- directoryList.InsertRange(i + 1, more);
- i += more.Count;
- max += more.Count;
- }
- return directoryList;
- } // End of GetAllDirectories.
- //-----------------------------------------------------------------------------------
- private static List GetAllFiles(string pattern, IsolatedStorageFile storeFile)
- {
- // Get the root and file portions of the search string.
- string fileString = Path.GetFileName(pattern);
- List fileList = new(storeFile.GetFileNames(pattern));
- // Loop through the subdirectories, collect matches,
- // and make separators consistent.
- foreach (string directory in GetAllDirectories("*", storeFile))
- {
- foreach (string file in storeFile.GetFileNames(directory + "/" + fileString))
- {
- fileList.Add((directory + "/" + file));
- }
- }
- return fileList;
- } // End of GetAllFiles.
- }
-}
diff --git a/MsmhTools/MsmhTools/Network.cs b/MsmhTools/MsmhTools/Network.cs
deleted file mode 100644
index a6a6a80..0000000
--- a/MsmhTools/MsmhTools/Network.cs
+++ /dev/null
@@ -1,910 +0,0 @@
-using Microsoft.Win32;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Globalization;
-using System.Linq;
-using System.Management;
-using System.Net;
-using System.Net.NetworkInformation;
-using System.Net.Sockets;
-using System.Runtime.InteropServices;
-using System.Security.Cryptography;
-using System.Security.Cryptography.X509Certificates;
-using System.Text;
-
-namespace MsmhTools
-{
- public static class Network
- {
- public static int GetNextPort(int currentPort)
- {
- currentPort = currentPort < 65535 ? currentPort + 1 : currentPort - 1;
- return currentPort;
- }
-
- public static Uri? UrlToUri(string url)
- {
- try
- {
- string[] split1 = url.Split("//");
- string prefix = "https://";
- for (int n1 = 0; n1 < split1.Length; n1++)
- {
- if (n1 > 0)
- {
- prefix += split1[n1];
- if (n1 < split1.Length - 1)
- prefix += "//";
- }
- }
-
- Uri uri = new(prefix);
- return uri;
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- return null;
- }
-
- public static void GetUrlDetails(string url, int defaultPort, out string host, out int port, out string path, out bool isIPv6)
- {
- url = url.Trim();
-
- // Strip xxxx://
- if (url.Contains("//"))
- {
- string[] split = url.Split("//");
- if (!string.IsNullOrEmpty(split[1]))
- url = split[1];
- }
-
- GetHostDetails(url, defaultPort, out host, out port, out path, out isIPv6);
- }
-
- public static void GetHostDetails(string hostIpPort, int defaultPort, out string host, out int port, out string path, out bool isIPv6)
- {
- hostIpPort = hostIpPort.Trim();
- path = string.Empty;
- isIPv6 = false;
-
- // Strip /xxxx (Path)
- if (!hostIpPort.Contains("//") && hostIpPort.Contains('/'))
- {
- string[] split = hostIpPort.Split('/');
- if (!string.IsNullOrEmpty(split[0]))
- hostIpPort = split[0];
-
- // Get Path
- string outPath = "/";
- for (int n = 0; n < split.Length; n++)
- {
- if (n != 0)
- outPath += split[n];
- }
- if (!outPath.Equals("/"))
- path = outPath;
- }
-
- string host0 = hostIpPort;
- port = defaultPort;
-
- // Split Host and Port
- if (hostIpPort.Contains('[') && hostIpPort.Contains("]:")) // IPv6 + Port
- {
- string[] split = hostIpPort.Split("]:");
- if (split.Length == 2)
- {
- isIPv6 = true;
- host0 = $"{split[0]}]";
- bool isInt = int.TryParse(split[1], out int result);
- if (isInt) port = result;
- }
- }
- else if (hostIpPort.Contains('[') && hostIpPort.Contains(']')) // IPv6
- {
- string[] split = hostIpPort.Split(']');
- if (split.Length == 2)
- {
- isIPv6 = true;
- host0 = $"{split[0]}]";
- }
- }
- else if (!hostIpPort.Contains('[') && !hostIpPort.Contains(']') && hostIpPort.Contains(':')) // Host + Port OR IPv4 + Port
- {
- string[] split = hostIpPort.Split(':');
- if (split.Length == 2)
- {
- host0 = split[0];
- bool isInt = int.TryParse(split[1], out int result);
- if (isInt) port = result;
- }
- }
-
- host = host0;
- }
-
- public static IPAddress? HostToIP(string host, bool getIPv6 = false)
- {
- IPAddress? result = null;
-
- try
- {
- //IPAddress[] ipAddresses = Dns.GetHostEntry(host).AddressList;
- IPAddress[] ipAddresses = Dns.GetHostAddresses(host);
-
- if (ipAddresses == null || ipAddresses.Length == 0)
- return null;
-
- if (!getIPv6)
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetwork)
- {
- result = ipAddresses[n];
- break;
- }
- }
- }
- else
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetworkV6)
- {
- result = ipAddresses[n];
- break;
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- return result;
- }
-
- public static List? HostToIPs(string host, bool getIPv6 = false)
- {
- List? result = new();
-
- try
- {
- //IPAddress[] ipAddresses = Dns.GetHostEntry(host).AddressList;
- IPAddress[] ipAddresses = Dns.GetHostAddresses(host);
-
- if (ipAddresses == null || ipAddresses.Length == 0)
- return null;
-
- if (!getIPv6)
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetwork)
- {
- result.Add(ipAddresses[n]);
- }
- }
- }
- else
- {
- for (int n = 0; n < ipAddresses.Length; n++)
- {
- var addressFamily = ipAddresses[n].AddressFamily;
- if (addressFamily == AddressFamily.InterNetworkV6)
- {
- result.Add(ipAddresses[n]);
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
-
- return result.RemoveDuplicates();
- }
-
- ///
- /// Uses ipinfo.io to get result
- ///
- /// IP to check
- /// Use proxy to connect
- /// Company name
- public static async Task IpToCompanyAsync(IPAddress iPAddress, string? proxyScheme = null)
- {
- string? company = null;
- try
- {
- using SocketsHttpHandler socketsHttpHandler = new();
- if (proxyScheme != null)
- socketsHttpHandler.Proxy = new WebProxy(proxyScheme, true);
- using HttpClient httpClient2 = new(socketsHttpHandler);
- company = await httpClient2.GetStringAsync("https://ipinfo.io/" + iPAddress.ToString() + "/org");
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- return company;
- }
-
- public static IPAddress? GetLocalIPv4(string remoteHostToCheck = "8.8.8.8")
- {
- try
- {
- IPAddress? localIP;
- using Socket socket = new(AddressFamily.InterNetwork, SocketType.Dgram, 0);
- socket.Connect(remoteHostToCheck, 80);
- IPEndPoint? endPoint = socket.LocalEndPoint as IPEndPoint;
- localIP = endPoint?.Address;
- return localIP;
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- return null;
- }
- }
-
- public static IPAddress? GetLocalIPv6(string remoteHostToCheck = "8.8.8.8")
- {
- try
- {
- IPAddress? localIP;
- using Socket socket = new(AddressFamily.InterNetworkV6, SocketType.Dgram, 0);
- socket.Connect(remoteHostToCheck, 80);
- IPEndPoint? endPoint = socket.LocalEndPoint as IPEndPoint;
- localIP = endPoint?.Address;
- return localIP;
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- return null;
- }
- }
-
- public static IPAddress? GetDefaultGateway()
- {
- IPAddress? gateway = NetworkInterface
- .GetAllNetworkInterfaces()
- .Where(n => n.OperationalStatus == OperationalStatus.Up)
- .Where(n => n.NetworkInterfaceType != NetworkInterfaceType.Loopback)
- .SelectMany(n => n?.GetIPProperties()?.GatewayAddresses)
- .Select(g => g?.Address)
- .Where(a => a != null)
- .Where(a => a?.AddressFamily == AddressFamily.InterNetwork)
- //.Where(a => Array.FindIndex(a.GetAddressBytes(), b => b != 0) >= 0) // Filter out 0.0.0.0
- .FirstOrDefault();
- return gateway;
- }
-
- [DllImport("iphlpapi.dll", CharSet = CharSet.Auto)]
- private static extern int GetBestInterface(uint destAddr, out uint bestIfIndex);
- public static IPAddress? GetGatewayForDestination(IPAddress destinationAddress)
- {
- uint destaddr = BitConverter.ToUInt32(destinationAddress.GetAddressBytes(), 0);
-
- int result = GetBestInterface(destaddr, out uint interfaceIndex);
- if (result != 0)
- {
- Debug.WriteLine(new Win32Exception(result));
- return null;
- }
-
- foreach (var ni in NetworkInterface.GetAllNetworkInterfaces())
- {
- var niprops = ni.GetIPProperties();
- if (niprops == null)
- continue;
-
- var gateway = niprops.GatewayAddresses?.FirstOrDefault()?.Address;
- if (gateway == null)
- continue;
-
- if (ni.Supports(NetworkInterfaceComponent.IPv4))
- {
- var v4props = niprops.GetIPv4Properties();
- if (v4props == null)
- continue;
-
- if (v4props.Index == interfaceIndex)
- return gateway;
- }
-
- if (ni.Supports(NetworkInterfaceComponent.IPv6))
- {
- var v6props = niprops.GetIPv6Properties();
- if (v6props == null)
- continue;
-
- if (v6props.Index == interfaceIndex)
- return gateway;
- }
- }
-
- return null;
- }
-
- public static bool IsIPv4(IPAddress iPAddress)
- {
- if (iPAddress.AddressFamily == AddressFamily.InterNetwork)
- return true;
- else
- return false;
- }
-
- public static bool IsIPv4Valid(string ipString, out IPAddress? iPAddress)
- {
- iPAddress = null;
- if (string.IsNullOrWhiteSpace(ipString)) return false;
- if (!ipString.Contains('.')) return false;
- if (ipString.Count(c => c == '.') != 3) return false;
- if (ipString.StartsWith('.')) return false;
- if (ipString.EndsWith('.')) return false;
- string[] splitValues = ipString.Split('.');
- if (splitValues.Length != 4) return false;
-
- foreach (string splitValue in splitValues)
- {
- // 0x and 0xx are not valid
- if (splitValue.Length > 1)
- {
- bool isInt1 = int.TryParse(splitValue.AsSpan(0, 1), out int first);
- if (isInt1 && first == 0) return false;
- }
-
- bool isInt2 = int.TryParse(splitValue, out int testInt);
- if (!isInt2) return false;
- if (testInt < 0 || testInt > 255) return false;
- }
-
- bool isIP = IPAddress.TryParse(ipString, out IPAddress? outIP);
- if (!isIP) return false;
- iPAddress = outIP;
- return true;
- }
-
- public static bool IsIPv6(IPAddress iPAddress)
- {
- return iPAddress.AddressFamily == AddressFamily.InterNetworkV6;
- }
-
- public static bool IsPortOpen(string host, int port, double timeoutSeconds)
- {
- try
- {
- using TcpClient client = new();
- var result = client.BeginConnect(host, port, null, null);
- bool success = result.AsyncWaitHandle.WaitOne(TimeSpan.FromSeconds(timeoutSeconds));
- client.EndConnect(result);
- return success;
- }
- catch (Exception)
- {
- return false;
- }
- }
-
- public static List GetNetworkInterfacesIPv4(bool upAndRunning = true)
- {
- List nicList = new();
- NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
- for (int n1 = 0; n1 < networkInterfaces.Length; n1++)
- {
- NetworkInterface nic = networkInterfaces[n1];
- if (nic.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
- {
- var unicastAddresses = nic.GetIPProperties().UnicastAddresses;
- for (int n2 = 0; n2 < unicastAddresses.Count; n2++)
- {
- var unicastAddress = unicastAddresses[n2];
- if (unicastAddress.Address.AddressFamily == AddressFamily.InterNetwork)
- {
- if (upAndRunning)
- {
- if (nic.OperationalStatus == OperationalStatus.Up)
- {
- nicList.Add(nic);
- break;
- }
- }
- else
- {
- nicList.Add(nic);
- break;
- }
- }
- }
- }
- }
- return nicList;
- }
-
- public static NetworkInterface? GetNICByName(string name)
- {
- NetworkInterface? nic = null;
- NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
- for (int n = 0; n < networkInterfaces.Length; n++)
- {
- nic = networkInterfaces[n];
- if (nic.Name.Equals(name))
- return nic;
- }
- return nic;
- }
-
- public static NetworkInterface? GetNICByDescription(string description)
- {
- NetworkInterface? nic = null;
- NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
- for (int n = 0; n < networkInterfaces.Length; n++)
- {
- nic = networkInterfaces[n];
- if (nic.Description.Equals(description))
- return nic;
- }
- return nic;
- }
-
- ///
- /// Set's the DNS Server of the local machine
- ///
- /// NIC address
- /// Comma seperated list of DNS server addresses
- /// Requires a reference to the System.Management namespace
- public static void SetDNS(NetworkInterface nic, string dnsServers)
- {
- // Requires Elevation
- // Only netsh can set DNS on Windows 7
- if (nic == null) return;
-
- try
- {
- string dnsServer1 = dnsServers;
- string dnsServer2 = string.Empty;
- if (dnsServers.Contains(','))
- {
- string[] split = dnsServers.Split(',');
- dnsServer1 = split[0];
- dnsServer2 = split[1];
- }
-
- string processName = "netsh";
- string processArgs1 = $"interface ipv4 delete dnsservers {nic.Name} all";
- string processArgs2 = $"interface ipv4 set dnsservers {nic.Name} static {dnsServer1} primary";
- string processArgs3 = $"interface ipv4 add dnsservers {nic.Name} {dnsServer2} index=2";
- ProcessManager.Execute(out Process _, processName, processArgs1, true, true);
- ProcessManager.Execute(out Process _, processName, processArgs2, true, true);
- if (!string.IsNullOrEmpty(dnsServer2))
- ProcessManager.Execute(out Process _, processName, processArgs3, true, true);
- }
- catch (Exception e)
- {
- Debug.WriteLine(e.Message);
- }
-
- Task.Delay(200).Wait();
-
- try
- {
- using ManagementClass managementClass = new("Win32_NetworkAdapterConfiguration");
- using ManagementObjectCollection moc = managementClass.GetInstances();
- foreach (ManagementObject mo in moc)
- {
- if ((bool)mo["IPEnabled"] && mo["Description"].Equals(nic.Description))
- {
- using ManagementBaseObject newDNS = mo.GetMethodParameters("SetDNSServerSearchOrder");
- if (newDNS != null)
- {
- newDNS["DNSServerSearchOrder"] = dnsServers.Split(',');
- mo.InvokeMethod("SetDNSServerSearchOrder", newDNS, null);
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- }
-
- ///
- /// Unset DNS to DHCP
- ///
- /// Network Interface
- public static void UnsetDNS(NetworkInterface nic)
- {
- // Requires Elevation - Can't Unset DNS when there is no Internet connectivity but netsh can :)
- // NetSh Command: netsh interface ip set dns "nic.Name" source=dhcp
- if (nic == null) return;
-
- try
- {
- string processName = "netsh";
- string processArgs1 = $"interface ipv4 delete dnsservers {nic.Name} all";
- string processArgs2 = $"interface ipv4 set dnsservers {nic.Name} source=dhcp";
- ProcessManager.Execute(out Process _, processName, processArgs1, true, true);
- ProcessManager.Execute(out Process _, processName, processArgs2, true, true);
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
-
- try
- {
- using ManagementClass managementClass = new("Win32_NetworkAdapterConfiguration");
- using ManagementObjectCollection moc = managementClass.GetInstances();
- foreach (ManagementObject mo in moc)
- {
- if (mo["Description"].Equals(nic.Description))
- {
- using ManagementBaseObject newDNS = mo.GetMethodParameters("SetDNSServerSearchOrder");
- if (newDNS != null)
- {
- newDNS["DNSServerSearchOrder"] = null;
- mo.InvokeMethod("SetDNSServerSearchOrder", newDNS, null);
- }
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- }
-
- ///
- /// Unset DNS by seting DNS to Static
- ///
- /// Network Interface
- /// Primary
- /// Secondary
- public static void UnsetDNS(NetworkInterface nic, string dns1, string dns2)
- {
- string dnsServers = $"{dns1},{dns2}";
- SetDNS(nic, dnsServers);
- }
-
- ///
- /// Check if DNS is set to Static or DHCP
- ///
- /// Network Interface
- /// Primary DNS Server
- /// Secondary DNS Server
- /// True = Static, False = DHCP
- public static bool IsDnsSet(NetworkInterface nic, out string dnsServer1, out string dnsServer2)
- {
- dnsServer1 = dnsServer2 = string.Empty;
- if (nic == null) return false;
-
- string processName = "netsh";
- string processArgs = $"interface ipv4 show dnsservers {nic.Name}";
- string stdout = ProcessManager.Execute(out Process _, processName, processArgs, true, false);
-
- List lines = stdout.SplitToLines();
- for (int n = 0; n < lines.Count; n++)
- {
- string line = lines[n];
- // Get Primary
- if (line.Contains(": ") && line.Contains('.') && line.Count(c => c == '.') == 3)
- {
- string[] split = line.Split(": ");
- if (split.Length > 1)
- {
- dnsServer1 = split[1].Trim();
- Debug.WriteLine($"DNS 1: {dnsServer1}");
- }
- }
-
- // Get Secondary
- if (!line.Contains(": ") && line.Contains('.') && line.Count(c => c == '.') == 3)
- {
- dnsServer2 = line.Trim();
- Debug.WriteLine($"DNS 2: {dnsServer2}");
- }
- }
- //Debug.WriteLine(stdout);
- return !stdout.Contains("DHCP");
- }
-
- public static bool IsInternetAlive(string? url = null, int timeoutMs = 5000)
- {
- // Attempt 1
- // only recognizes changes related to Internet adapters
- if (NetworkInterface.GetIsNetworkAvailable())
- {
- // however, this will include all adapters -- filter by opstatus and activity
- NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
- bool attempt1 = (from face in interfaces
- where face.OperationalStatus == OperationalStatus.Up
- where (face.NetworkInterfaceType != NetworkInterfaceType.Tunnel) && (face.NetworkInterfaceType != NetworkInterfaceType.Loopback)
- select face.GetIPv4Statistics()).Any(statistics => (statistics.BytesReceived > 0) && (statistics.BytesSent > 0));
-
- return attempt1 ? true : attempt2(url, timeoutMs);
- }
- else
- {
- return attempt2(url, timeoutMs);
- }
-
- // Attempt 2
- static bool attempt2(string? url = null, int timeoutMs = 5000)
- {
- try
- {
- url ??= CultureInfo.InstalledUICulture switch
- {
- { Name: var n } when n.StartsWith("fa") => // Iran
- "http://www.google.com",
- { Name: var n } when n.StartsWith("zh") => // China
- "http://www.baidu.com",
- _ =>
- "http://www.gstatic.com/generate_204",
- };
-
- using HttpClient httpClient = new();
- httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutMs);
- var req = httpClient.GetAsync(url);
- return req.Result.IsSuccessStatusCode;
- }
- catch(Exception ex)
- {
- Debug.WriteLine("IsInternetAlive: " + ex.Message);
- return false;
- }
- }
- }
-
- public static bool IsInternetAlive2(string? url = null, int timeoutMs = 5000)
- {
- try
- {
- url ??= CultureInfo.InstalledUICulture switch
- {
- { Name: var n } when n.StartsWith("fa") => // Iran
- "http://www.google.com",
- { Name: var n } when n.StartsWith("zh") => // China
- "http://www.baidu.com",
- _ =>
- "http://www.gstatic.com/generate_204",
- };
-
- using HttpClient httpClient = new();
- httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutMs);
- var req = httpClient.GetAsync(url);
- return req.Result.IsSuccessStatusCode;
- }
- catch
- {
- return false;
- }
- }
-
- public static bool IsProxySet(out string httpProxy, out string httpsProxy, out string ftpProxy, out string socksProxy)
- {
- bool isProxyEnable = false;
- httpProxy = httpsProxy = ftpProxy = socksProxy = string.Empty;
- RegistryKey? registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", false);
- if (registry != null)
- {
- // ProxyServer
- object? proxyServerObj = registry.GetValue("ProxyServer");
- if (proxyServerObj != null)
- {
- string? proxyServers = proxyServerObj.ToString();
- if (proxyServers != null)
- {
- if (proxyServers.Contains(';'))
- {
- string[] split = proxyServers.Split(';');
- for (int n = 0; n < split.Length; n++)
- {
- string server = split[n];
- if (server.StartsWith("http=")) httpProxy = server[5..];
- else if (server.StartsWith("https=")) httpsProxy = server[6..];
- else if (server.StartsWith("ftp=")) ftpProxy = server[4..];
- else if (server.StartsWith("socks=")) socksProxy = server[6..];
- }
- }
- else if (proxyServers.Contains('='))
- {
- string[] split = proxyServers.Split('=');
- if (split[0] == "http") httpProxy = split[1];
- else if (split[0] == "https") httpsProxy = split[1];
- else if (split[0] == "ftp") ftpProxy = split[1];
- else if (split[0] == "socks") socksProxy = split[1];
- }
- else if (proxyServers.Contains("://"))
- {
- string[] split = proxyServers.Split("://");
- if (split[0] == "http") httpProxy = split[1];
- else if (split[0] == "https") httpsProxy = split[1];
- else if (split[0] == "ftp") ftpProxy = split[1];
- else if (split[0] == "socks") socksProxy = split[1];
- }
- else if (!string.IsNullOrEmpty(proxyServers)) httpProxy = proxyServers;
- }
- }
-
- // ProxyEnable
- object? proxyEnableObj = registry.GetValue("ProxyEnable");
- if (proxyEnableObj != null)
- {
- string? proxyEnable = proxyEnableObj.ToString();
- if (proxyEnable != null)
- {
- bool isInt = int.TryParse(proxyEnable, out int value);
- if (isInt)
- isProxyEnable = value == 1;
- }
- }
-
- }
- return isProxyEnable;
- }
-
-
- public static void SetHttpProxy(string ip, int port)
- {
- RegistryKey? registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
- if (registry != null)
- {
- string proxyServer = $"{ip}:{port}";
-
- try
- {
- registry.SetValue("ProxyEnable", 1, RegistryValueKind.DWord);
- registry.SetValue("ProxyServer", proxyServer, RegistryValueKind.String);
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Set Http Proxy: {ex.Message}");
- }
-
- RegistryTool.ApplyRegistryChanges();
- }
- }
-
- ///
- /// Unset Internet Options Proxy
- ///
- /// Clear IP and Port
- /// Don't apply registry changes on app exit
- public static void UnsetProxy(bool clearIpPort, bool applyRegistryChanges)
- {
- RegistryKey? registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
- if (registry != null)
- {
- try
- {
- registry.SetValue("ProxyEnable", 0, RegistryValueKind.DWord);
- if (clearIpPort)
- registry.SetValue("ProxyServer", "", RegistryValueKind.String);
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Unset Proxy: {ex.Message}");
- }
-
- if (applyRegistryChanges)
- RegistryTool.ApplyRegistryChanges();
- }
- }
-
- ///
- /// Only the 'http', 'socks4', 'socks4a' and 'socks5' schemes are allowed for proxies.
- ///
- ///
- public static async Task CheckProxyWorks(string websiteToCheck, string proxyScheme, int timeoutSec)
- {
- try
- {
- Uri uri = new(websiteToCheck, UriKind.Absolute);
-
- using SocketsHttpHandler socketsHttpHandler = new();
- socketsHttpHandler.Proxy = new WebProxy(proxyScheme);
- using HttpClient httpClientWithProxy = new(socketsHttpHandler);
- httpClientWithProxy.Timeout = new TimeSpan(0, 0, timeoutSec);
-
- HttpResponseMessage checkingResponse = await httpClientWithProxy.GetAsync(uri);
- Task.Delay(200).Wait();
-
- return checkingResponse.IsSuccessStatusCode;
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Check Proxy: {ex.Message}");
- return false;
- }
- }
-
- public static bool CanPing(string host, int timeoutMS)
- {
- var task = Task.Run(() =>
- {
- try
- {
- Ping ping = new();
- PingReply reply = ping.Send(host, timeoutMS);
- if (reply == null) return false;
-
- return reply.Status == IPStatus.Success;
- }
- catch (PingException ex)
- {
- Debug.WriteLine($"Ping: {ex.Message}");
- return false;
- }
- });
-
- if (task.Wait(TimeSpan.FromMilliseconds(timeoutMS + 500)))
- return task.Result;
- else
- return false;
- }
-
- public static bool CanTcpConnect(string host, int port, int timeoutMS)
- {
- var task = Task.Run(() =>
- {
- try
- {
- using TcpClient client = new(host, port);
- client.SendTimeout = timeoutMS;
- return true;
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"CanTcpConnect: {ex.Message}");
- return false;
- }
- });
-
- if (task.Wait(TimeSpan.FromMilliseconds(timeoutMS + 500)))
- return task.Result;
- else
- return false;
- }
-
- public static async Task CanConnect(string host, int port, int timeoutMS)
- {
- var task = Task.Run(async () =>
- {
- try
- {
- string url = $"https://{host}:{port}";
- Uri uri = new(url, UriKind.Absolute);
-
- using HttpClient httpClient = new();
- httpClient.Timeout = TimeSpan.FromMilliseconds(timeoutMS);
-
- await httpClient.GetAsync(uri);
-
- return true;
- }
- catch (Exception)
- {
- return false;
- }
- });
-
- if (await task.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS + 500)))
- return task.Result;
- else
- return false;
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/OpenLinks.cs b/MsmhTools/MsmhTools/OpenLinks.cs
deleted file mode 100644
index 4fff8c5..0000000
--- a/MsmhTools/MsmhTools/OpenLinks.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using System.Diagnostics;
-
-namespace MsmhTools
-{
- public static class OpenLinks
- {
- public static void OpenFolderFromFileName(string fileName)
- {
- string folderName = Path.GetDirectoryName(fileName);
- if (Info.IsRunningOnWindows)
- {
- var argument = @"/select, " + fileName;
- Process.Start("explorer.exe", argument);
- }
- else
- {
- OpenFolder(folderName);
- }
- }
-
- public static void OpenFolder(string folder)
- {
- OpenItem(folder, "folder");
- }
-
- public static void OpenUrl(string url)
- {
- OpenItem(url, "url");
- }
-
- public static void OpenFile(string file)
- {
- OpenItem(file, "file");
- }
-
- public static void OpenItem(string item, string type)
- {
- try
- {
- if (Info.IsRunningOnWindows || Info.IsRunningOnMac)
- {
- var startInfo = new ProcessStartInfo(item)
- {
- UseShellExecute = true
- };
-
- Process.Start(startInfo);
- }
- else if (Info.IsRunningOnLinux)
- {
- var process = new Process
- {
- EnableRaisingEvents = false,
- StartInfo = { FileName = "xdg-open", Arguments = item }
- };
- process.Start();
- }
- }
- catch (Exception exception)
- {
- MessageBox.Show($"Cannot open {type}: {item}{Environment.NewLine}{Environment.NewLine}{exception.Source}: {exception.Message}", "Error opening URL", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/ProcessManager.cs b/MsmhTools/MsmhTools/ProcessManager.cs
deleted file mode 100644
index ec88d79..0000000
--- a/MsmhTools/MsmhTools/ProcessManager.cs
+++ /dev/null
@@ -1,534 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Diagnostics;
-using System.Management;
-using System.Security;
-
-namespace MsmhTools
-{
- public static class ProcessManager
- {
- //-----------------------------------------------------------------------------------
-
- ///
- /// Get CPU Usage By Process
- ///
- /// Process
- /// Delay to calculate usage (ms)
- /// Returns -1 if fail
- public static async Task GetCpuUsage(Process process, int delay)
- {
- string processName = process.ProcessName;
- return await GetCpuUsage(processName, delay);
- }
-
- ///
- /// Get CPU Usage By Process ID
- ///
- /// PID
- /// Delay to calculate usage (ms)
- /// Returns -1 if fail
- public static async Task GetCpuUsage(int pid, int delay)
- {
- string processName = GetProcessNameByPID(pid);
- if (!string.IsNullOrEmpty(processName))
- return await GetCpuUsage(processName, delay);
- return -1;
- }
-
- ///
- /// Get CPU Usage By Process Name
- ///
- /// Process Name
- /// Delay to calculate usage (ms)
- /// Returns -1 if fail
- public static async Task GetCpuUsage(string processName, int delay)
- {
- // To Get CPU Total Usage:
- // new PerformanceCounter("Processor", "% Processor Time", "_Total");
- float result = -1;
-
- await Task.Run(async () =>
- {
- try
- {
-
- using PerformanceCounter performanceCounter = new("Process", "% Processor Time", processName, true);
- performanceCounter.NextValue(); // Returns 0
- await Task.Delay(delay); // Needs time to calculate
- result = performanceCounter.NextValue() / Environment.ProcessorCount;
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Get CPU Usage: {ex.Message}");
- }
- });
-
- return result;
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Send Command to a Process and Get Result
- ///
- /// Process
- /// Commands
- /// Returns True if success
- public static async Task SendCommandAsync(Process process, string command)
- {
- try
- {
- await process.StandardInput.WriteLineAsync(command);
- return true;
- }
- catch (Exception)
- {
- return false;
- }
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Send Command to a Process and Get Result
- ///
- /// Process
- /// Commands
- /// Returns True if success
- public static bool SendCommand(Process process, string command)
- {
- try
- {
- process.StandardInput.WriteLine(command);
- return true;
- }
- catch (Exception)
- {
- return false;
- }
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Send Command to a Process and Get Result
- ///
- /// Process
- /// Commands
- /// Also Redirect Error Output
- /// Returns Stdout and Stderr if success
- public static async Task SendCommandAndGetAnswerAsync(Process process, string command, bool alsoRedirectError)
- {
- string? result;
-
- try
- {
- process.StandardOutput.DiscardBufferedData();
- await process.StandardInput.WriteLineAsync(command);
- result = await process.StandardOutput.ReadLineAsync();
- if (alsoRedirectError)
- {
- result += Environment.NewLine;
- result += await process.StandardError.ReadLineAsync();
- }
- }
- catch (Exception)
- {
- result = null;
- }
-
- return result ?? string.Empty;
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Send Command to a Process and Get Result
- ///
- /// Process
- /// Commands
- /// Also Redirect Error Output
- /// Returns Stdout and Stderr if success
- public static string SendCommandAndGetAnswer(Process process, string command, bool alsoRedirectError)
- {
- string? result;
-
- try
- {
- process.StandardOutput.DiscardBufferedData();
- process.StandardInput.WriteLine(command);
- result = process.StandardOutput.ReadLine();
- if (alsoRedirectError)
- {
- result += Environment.NewLine;
- result += process.StandardError.ReadLine();
- }
- }
- catch (Exception)
- {
- result = null;
- }
-
- return result ?? string.Empty;
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Returns stdout or Stderr after process finished. Set waitForExit to false to get out Process.
- ///
- public static string Execute(out Process process, string processName, string? args = null, bool hideWindow = true, bool runAsAdmin = false, string? workingDirectory = null, ProcessPriorityClass processPriorityClass = ProcessPriorityClass.Normal, bool waitForExit = true)
- {
- // Create process
- Process process0 = new();
- process = process0;
- process0.StartInfo.FileName = processName;
-
- if (args != null)
- process0.StartInfo.Arguments = args;
-
- if (hideWindow)
- {
- process0.StartInfo.CreateNoWindow = true;
- process0.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
- }
- else
- {
- process0.StartInfo.CreateNoWindow = false;
- process0.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
- }
-
- if (runAsAdmin)
- {
- process0.StartInfo.Verb = "runas";
- }
- else
- {
- process0.StartInfo.Verb = "";
- }
-
- // Redirect input output to get ability of sending and reading process output
- process0.StartInfo.UseShellExecute = false;
- process0.StartInfo.RedirectStandardInput = true;
- process0.StartInfo.RedirectStandardOutput = true;
- process0.StartInfo.RedirectStandardError = true;
-
- if (workingDirectory != null)
- process0.StartInfo.WorkingDirectory = workingDirectory;
-
- try
- {
- process0.Start();
-
- // Set process priority
- process0.PriorityClass = processPriorityClass;
-
- string stdout = process0.StandardOutput.ReadToEnd().ReplaceLineEndings(Environment.NewLine);
- string errout = process0.StandardError.ReadToEnd().ReplaceLineEndings(Environment.NewLine);
- //string output = stdout + Environment.NewLine + errout;
-
- // Wait for process to finish
- if (waitForExit)
- process0.WaitForExit();
-
- if (process0.ExitCode == 0)
- {
- return stdout;
- }
- else
- {
- return errout;
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- return string.Empty;
- }
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Execute and returns PID, if faild returns -1
- ///
- public static int ExecuteOnly(out Process process, string processName, string? args = null, bool hideWindow = true, bool runAsAdmin = false, string? workingDirectory = null, ProcessPriorityClass processPriorityClass = ProcessPriorityClass.Normal)
- {
- int pid;
- // Create process
- Process process0 = new();
- process0.StartInfo.FileName = processName;
-
- if (args != null)
- process0.StartInfo.Arguments = args;
-
- if (hideWindow)
- {
- process0.StartInfo.CreateNoWindow = true;
- process0.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
- }
- else
- {
- process0.StartInfo.CreateNoWindow = false;
- process0.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
- }
-
- if (runAsAdmin)
- {
- process0.StartInfo.Verb = "runas";
- }
- else
- {
- process0.StartInfo.Verb = "";
- }
-
- // Redirect input output to get ability of sending and reading process output
- process0.StartInfo.UseShellExecute = false;
- process0.StartInfo.RedirectStandardInput = true;
- process0.StartInfo.RedirectStandardOutput = true;
- process0.StartInfo.RedirectStandardError = true;
-
- if (workingDirectory != null)
- process0.StartInfo.WorkingDirectory = workingDirectory;
-
- try
- {
- process0.Start();
-
- // Set process priority
- process0.PriorityClass = processPriorityClass;
- pid = process0.Id;
- }
- catch (Exception ex)
- {
- pid = -1;
- Debug.WriteLine($"ExecuteOnly: {ex.Message}");
- }
-
- process = process0;
- return pid;
- }
- //-----------------------------------------------------------------------------------
- public static bool FindProcessByName(string processName)
- {
- Process[] processes = Process.GetProcessesByName(processName);
- return processes.Length > 0;
- }
- //-----------------------------------------------------------------------------------
- public static bool FindProcessByPID(int pid)
- {
- bool result = false;
- Process[] processes = Process.GetProcesses();
- for (int n = 0; n < processes.Length; n++)
- {
- if (processes[n].Id == pid)
- {
- result = true;
- break;
- }
- }
- return result;
- }
- //-----------------------------------------------------------------------------------
- public static void KillProcessByName(string processName, bool killEntireProcessTree = false)
- {
- Process[] processes = Process.GetProcessesByName(processName);
- for (int n = 0; n < processes.Length; n++)
- processes[n].Kill(killEntireProcessTree);
- }
- //-----------------------------------------------------------------------------------
- public static void KillProcessByPID(int pid, bool killEntireProcessTree = false)
- {
- try
- {
- if (FindProcessByPID(pid))
- {
- Process process = Process.GetProcessById(pid);
- process.Kill(killEntireProcessTree);
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine(ex.Message);
- }
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Returns first PID, if faild returns -1
- ///
- public static int GetFirstPidByName(string processName)
- {
- int pid = -1;
- Process[] processes = Process.GetProcessesByName(processName);
- for (int n = processes.Length - 1; n >= 0; n--)
- pid = processes[n].Id;
- return pid;
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Returns process PID, if faild returns -1
- ///
- public static int GetProcessPidByListeningPort(int port)
- {
- string netstatArgs = "-a -n -o";
- string? stdout = Execute(out Process _, "netstat", netstatArgs);
- if (!string.IsNullOrWhiteSpace(stdout))
- {
- List lines = stdout.SplitToLines();
- for (int n = 0; n < lines.Count; n++)
- {
- string line = lines[n];
- if (!string.IsNullOrWhiteSpace(line) && line.Contains("LISTENING") && line.Contains($":{port} "))
- {
- string[] split1 = line.Split("LISTENING", StringSplitOptions.TrimEntries);
- bool isBool = int.TryParse(split1[1], out int pid);
- if (isBool)
- {
- return pid;
- }
- }
- }
- }
- return -1;
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Returns process name, if failed returns string.empty
- ///
- public static string GetProcessNameByListeningPort(int port)
- {
- int pid = GetProcessPidByListeningPort(port);
- if (pid != -1)
- {
- try
- {
- return Process.GetProcessById(pid).ProcessName;
- }
- catch (Exception ex)
- {
- Debug.WriteLine("Get Process Name By Listening Port:");
- Debug.WriteLine(ex.Message);
- }
- }
- return string.Empty;
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Get Process By PID
- ///
- /// PID
- /// Returns null if not exist.
- public static Process? GetProcessByPID(int pid)
- {
- Process? result = null;
- Process[] processes = Process.GetProcesses();
- for (int n = 0; n < processes.Length; n++)
- {
- if (processes[n].Id == pid)
- {
- result = processes[n];
- break;
- }
- }
- return result;
- }
- //-----------------------------------------------------------------------------------
- ///
- /// Get Process Name By PID
- ///
- /// PID
- /// Returns string.Empty if not exist.
- public static string GetProcessNameByPID(int pid)
- {
- string result = string.Empty;
- Process? process = GetProcessByPID(pid);
- if (process != null) result = process.ProcessName;
- return result;
- }
- //-----------------------------------------------------------------------------------
- public static string GetArguments(this Process process)
- {
- using ManagementObjectSearcher searcher = new("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + process.Id);
- using ManagementObjectCollection objects = searcher.Get();
- return objects.Cast().SingleOrDefault()?["CommandLine"]?.ToString() ?? string.Empty;
-
- }
- //-----------------------------------------------------------------------------------
- public static void SetProcessPriority(ProcessPriorityClass processPriorityClass)
- {
- Process.GetCurrentProcess().PriorityClass = processPriorityClass;
- }
- //-----------------------------------------------------------------------------------
- [Flags]
- private enum ThreadAccess : int
- {
- TERMINATE = (0x0001),
- SUSPEND_RESUME = (0x0002),
- GET_CONTEXT = (0x0008),
- SET_CONTEXT = (0x0010),
- SET_INFORMATION = (0x0020),
- QUERY_INFORMATION = (0x0040),
- SET_THREAD_TOKEN = (0x0080),
- IMPERSONATE = (0x0100),
- DIRECT_IMPERSONATION = (0x0200)
- }
-
- [DllImport("kernel32.dll")]
- private static extern IntPtr OpenThread(ThreadAccess dwDesiredAccess, bool bInheritHandle, uint dwThreadId);
-
- [DllImport("kernel32.dll")]
- private static extern uint SuspendThread(IntPtr hThread);
-
- [DllImport("kernel32.dll")]
- private static extern int ResumeThread(IntPtr hThread);
-
- [DllImport("kernel32.dll")]
- private static extern int CloseHandle(IntPtr hThread);
-
- public static void ThrottleProcess(int processId, double limitPercent)
- {
- var process = Process.GetProcessById(processId);
- var processName = process.ProcessName;
- var p = new PerformanceCounter("Process", "% Processor Time", processName);
- Task.Run(async () =>
- {
- while (true)
- {
- var interval = 1000;
- p.NextValue();
- await Task.Delay(interval);
- var currentUsage = p.NextValue() / Environment.ProcessorCount;
- Debug.WriteLine(currentUsage);
- if (currentUsage < limitPercent) continue;
- SuspendProcess(processId);
- await Task.Delay(interval);
- ResumeProcess(processId);
- }
- });
- }
- public static void SuspendProcess(int pId)
- {
- var process = Process.GetProcessById(pId);
- SuspendProcess(process);
- }
- public static void SuspendProcess(Process process)
- {
- foreach (ProcessThread thread in process.Threads)
- {
- var pOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)thread.Id);
- if (pOpenThread == IntPtr.Zero)
- {
- break;
- }
- _ = SuspendThread(pOpenThread);
- }
- }
- public static void ResumeProcess(int pId)
- {
- var process = Process.GetProcessById(pId);
- ResumeProcess(process);
- }
- public static void ResumeProcess(Process process)
- {
- foreach (ProcessThread thread in process.Threads)
- {
- var pOpenThread = OpenThread(ThreadAccess.SUSPEND_RESUME, false, (uint)thread.Id);
- if (pOpenThread == IntPtr.Zero)
- {
- break;
- }
- _ = ResumeThread(pOpenThread);
- }
- }
- //-----------------------------------------------------------------------------------
- }
-}
diff --git a/MsmhTools/MsmhTools/ProxifiedTcpClient/HttpProxyClient.cs b/MsmhTools/MsmhTools/ProxifiedTcpClient/HttpProxyClient.cs
deleted file mode 100644
index a659f4a..0000000
--- a/MsmhTools/MsmhTools/ProxifiedTcpClient/HttpProxyClient.cs
+++ /dev/null
@@ -1,542 +0,0 @@
-//
-// Author:
-// Benton Stark
-//
-// Copyright (c) 2016 Benton Stark
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see .
-
-using System;
-using System.Text;
-using System.Net.Sockets;
-using System.Net;
-using System.Threading;
-using System.Globalization;
-using System.ComponentModel;
-using System.Diagnostics;
-
-namespace MsmhTools.ProxifiedTcpClient
-{
- ///
- /// HTTP connection proxy class. This class implements the HTTP standard proxy protocol.
- ///
- /// You can use this class to set up a connection to an HTTP proxy server. Calling the
- /// CreateConnection() method initiates the proxy connection and returns a standard
- /// System.Net.Socks.TcpClient object that can be used as normal. The proxy plumbing
- /// is all handled for you.
- ///
- ///
- ///
- ///
- ///
- public class HttpProxyClient
- {
- private string _proxyHost = IPAddress.Loopback.ToString(); // Default
- private int _proxyPort = 8080; // Default
- private string _proxyUsername = string.Empty;
- private string _proxyPassword = string.Empty;
- private HttpResponseCodes? _respCode;
- private string? _respText;
- private TcpClient? _tcpClient;
- private TcpClient? _tcpClientCached;
- private HttpVersions _httpVersion = HttpVersions.Version1_0;
-
- private const string HTTP_PROXY_CONNECT_CMD = "CONNECT {0}:{1} HTTP/{2}\r\nHOST: {0}:{1}\r\n\r\n";
- private const string HTTP_PROXY_AUTHENTICATE_CMD = "CONNECT {0}:{1} HTTP/{3}\r\nHOST: {0}:{1}\r\nProxy-Authorization: Basic {2}\r\n\r\n";
-
- private const int WAIT_FOR_DATA_INTERVAL = 50; // 50 ms
- private const int WAIT_FOR_DATA_TIMEOUT = 15000; // 15 seconds
- private const string PROXY_NAME = "HTTP";
-
- ///
- /// HTTP header version enumeration.
- ///
- public enum HttpVersions
- {
- ///
- /// Specify HTTP/1.0 version in HTTP header requests.
- ///
- Version1_0,
- ///
- /// Specify HTTP/1.1 version in HTTP header requests.
- ///
- Version1_1,
- }
-
- private enum HttpResponseCodes
- {
- None = 0,
- Continue = 100,
- SwitchingProtocols = 101,
- OK = 200,
- Created = 201,
- Accepted = 202,
- NonAuthoritiveInformation = 203,
- NoContent = 204,
- ResetContent = 205,
- PartialContent = 206,
- MultipleChoices = 300,
- MovedPermanetly = 301,
- Found = 302,
- SeeOther = 303,
- NotModified = 304,
- UserProxy = 305,
- TemporaryRedirect = 307,
- BadRequest = 400,
- Unauthorized = 401,
- PaymentRequired = 402,
- Forbidden = 403,
- NotFound = 404,
- MethodNotAllowed = 405,
- NotAcceptable = 406,
- ProxyAuthenticantionRequired = 407,
- RequestTimeout = 408,
- Conflict = 409,
- Gone = 410,
- PreconditionFailed = 411,
- RequestEntityTooLarge = 413,
- RequestURITooLong = 414,
- UnsupportedMediaType = 415,
- RequestedRangeNotSatisfied = 416,
- ExpectationFailed = 417,
- InternalServerError = 500,
- NotImplemented = 501,
- BadGateway = 502,
- ServiceUnavailable = 503,
- GatewayTimeout = 504,
- HTTPVersionNotSupported = 505
- }
-
- ///
- /// Constructor.
- ///
- public HttpProxyClient() { }
-
- ///
- /// Creates a HTTP proxy client object using the supplied TcpClient object connection.
- ///
- /// A TcpClient connection object.
- public HttpProxyClient(TcpClient tcpClient)
- {
- _tcpClientCached = tcpClient ?? throw new ArgumentNullException(nameof(tcpClient));
- }
-
- ///
- /// Constructor.
- ///
- /// Host name or IP address of the proxy server.
- /// Port number for the proxy server.
- public HttpProxyClient(string proxyHost, int proxyPort)
- {
- if (proxyPort <= 0 || proxyPort > 65535)
- throw new ArgumentOutOfRangeException(nameof(proxyPort), "port must be greater than zero and less than 65535");
-
- _proxyHost = proxyHost ?? throw new ArgumentNullException(nameof(proxyHost));
- _proxyPort = proxyPort;
- }
-
- ///
- /// Constructor.
- ///
- /// Host name or IP address of the proxy server.
- /// Port number to connect to the proxy server.
- /// Username for the proxy server.
- /// Password for the proxy server.
- public HttpProxyClient(string proxyHost, int proxyPort, string? proxyUsername, string? proxyPassword)
- {
- if (proxyPort <= 0 || proxyPort > 65535)
- throw new ArgumentOutOfRangeException(nameof(proxyPort), "port must be greater than zero and less than 65535");
-
- _proxyHost = proxyHost ?? throw new ArgumentNullException(nameof(proxyHost));
- _proxyPort = proxyPort;
-
- if (!string.IsNullOrEmpty(proxyUsername))
- _proxyUsername = proxyUsername;
-
- if (!string.IsNullOrEmpty(proxyPassword))
- _proxyPassword = proxyPassword;
- }
-
- ///
- /// Gets or sets host name or IP address of the proxy server.
- ///
- public string ProxyHost
- {
- get { return _proxyHost; }
- set { _proxyHost = value; }
- }
-
- ///
- /// Gets or sets port number for the proxy server.
- ///
- public int ProxyPort
- {
- get { return _proxyPort; }
- set { _proxyPort = value; }
- }
-
- ///
- /// Gets String representing the name of the proxy.
- ///
- /// This property will always return the value 'HTTP'
- public string ProxyName
- {
- get { return PROXY_NAME; }
- }
-
- ///
- /// Gets or sets the TcpClient object.
- /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection.
- ///
- public TcpClient TcpClient
- {
- //get { return _tcpClientCached; }
- set { _tcpClientCached = value; }
- }
-
- ///
- /// Gets or sets the HTTP header version.
- /// Some proxy servers are very picky about the specific HTTP header version specified in the connection and
- /// authentication strings. The default is version 1.0 but can be changed to version 1.1.
- ///
- public HttpVersions HttpVersion
- {
- get { return _httpVersion; }
- set { _httpVersion = value; }
- }
-
- ///
- /// Creates a remote TCP connection through a proxy server to the destination host on the destination port.
- ///
- /// Destination host name or IP address.
- /// Port number to connect to on the destination host.
- ///
- /// Returns an open TcpClient object that can be used normally to communicate
- /// with the destination server
- ///
- ///
- /// This method creates a connection to the proxy server and instructs the proxy server
- /// to make a pass through connection to the specified destination host on the specified
- /// port.
- ///
- public TcpClient? CreateConnection(string destinationHost, int destinationPort)
- {
- try
- {
- // if we have no cached tcpip connection then create one
- if (_tcpClientCached == null)
- {
- if (string.IsNullOrEmpty(_proxyHost))
- throw new Exception("ProxyHost property must contain a value.");
-
- if (_proxyPort <= 0 || _proxyPort > 65535)
- throw new Exception("ProxyPort value must be greater than zero and less than 65535");
-
- // create new tcp client object to the proxy server
- _tcpClient = new();
-
- // attempt to open the connection
- _tcpClient.Connect(_proxyHost, _proxyPort);
- }
- else
- {
- _tcpClient = _tcpClientCached;
- }
-
- // send connection command to proxy host for the specified destination host and port
- SendConnectionCommand(destinationHost, destinationPort);
-
- // remove the private reference to the tcp client so the proxy object does not keep it
- // return the open proxied tcp client object to the caller for normal use
- TcpClient rtn = _tcpClient;
- _tcpClient = null;
- return rtn;
- }
- catch (SocketException ex)
- {
- string msg;
- if (_tcpClient == null)
- msg = "Tcp Client is null.";
- else
- msg = $"Connection to proxy {Utils.GetHost(_tcpClient)}:{Utils.GetPort(_tcpClient)} failed.";
- Debug.WriteLine($"{msg}{Environment.NewLine}{ex.Message}");
-
- return null;
- }
- }
-
-
- private void SendConnectionCommand(string host, int port)
- {
- if (_tcpClient == null) return;
-
- NetworkStream stream = _tcpClient.GetStream();
-
- string connectCmd = CreateCommandString(host, port);
-
- byte[] request = Encoding.ASCII.GetBytes(connectCmd);
-
- // send the connect request
- stream.Write(request, 0, request.Length);
-
- // wait for the proxy server to respond
- WaitForData(stream);
-
- // PROXY SERVER RESPONSE
- // =======================================================================
- //HTTP/1.0 200 Connection Established
- //[.... other HTTP header lines ending with ..
- //ignore all of them]
- // // Last Empty Line
-
- // create an byte response array
- byte[] response = new byte[_tcpClient.ReceiveBufferSize];
- StringBuilder sbuilder = new();
- int bytes = 0;
- long total = 0;
-
- do
- {
- bytes = stream.Read(response, 0, _tcpClient.ReceiveBufferSize);
- total += bytes;
- sbuilder.Append(Encoding.UTF8.GetString(response, 0, bytes));
- }
- while (stream.DataAvailable);
-
- ParseResponse(sbuilder.ToString());
-
- // evaluate the reply code for an error condition
- if (_respCode != HttpResponseCodes.OK)
- HandleProxyCommandError(host, port);
- }
-
- private string CreateCommandString(string host, int port)
- {
- string connectCmd;
- if (!string.IsNullOrEmpty(_proxyUsername))
- {
- // gets the user/pass into base64 encoded string in the form of [username]:[password]
- string auth = Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", _proxyUsername, _proxyPassword)));
-
- // PROXY SERVER REQUEST
- // =======================================================================
- //CONNECT starksoft.com:443 HTTP/1.0
- //HOST starksoft.com:443
- //Proxy-Authorization: username:password
- // NOTE: username:password string will be base64 encoded as one
- // concatenated string
- //[... other HTTP header lines ending with if required]>
- // // Last Empty Line
- connectCmd = string.Format(CultureInfo.InvariantCulture, HTTP_PROXY_AUTHENTICATE_CMD,
- host, port.ToString(CultureInfo.InvariantCulture), auth, GetHttpVersionString());
- }
- else
- {
- // PROXY SERVER REQUEST
- // =======================================================================
- //CONNECT starksoft.com:443 HTTP/1.0
- //HOST starksoft.com:443
- //[... other HTTP header lines ending with if required]>
- // // Last Empty Line
- connectCmd = string.Format(CultureInfo.InvariantCulture, HTTP_PROXY_CONNECT_CMD,
- host, port.ToString(CultureInfo.InvariantCulture), GetHttpVersionString());
- }
- return connectCmd;
- }
-
- private void HandleProxyCommandError(string host, int port)
- {
- string msg = _respCode switch
- {
- HttpResponseCodes.None => $"Proxy destination {host} on port {port} failed to return a recognized HTTP response code. Server response: {_respText}",
- HttpResponseCodes.BadGateway => $"Proxy destination {host} on port {port} responded with a 502 code - Bad Gateway. If you are connecting to a Microsoft ISA destination please refer to knowledge based article Q283284 for more information. Server response: {_respText}", //HTTP/1.1 502 Proxy Error (The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests.)
- _ => $"Proxy destination {host} on port {port} responded with a {_respCode} code - {_respText}",
- };
-
- Debug.WriteLine(msg);
- }
-
- private void WaitForData(NetworkStream stream)
- {
- int sleepTime = 0;
- while (!stream.DataAvailable)
- {
- Task.Delay(WAIT_FOR_DATA_INTERVAL).Wait();
- sleepTime += WAIT_FOR_DATA_INTERVAL;
- if (sleepTime > WAIT_FOR_DATA_TIMEOUT)
- {
- Debug.WriteLine("Proxy Server didn't respond.");
- break;
- }
- }
- }
-
- private void ParseResponse(string response)
- {
- string[] data;
-
- // Get rid of the LF character if it exists and then split the string on all CR
- data = response.Replace('\n', ' ').Split('\r');
-
- ParseCodeAndText(data[0]);
- }
-
- private void ParseCodeAndText(string line)
- {
- int begin = 0;
- int end = 0;
- string val = string.Empty;
-
- if (!line.Contains("HTTP", StringComparison.CurrentCulture))
- {
- string msg = $"No HTTP response received from proxy destination. Server response: {line}.";
- Debug.WriteLine(msg);
- return;
- }
-
- begin = line.IndexOf(" ") + 1;
- end = line.IndexOf(" ", begin);
-
- val = line[begin..end];
-
- if (!int.TryParse(val, out int code))
- {
- string msg = $"An invalid response code was received from proxy destination. Server response: {line}.";
- Debug.WriteLine(msg);
- return;
- }
-
- _respCode = (HttpResponseCodes)code;
- _respText = line[(end + 1)..].Trim();
- }
-
- private string GetHttpVersionString()
- {
- return _httpVersion switch
- {
- HttpVersions.Version1_0 => "1.0",
- HttpVersions.Version1_1 => "1.1",
- _ => throw new Exception($"Unexpect HTTP version {_httpVersion} specified."),
- };
- }
-
- //Async Methods
- private BackgroundWorker? _asyncWorker;
- private Exception? _asyncException;
- bool _asyncCancelled;
-
- ///
- /// Gets a value indicating whether an asynchronous operation is running.
- ///
- /// Returns true if an asynchronous operation is running; otherwise, false.
- ///
- public bool IsBusy
- {
- get { return _asyncWorker != null && _asyncWorker.IsBusy; }
- }
-
- ///
- /// Gets a value indicating whether an asynchronous operation is cancelled.
- ///
- /// Returns true if an asynchronous operation is cancelled; otherwise, false.
- ///
- public bool IsAsyncCancelled
- {
- get { return _asyncCancelled; }
- }
-
- ///
- /// Cancels any asychronous operation that is currently active.
- ///
- public void CancelAsync()
- {
- if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy)
- {
- _asyncCancelled = true;
- _asyncWorker.CancelAsync();
- }
- }
-
- private void CreateAsyncWorker()
- {
- if (_asyncWorker != null)
- _asyncWorker.Dispose();
- _asyncException = null;
- _asyncWorker = null;
- _asyncCancelled = false;
- _asyncWorker = new();
- }
-
- ///
- /// Event handler for CreateConnectionAsync method completed.
- ///
- public event EventHandler? CreateConnectionAsyncCompleted;
-
- ///
- /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port.
- ///
- /// Destination host name or IP address.
- /// Port number to connect to on the destination host.
- ///
- /// Returns an open TcpClient object that can be used normally to communicate
- /// with the destination server
- ///
- ///
- /// This method creates a connection to the proxy server and instructs the proxy server
- /// to make a pass through connection to the specified destination host on the specified
- /// port.
- ///
- public void CreateConnectionAsync(string destinationHost, int destinationPort)
- {
- if (_asyncWorker != null)
- {
- if (_asyncWorker.IsBusy)
- throw new InvalidOperationException("The HttpProxy object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time.");
-
- CreateAsyncWorker();
- _asyncWorker.WorkerSupportsCancellation = true;
- _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork);
- _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted);
- object[] args = new object[2];
- args[0] = destinationHost;
- args[1] = destinationPort;
- _asyncWorker.RunWorkerAsync(args);
- }
- }
-
- private void CreateConnectionAsync_DoWork(object? sender, DoWorkEventArgs e)
- {
- try
- {
- if (e.Argument != null)
- {
- object[] args = (object[])e.Argument;
- e.Result = CreateConnection((string)args[0], (int)args[1]);
- }
- }
- catch (Exception ex)
- {
- _asyncException = ex;
- }
- }
-
- private void CreateConnectionAsync_RunWorkerCompleted(object? sender, RunWorkerCompletedEventArgs e)
- {
- if (e.Result != null)
- CreateConnectionAsyncCompleted?.Invoke(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result));
- }
-
-
- }
-}
diff --git a/MsmhTools/MsmhTools/ProxifiedTcpClient/Socks5ProxyClient.cs b/MsmhTools/MsmhTools/ProxifiedTcpClient/Socks5ProxyClient.cs
deleted file mode 100644
index 180352f..0000000
--- a/MsmhTools/MsmhTools/ProxifiedTcpClient/Socks5ProxyClient.cs
+++ /dev/null
@@ -1,684 +0,0 @@
-//
-// Author:
-// Benton Stark
-//
-// Copyright (c) 2016 Benton Stark
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with this program. If not, see .
-
-using System;
-using System.Text;
-using System.Net;
-using System.Net.Sockets;
-using System.ComponentModel;
-using System.Diagnostics;
-
-namespace MsmhTools.ProxifiedTcpClient
-{
- ///
- /// Socks5 connection proxy class. This class implements the Socks5 standard proxy protocol.
- ///
- ///
- /// This implementation supports TCP proxy connections with a Socks v5 server.
- ///
- public class Socks5ProxyClient
- {
- private string _proxyHost = IPAddress.Loopback.ToString(); // Default
- private int _proxyPort = 1080; // Default
- private string _proxyUsername = string.Empty;
- private string _proxyPassword = string.Empty;
- private SocksAuthentication? _proxyAuthMethod;
- private TcpClient? _tcpClient;
- private TcpClient? _tcpClientCached;
-
- private const string PROXY_NAME = "SOCKS5";
-
- private const byte SOCKS5_VERSION_NUMBER = 5;
- private const byte SOCKS5_RESERVED = 0x00;
- private const byte SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED = 2;
- private const byte SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED = 0x00;
- private const byte SOCKS5_AUTH_METHOD_GSSAPI = 0x01;
- private const byte SOCKS5_AUTH_METHOD_USERNAME_PASSWORD = 0x02;
- private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_BEGIN = 0x03;
- private const byte SOCKS5_AUTH_METHOD_IANA_ASSIGNED_RANGE_END = 0x7f;
- private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_BEGIN = 0x80;
- private const byte SOCKS5_AUTH_METHOD_RESERVED_RANGE_END = 0xfe;
- private const byte SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS = 0xff;
- private const byte SOCKS5_CMD_CONNECT = 0x01;
- private const byte SOCKS5_CMD_BIND = 0x02;
- private const byte SOCKS5_CMD_UDP_ASSOCIATE = 0x03;
- private const byte SOCKS5_CMD_REPLY_SUCCEEDED = 0x00;
- private const byte SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE = 0x01;
- private const byte SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET = 0x02;
- private const byte SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE = 0x03;
- private const byte SOCKS5_CMD_REPLY_HOST_UNREACHABLE = 0x04;
- private const byte SOCKS5_CMD_REPLY_CONNECTION_REFUSED = 0x05;
- private const byte SOCKS5_CMD_REPLY_TTL_EXPIRED = 0x06;
- private const byte SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED = 0x07;
- private const byte SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED = 0x08;
- private const byte SOCKS5_ADDRTYPE_IPV4 = 0x01;
- private const byte SOCKS5_ADDRTYPE_DOMAIN_NAME = 0x03;
- private const byte SOCKS5_ADDRTYPE_IPV6 = 0x04;
-
- ///
- /// Authentication itemType.
- ///
- private enum SocksAuthentication
- {
- None,
- UsernamePassword
- }
-
- ///
- /// Create a Socks5 proxy client object.
- ///
- public Socks5ProxyClient()
- {
-
- }
-
- ///
- /// Creates a Socks5 proxy client object using the supplied TcpClient object connection.
- ///
- /// A TcpClient connection object.
- public Socks5ProxyClient(TcpClient tcpClient)
- {
- _tcpClientCached = tcpClient ?? throw new ArgumentNullException(nameof(tcpClient));
- }
-
- ///
- /// Create a Socks5 proxy client object.
- ///
- /// Host name or IP address of the proxy server.
- /// Port used to connect to proxy server.
- public Socks5ProxyClient(string proxyHost, int proxyPort)
- {
- if (proxyPort <= 0 || proxyPort > 65535)
- throw new ArgumentOutOfRangeException(nameof(proxyPort), "port must be greater than zero and less than 65535");
-
- _proxyHost = proxyHost ?? throw new ArgumentNullException(nameof(proxyHost));
- _proxyPort = proxyPort;
- }
-
- ///
- /// Create a Socks5 proxy client object.
- ///
- /// Host name or IP address of the proxy server.
- /// Port used to connect to proxy server.
- /// Proxy authentication user name.
- /// Proxy authentication password.
- public Socks5ProxyClient(string proxyHost, int proxyPort, string? proxyUsername, string? proxyPassword)
- {
- if (proxyPort <= 0 || proxyPort > 65535)
- throw new ArgumentOutOfRangeException(nameof(proxyPort), "port must be greater than zero and less than 65535");
- _proxyHost = proxyHost ?? throw new ArgumentNullException(nameof(proxyHost));
- _proxyPort = proxyPort;
-
- if (!string.IsNullOrEmpty(proxyUsername))
- _proxyUsername = proxyUsername;
-
- if (!string.IsNullOrEmpty(proxyPassword))
- _proxyPassword = proxyPassword;
- }
-
- ///
- /// Gets or sets host name or IP address of the proxy server.
- ///
- public string ProxyHost
- {
- get { return _proxyHost; }
- set { _proxyHost = value; }
- }
-
- ///
- /// Gets or sets port used to connect to proxy server.
- ///
- public int ProxyPort
- {
- get { return _proxyPort; }
- set { _proxyPort = value; }
- }
-
- ///
- /// Gets String representing the name of the proxy.
- ///
- /// This property will always return the value 'SOCKS5'
- public string ProxyName
- {
- get { return PROXY_NAME; }
- }
-
- ///
- /// Gets or sets the TcpClient object.
- /// This property can be set prior to executing CreateConnection to use an existing TcpClient connection.
- ///
- public TcpClient TcpClient
- {
- //get { return _tcpClientCached; }
- set { _tcpClientCached = value; }
- }
-
- ///
- /// Creates a remote TCP connection through a proxy server to the destination host on the destination port.
- ///
- /// Destination host name or IP address of the destination server.
- /// Port number to connect to on the destination host.
- ///
- /// Returns an open TcpClient object that can be used normally to communicate
- /// with the destination server
- ///
- public TcpClient? CreateConnection(string destinationHost, int destinationPort)
- {
- if (string.IsNullOrEmpty(destinationHost))
- throw new ArgumentNullException(nameof(destinationHost));
-
- if (destinationPort <= 0 || destinationPort > 65535)
- throw new ArgumentOutOfRangeException(nameof(destinationPort), "port must be greater than zero and less than 65535");
-
- try
- {
- // if we have no cached tcpip connection then create one
- if (_tcpClientCached == null)
- {
- if (string.IsNullOrEmpty(_proxyHost))
- throw new Exception("ProxyHost property must contain a value.");
-
- if (_proxyPort <= 0 || _proxyPort > 65535)
- throw new Exception("ProxyPort value must be greater than zero and less than 65535");
-
- // create new tcp client object to the proxy server
- _tcpClient = new TcpClient();
-
- // attempt to open the connection
- _tcpClient.Connect(_proxyHost, _proxyPort);
- }
- else
- {
- _tcpClient = _tcpClientCached;
- }
-
- // determine which authentication method the client would like to use
- DetermineClientAuthMethod();
-
- // negotiate which authentication methods are supported / accepted by the server
- NegotiateServerAuthMethod();
-
- // send a connect command to the proxy server for destination host and port
- SendCommand(SOCKS5_CMD_CONNECT, destinationHost, destinationPort);
-
- // remove the private reference to the tcp client so the proxy object does not keep it
- // return the open proxied tcp client object to the caller for normal use
- TcpClient rtn = _tcpClient;
- _tcpClient = null;
- return rtn;
- }
- catch (Exception ex)
- {
- string msg;
- if (_tcpClient == null)
- msg = "Tcp Client is null.";
- else
- msg = $"Connection to proxy {Utils.GetHost(_tcpClient)}:{Utils.GetPort(_tcpClient)} failed.";
- Debug.WriteLine($"{msg}{Environment.NewLine}{ex.Message}");
-
- return null;
- //throw new ProxyException(msg, ex);
- }
- }
-
-
- private void DetermineClientAuthMethod()
- {
- // set the authentication itemType used based on values inputed by the user
- if (!string.IsNullOrEmpty(_proxyUsername) && !string.IsNullOrEmpty(_proxyPassword))
- _proxyAuthMethod = SocksAuthentication.UsernamePassword;
- else
- _proxyAuthMethod = SocksAuthentication.None;
- }
-
- private void NegotiateServerAuthMethod()
- {
- if (_tcpClient == null) return;
-
- // get a reference to the network stream
- NetworkStream stream = _tcpClient.GetStream();
-
- // SERVER AUTHENTICATION REQUEST
- // The client connects to the server, and sends a version
- // identifier/method selection message:
- //
- // +----+----------+----------+
- // |VER | NMETHODS | METHODS |
- // +----+----------+----------+
- // | 1 | 1 | 1 to 255 |
- // +----+----------+----------+
-
- byte[] authRequest = new byte[4];
- authRequest[0] = SOCKS5_VERSION_NUMBER;
- authRequest[1] = SOCKS5_AUTH_NUMBER_OF_AUTH_METHODS_SUPPORTED;
- authRequest[2] = SOCKS5_AUTH_METHOD_NO_AUTHENTICATION_REQUIRED;
- authRequest[3] = SOCKS5_AUTH_METHOD_USERNAME_PASSWORD;
-
- // send the request to the server specifying authentication types supported by the client.
- stream.Write(authRequest, 0, authRequest.Length);
-
- // SERVER AUTHENTICATION RESPONSE
- // The server selects from one of the methods given in METHODS, and
- // sends a METHOD selection message:
- //
- // +----+--------+
- // |VER | METHOD |
- // +----+--------+
- // | 1 | 1 |
- // +----+--------+
- //
- // If the selected METHOD is X'FF', none of the methods listed by the
- // client are acceptable, and the client MUST close the connection.
- //
- // The values currently defined for METHOD are:
- // * X'00' NO AUTHENTICATION REQUIRED
- // * X'01' GSSAPI
- // * X'02' USERNAME/PASSWORD
- // * X'03' to X'7F' IANA ASSIGNED
- // * X'80' to X'FE' RESERVED FOR PRIVATE METHODS
- // * X'FF' NO ACCEPTABLE METHODS
-
- // receive the server response
- byte[] response = new byte[2];
- stream.Read(response, 0, response.Length);
-
- // the first byte contains the socks version number (e.g. 5)
- // the second byte contains the auth method acceptable to the proxy server
- byte acceptedAuthMethod = response[1];
-
- // if the server does not accept any of our supported authenication methods then throw an error
- if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_REPLY_NO_ACCEPTABLE_METHODS)
- {
- _tcpClient.Close();
- string msg = "The proxy destination does not accept the supported proxy client authentication methods.";
- Debug.WriteLine(msg);
- return;
- //throw new ProxyException(msg);
- }
-
- // if the server accepts a username and password authentication and none is provided by the user then throw an error
- if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD && _proxyAuthMethod == SocksAuthentication.None)
- {
- _tcpClient.Close();
- string msg = "The proxy destination requires a username and password for authentication. If you received this error attempting to connect to the Tor network provide an string empty value for ProxyUserName and ProxyPassword.";
- Debug.WriteLine(msg);
- return;
- //throw new ProxyException(msg);
- }
-
- if (acceptedAuthMethod == SOCKS5_AUTH_METHOD_USERNAME_PASSWORD)
- {
-
- // USERNAME / PASSWORD SERVER REQUEST
- // Once the SOCKS V5 server has started, and the client has selected the
- // Username/Password Authentication protocol, the Username/Password
- // subnegotiation begins. This begins with the client producing a
- // Username/Password request:
- //
- // +----+------+----------+------+----------+
- // |VER | ULEN | UNAME | PLEN | PASSWD |
- // +----+------+----------+------+----------+
- // | 1 | 1 | 1 to 255 | 1 | 1 to 255 |
- // +----+------+----------+------+----------+
-
- // create a data structure (binary array) containing credentials
- // to send to the proxy server which consists of clear username and password data
- byte[] credentials = new byte[_proxyUsername.Length + _proxyPassword.Length + 3];
-
- // for SOCKS5 username/password authentication the VER field must be set to 0x01
- // http://en.wikipedia.org/wiki/SOCKS
- // field 1: version number, 1 byte (must be 0x01)"
- credentials[0] = 0x01;
- credentials[1] = (byte)_proxyUsername.Length;
- Array.Copy(Encoding.ASCII.GetBytes(_proxyUsername), 0, credentials, 2, _proxyUsername.Length);
- credentials[_proxyUsername.Length + 2] = (byte)_proxyPassword.Length;
- Array.Copy(Encoding.ASCII.GetBytes(_proxyPassword), 0, credentials, _proxyUsername.Length + 3, _proxyPassword.Length);
-
- // USERNAME / PASSWORD SERVER RESPONSE
- // The server verifies the supplied UNAME and PASSWD, and sends the
- // following response:
- //
- // +----+--------+
- // |VER | STATUS |
- // +----+--------+
- // | 1 | 1 |
- // +----+--------+
- //
- // A STATUS field of X'00' indicates success. If the server returns a
- // `failure' (STATUS value other than X'00') status, it MUST close the
- // connection.
-
- // transmit credentials to the proxy server
- stream.Write(credentials, 0, credentials.Length);
-
- // read the response from the proxy server
- byte[] crResponse = new byte[2];
- stream.Read(crResponse, 0, crResponse.Length);
-
- // check to see if the proxy server accepted the credentials
- if (crResponse[1] != 0)
- {
- _tcpClient.Close();
- string msg = "Proxy authentification failure! The proxy server has reported that the userid and/or password is not valid.";
- Debug.WriteLine(msg);
- return;
- //throw new ProxyException(msg);
- }
- }
- }
-
- private byte GetDestAddressType(string host)
- {
- bool result = IPAddress.TryParse(host, out IPAddress? ipAddr);
-
- if (!result || ipAddr == null)
- return SOCKS5_ADDRTYPE_DOMAIN_NAME;
-
- return ipAddr.AddressFamily switch
- {
- AddressFamily.InterNetwork => SOCKS5_ADDRTYPE_IPV4,
- AddressFamily.InterNetworkV6 => SOCKS5_ADDRTYPE_IPV6,
- _ => throw new Exception($"The host addess {host} of type \'{Enum.GetName(typeof(AddressFamily), ipAddr.AddressFamily)}\' is not a supported address type. The supported types are InterNetwork and InterNetworkV6."),
- };
- }
-
- private byte[]? GetDestAddressBytes(byte addressType, string host)
- {
- switch (addressType)
- {
- case SOCKS5_ADDRTYPE_IPV4:
- case SOCKS5_ADDRTYPE_IPV6:
- return IPAddress.Parse(host).GetAddressBytes();
- case SOCKS5_ADDRTYPE_DOMAIN_NAME:
- // create a byte array to hold the host name bytes plus one byte to store the length
- byte[] bytes = new byte[host.Length + 1];
- // if the address field contains a fully-qualified domain name. The first
- // octet of the address field contains the number of octets of name that
- // follow, there is no terminating NUL octet.
- bytes[0] = Convert.ToByte(host.Length);
- Encoding.ASCII.GetBytes(host).CopyTo(bytes, 1);
- return bytes;
- default:
- return null;
- }
- }
-
- private byte[] GetDestPortBytes(int value)
- {
- byte[] array = new byte[2];
- array[0] = Convert.ToByte(value / 256);
- array[1] = Convert.ToByte(value % 256);
- return array;
- }
-
- private void SendCommand(byte command, string destinationHost, int destinationPort)
- {
- if (_tcpClient == null) return;
-
- NetworkStream stream = _tcpClient.GetStream();
-
- byte addressType = GetDestAddressType(destinationHost);
- byte[]? destAddr = GetDestAddressBytes(addressType, destinationHost);
- if (destAddr == null) return;
-
- byte[] destPort = GetDestPortBytes(destinationPort);
-
- // The connection request is made up of 6 bytes plus the
- // length of the variable address byte array
- //
- // +----+-----+-------+------+----------+----------+
- // |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT |
- // +----+-----+-------+------+----------+----------+
- // | 1 | 1 | X'00' | 1 | Variable | 2 |
- // +----+-----+-------+------+----------+----------+
- //
- // * VER protocol version: X'05'
- // * CMD
- // * CONNECT X'01'
- // * BIND X'02'
- // * UDP ASSOCIATE X'03'
- // * RSV RESERVED
- // * ATYP address itemType of following address
- // * IP V4 address: X'01'
- // * DOMAINNAME: X'03'
- // * IP V6 address: X'04'
- // * DST.ADDR desired destination address
- // * DST.PORT desired destination port in network octet order
-
- byte[] request = new byte[4 + destAddr.Length + 2];
- request[0] = SOCKS5_VERSION_NUMBER;
- request[1] = command;
- request[2] = SOCKS5_RESERVED;
- request[3] = addressType;
- destAddr.CopyTo(request, 4);
- destPort.CopyTo(request, 4 + destAddr.Length);
-
- // send connect request.
- stream.Write(request, 0, request.Length);
-
- // PROXY SERVER RESPONSE
- // +----+-----+-------+------+----------+----------+
- // |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT |
- // +----+-----+-------+------+----------+----------+
- // | 1 | 1 | X'00' | 1 | Variable | 2 |
- // +----+-----+-------+------+----------+----------+
- //
- // * VER protocol version: X'05'
- // * REP Reply field:
- // * X'00' succeeded
- // * X'01' general SOCKS server failure
- // * X'02' connection not allowed by ruleset
- // * X'03' Network unreachable
- // * X'04' Host unreachable
- // * X'05' Connection refused
- // * X'06' TTL expired
- // * X'07' Command not supported
- // * X'08' Address itemType not supported
- // * X'09' to X'FF' unassigned
- // RSV RESERVED
- // ATYP address itemType of following address
-
- byte[] response = new byte[255];
-
- // read proxy server response
- stream.Read(response, 0, response.Length);
-
- byte replyCode = response[1];
-
- // evaluate the reply code for an error condition
- if (replyCode != SOCKS5_CMD_REPLY_SUCCEEDED)
- HandleProxyCommandError(response, destinationHost, destinationPort );
- }
-
- private void HandleProxyCommandError(byte[] response, string destinationHost, int destinationPort)
- {
- byte replyCode = response[1];
- byte addrType = response[3];
- string addr = "";
- short port = 0;
-
- switch (addrType)
- {
- case SOCKS5_ADDRTYPE_DOMAIN_NAME:
- int addrLen = Convert.ToInt32(response[4]);
- byte[] addrBytes = new byte[addrLen];
- for (int i = 0; i < addrLen; i++)
- addrBytes[i] = response[i + 5];
- addr = Encoding.ASCII.GetString(addrBytes);
- byte[] portBytesDomain = new byte[2];
- portBytesDomain[0] = response[6 + addrLen];
- portBytesDomain[1] = response[5 + addrLen];
- port = BitConverter.ToInt16(portBytesDomain, 0);
- break;
-
- case SOCKS5_ADDRTYPE_IPV4:
- byte[] ipv4Bytes = new byte[4];
- for (int i = 0; i < 4; i++)
- ipv4Bytes[i] = response[i + 4];
- IPAddress ipv4 = new(ipv4Bytes);
- addr = ipv4.ToString();
- byte[] portBytesIpv4 = new byte[2];
- portBytesIpv4[0] = response[9];
- portBytesIpv4[1] = response[8];
- port = BitConverter.ToInt16(portBytesIpv4, 0);
- break;
-
- case SOCKS5_ADDRTYPE_IPV6:
- byte[] ipv6Bytes = new byte[16];
- for (int i = 0; i < 16; i++)
- ipv6Bytes[i] = response[i + 4];
- IPAddress ipv6 = new(ipv6Bytes);
- addr = ipv6.ToString();
- byte[] portBytesIpv6 = new byte[2];
- portBytesIpv6[0] = response[21];
- portBytesIpv6[1] = response[20];
- port = BitConverter.ToInt16(portBytesIpv6, 0);
- break;
- }
-
- string proxyErrorText = replyCode switch
- {
- SOCKS5_CMD_REPLY_GENERAL_SOCKS_SERVER_FAILURE => "a general socks destination failure occurred",
- SOCKS5_CMD_REPLY_CONNECTION_NOT_ALLOWED_BY_RULESET => "the connection is not allowed by proxy destination rule set",
- SOCKS5_CMD_REPLY_NETWORK_UNREACHABLE => "the network was unreachable",
- SOCKS5_CMD_REPLY_HOST_UNREACHABLE => "the host was unreachable",
- SOCKS5_CMD_REPLY_CONNECTION_REFUSED => "the connection was refused by the remote network",
- SOCKS5_CMD_REPLY_TTL_EXPIRED => "the time to live (TTL) has expired",
- SOCKS5_CMD_REPLY_COMMAND_NOT_SUPPORTED => "the command issued by the proxy client is not supported by the proxy destination",
- SOCKS5_CMD_REPLY_ADDRESS_TYPE_NOT_SUPPORTED => "the address type specified is not supported",
- _ => $"an unknown SOCKS reply with the code value '{replyCode}' was received",
- };
- string responseText = response != null ? Utils.HexEncode(response) : "";
- string exceptionMsg = $"Proxy Error: {proxyErrorText} for destination host {destinationHost} port number {destinationPort}. Server response (hex): {responseText}.";
-
- Debug.WriteLine(exceptionMsg);
- return;
- //throw new ProxyException(exceptionMsg);
- }
-
-
- //Async Methods
- private BackgroundWorker? _asyncWorker;
- private Exception? _asyncException;
- bool _asyncCancelled;
-
- ///
- /// Gets a value indicating whether an asynchronous operation is running.
- ///
- /// Returns true if an asynchronous operation is running; otherwise, false.
- ///
- public bool IsBusy
- {
- get { return _asyncWorker != null && _asyncWorker.IsBusy; }
- }
-
- ///
- /// Gets a value indicating whether an asynchronous operation is cancelled.
- ///
- /// Returns true if an asynchronous operation is cancelled; otherwise, false.
- ///
- public bool IsAsyncCancelled
- {
- get { return _asyncCancelled; }
- }
-
- ///
- /// Cancels any asychronous operation that is currently active.
- ///
- public void CancelAsync()
- {
- if (_asyncWorker != null && !_asyncWorker.CancellationPending && _asyncWorker.IsBusy)
- {
- _asyncCancelled = true;
- _asyncWorker.CancelAsync();
- }
- }
-
- private void CreateAsyncWorker()
- {
- if (_asyncWorker != null)
- _asyncWorker.Dispose();
- _asyncException = null;
- _asyncWorker = null;
- _asyncCancelled = false;
- _asyncWorker = new();
- }
-
- ///
- /// Event handler for CreateConnectionAsync method completed.
- ///
- public event EventHandler? CreateConnectionAsyncCompleted;
-
- ///
- /// Asynchronously creates a remote TCP connection through a proxy server to the destination host on the destination port.
- ///
- /// Destination host name or IP address.
- /// Port number to connect to on the destination host.
- ///
- /// Returns TcpClient object that can be used normally to communicate
- /// with the destination server.
- ///
- ///
- /// This method instructs the proxy server
- /// to make a pass through connection to the specified destination host on the specified
- /// port.
- ///
- public void CreateConnectionAsync(string destinationHost, int destinationPort)
- {
- if (_asyncWorker != null)
- {
- if (_asyncWorker.IsBusy)
- throw new InvalidOperationException("The Socks4 object is already busy executing another asynchronous operation. You can only execute one asychronous method at a time.");
-
- CreateAsyncWorker();
- _asyncWorker.WorkerSupportsCancellation = true;
- _asyncWorker.DoWork += new DoWorkEventHandler(CreateConnectionAsync_DoWork);
- _asyncWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(CreateConnectionAsync_RunWorkerCompleted);
- object[] args = new object[2];
- args[0] = destinationHost;
- args[1] = destinationPort;
- _asyncWorker.RunWorkerAsync(args);
- }
- }
-
- private void CreateConnectionAsync_DoWork(object? sender, DoWorkEventArgs e)
- {
- try
- {
- if (e.Argument != null)
- {
- object[] args = (object[])e.Argument;
- e.Result = CreateConnection((string)args[0], (int)args[1]);
- }
- }
- catch (Exception ex)
- {
- _asyncException = ex;
- }
- }
-
- private void CreateConnectionAsync_RunWorkerCompleted(object? sender, RunWorkerCompletedEventArgs e)
- {
- if (e.Result != null)
- CreateConnectionAsyncCompleted?.Invoke(this, new CreateConnectionAsyncCompletedEventArgs(_asyncException, _asyncCancelled, (TcpClient)e.Result));
- }
-
-
- }
-}
diff --git a/MsmhTools/MsmhTools/ProxifiedTcpClient/Utils.cs b/MsmhTools/MsmhTools/ProxifiedTcpClient/Utils.cs
deleted file mode 100644
index b88e85a..0000000
--- a/MsmhTools/MsmhTools/ProxifiedTcpClient/Utils.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-using System;
-using System.Text;
-using System.Globalization;
-using System.Net.Sockets;
-using System.Net;
-using System.ComponentModel;
-
-namespace MsmhTools.ProxifiedTcpClient
-{
- internal static class Utils
- {
- ///
- /// Encodes a byte array to a string in 2 character hex format.
- ///
- /// Array of bytes to convert.
- /// String containing encoded bytes.
- /// e.g. 0x55 ==> "55", also left pads with 0 so that 0x01 is "01" and not "1"
- public static string HexEncode(byte[] data)
- {
- if (data == null)
- throw new ArgumentNullException(nameof(data));
-
- return HexEncode(data, false, data.Length);
- }
-
- ///
- /// Encodes a byte array to a string in 2 character hex format.
- ///
- /// Array of bytes to encode.
- /// Insert colon as the delimiter between bytes.
- /// Number of bytes to encode.
- /// String containing encoded bytes.
- /// e.g. 0x55 ==> "55", also left pads with 0 so that 0x01 is "01" and not "1"
- public static string HexEncode(byte[] data, bool insertColonDelimiter, int length)
- {
- if (data == null)
- throw new ArgumentNullException(nameof(data));
-
- StringBuilder buffer = new(length * 2);
-
- int len = data.Length;
- for (int i = 0; i < len; i++)
- {
- buffer.Append(data[i].ToString("x").PadLeft(2, '0')); //same as "%02X" in C
- if (insertColonDelimiter && i < len - 1)
- buffer.Append(':');
- }
- return buffer.ToString();
- }
-
- internal static string GetHost(TcpClient client)
- {
- if (client == null)
- throw new ArgumentNullException(nameof(client));
-
- string host = string.Empty;
- try
- {
- if (client.Client.RemoteEndPoint != null)
- host = ((IPEndPoint)client.Client.RemoteEndPoint).Address.ToString();
- }
- catch (Exception)
- {
- // do nothing
- };
-
- return host;
- }
-
- internal static string GetPort(TcpClient client)
- {
- if (client == null)
- throw new ArgumentNullException(nameof(client));
-
- string port = "";
- try
- {
- if (client.Client.RemoteEndPoint != null)
- port = ((System.Net.IPEndPoint)client.Client.RemoteEndPoint).Port.ToString(CultureInfo.InvariantCulture);
- }
- catch (Exception)
- {
- // do nothing
- };
-
- return port;
- }
-
- }
-
- ///
- /// Event arguments class for the EncryptAsyncCompleted event.
- ///
- public class CreateConnectionAsyncCompletedEventArgs : AsyncCompletedEventArgs
- {
- private TcpClient? _proxyConnection;
-
- ///
- /// Constructor.
- ///
- /// Exception information generated by the event.
- /// Cancelled event flag. This flag is set to true if the event was cancelled.
- /// Proxy Connection. The initialized and open TcpClient proxy connection.
- public CreateConnectionAsyncCompletedEventArgs(Exception? error, bool cancelled, TcpClient? proxyConnection) : base(error, cancelled, null)
- {
- _proxyConnection = proxyConnection;
- }
-
- ///
- /// The proxy connection.
- ///
- public TcpClient? ProxyConnection
- {
- get { return _proxyConnection; }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/RegistryTool.cs b/MsmhTools/MsmhTools/RegistryTool.cs
deleted file mode 100644
index 606fde5..0000000
--- a/MsmhTools/MsmhTools/RegistryTool.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- public static class RegistryTool
- {
- [DllImport("wininet.dll")]
- private static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength);
- private const int INTERNET_OPTION_SETTINGS_CHANGED = 39;
- private const int INTERNET_OPTION_REFRESH = 37;
-
- [DllImport("user32.DLL")]
- private static extern bool SendNotifyMessageA(IntPtr hWnd, uint Msg, int wParam, int lParam);
- private static readonly IntPtr HWND_BROADCAST = (IntPtr)0xffff;
- private static readonly uint WM_SETTINGCHANGE = 0x001A;
-
- public static void ApplyRegistryChanges()
- {
- // They cause the OS to refresh the settings, causing IP to realy update
- InternetSetOption(IntPtr.Zero, INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0);
- InternetSetOption(IntPtr.Zero, INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);
-
- SendNotifyMessageA(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/Resource.cs b/MsmhTools/MsmhTools/Resource.cs
deleted file mode 100644
index 41a3f99..0000000
--- a/MsmhTools/MsmhTools/Resource.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Reflection;
-using System.Text;
-
-namespace MsmhTools
-{
- public class Resource
- {
- public static void WriteResourceToFile(string resourcePath, string filePath, Assembly assembly)
- {
- resourcePath = assembly.GetManifestResourceNames().Single(str => str.EndsWith(resourcePath));
- using Stream? resource = assembly.GetManifestResourceStream(resourcePath);
- using FileStream file = new(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
- if (resource != null)
- resource.CopyTo(file);
- else
- Debug.WriteLine("WriteResourceToFile: Copy to disk faild, resource was null.");
- }
-
- public static void WriteResourceToFile(byte[] resource, string filePath)
- {
- File.WriteAllBytes(filePath, resource);
- }
-
- public static async Task WriteResourceToFileAsync(string resourcePath, string filePath, Assembly assembly)
- {
- resourcePath = assembly.GetManifestResourceNames().Single(str => str.EndsWith(resourcePath));
- using Stream? resource = assembly.GetManifestResourceStream(resourcePath);
- using FileStream file = new(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
- if (resource != null)
- await resource.CopyToAsync(file);
- else
- Debug.WriteLine("WriteResourceToFile: Copy to disk faild, resource was null.");
- }
-
- ///
- /// Only binaries not text files.
- ///
- ///
- ///
- ///
- public static async Task WriteResourceToFileAsync(byte[] resource, string filePath)
- {
- await File.WriteAllBytesAsync(filePath, resource);
- }
-
- public static string? GetResourceTextFile(string resourcePath, Assembly assembly)
- {
- if (ResourceExists(resourcePath, assembly))
- {
- // Format: "{Namespace}.{Folder}.{filename}.{Extension}"
- resourcePath = assembly.GetManifestResourceNames().Single(str => str.EndsWith(resourcePath));
- using Stream? stream = assembly.GetManifestResourceStream(resourcePath);
- if (stream != null)
- {
- using StreamReader reader = new(stream);
- return reader.ReadToEnd();
- }
- else
- return null;
- }
- else
- return null;
- }
-
- public static string? GetResourceTextFile(byte[] resource)
- {
- return Encoding.UTF8.GetString(resource);
- }
-
- public static async Task GetResourceTextFileAsync(string path, Assembly assembly)
- {
- if (ResourceExists(path, assembly))
- {
- // Format: "{Namespace}.{Folder}.{filename}.{Extension}"
- path = assembly.GetManifestResourceNames().Single(str => str.EndsWith(path));
- using Stream? stream = assembly.GetManifestResourceStream(path);
- if (stream != null)
- {
- using StreamReader reader = new(stream);
- return await reader.ReadToEndAsync();
- }
- else
- return null;
- }
- else
- return null;
- }
- //-----------------------------------------------------------------------------------
- public static bool ResourceExists(string resourceName, Assembly assembly)
- {
- string[] resourceNames = assembly.GetManifestResourceNames();
- Debug.WriteLine("Resource Exist: " + resourceNames.Contains(resourceName));
- return resourceNames.Contains(resourceName);
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/Screen.cs b/MsmhTools/MsmhTools/Screen.cs
deleted file mode 100644
index 658335b..0000000
--- a/MsmhTools/MsmhTools/Screen.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- public class ScreenDPI
- {
- public static void ScaleForm(Form form, bool scaleX, bool scaleY)
- {
- using Graphics g = form.CreateGraphics();
- float scaleFactorX = 1;
- float scaleFactorY = 1;
-
- // 96 = 100%
- // 120 = 125%
- // 144 = 150%
-
- if (g.DpiX > 96)
- scaleFactorX = g.DpiX / 96;
-
- if (g.DpiY > 96)
- scaleFactorY = g.DpiY / 96;
-
- if (form.AutoScaleDimensions == form.CurrentAutoScaleDimensions)
- {
- if (!scaleX && !scaleY)
- form.Scale(new SizeF(1, 1));
- else if (scaleX && !scaleY)
- form.Scale(new SizeF(scaleFactorX, 1));
- else if (!scaleX && scaleY)
- form.Scale(new SizeF(1, scaleFactorY));
- else if (scaleX && scaleY)
- form.Scale(new SizeF(scaleFactorX, scaleFactorY));
- }
- // Doesn't work!
- //AutoScaleMode = AutoScaleMode.Font;
- //AutoScaleDimensions = new SizeF(6F, 13F);
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/ScrollBar.cs b/MsmhTools/MsmhTools/ScrollBar.cs
deleted file mode 100644
index 4824683..0000000
--- a/MsmhTools/MsmhTools/ScrollBar.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using System;
-using MsmhTools;
-
-namespace MsmhTools
-{
- public class ScrollBar
- {
- //-----------------------------------------------------------------------------------
- // Is Vertical Scrollbar Visible
- private const int WS_VSCROLL = 0x200000;
- private const int GWL_STYLE = -16;
- public static bool IsVScrollbarVisible(IntPtr hWnd)
- {
- int nMessage = WS_VSCROLL;
- int nStyle = NativeMethods.GetWindowLong(hWnd, GWL_STYLE);
- bool bVisible = (nStyle & nMessage) != 0;
- return bVisible;
- } // Usage: IsVScrollbarVisible(ListView1.Handle);
- //-----------------------------------------------------------------------------------
- // Is Horizontal Scrollbar Visible
- private const int WS_HSCROLL = 0x100000;
- public static bool IsHScrollbarVisible(IntPtr hWnd)
- {
- int nMessage = WS_HSCROLL;
- int nStyle = NativeMethods.GetWindowLong(hWnd, GWL_STYLE);
- bool bVisible = (nStyle & nMessage) != 0;
- return bVisible;
- } // Usage: IsHScrollbarVisible(ListView1.Handle);
- //-----------------------------------------------------------------------------------
- }
-}
diff --git a/MsmhTools/MsmhTools/Settings.cs b/MsmhTools/MsmhTools/Settings.cs
deleted file mode 100644
index 822e911..0000000
--- a/MsmhTools/MsmhTools/Settings.cs
+++ /dev/null
@@ -1,546 +0,0 @@
-using CustomControls;
-using Microsoft.CSharp;
-using System;
-using System.CodeDom.Compiler;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Diagnostics;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Xml;
-using System.Xml.Linq;
-
-namespace MsmhTools
-{
- public class Settings
- {
- private XDocument XDoc = new();
- private List SettingList = new();
-
- private readonly string Whitespace = @"\u0020";
- private readonly char WhiteSpaceChar = '\u0020';
- class Setting
- {
- public string? ControlName { get; set; }
- public string? PropertyName { get; set; }
- public string? PropertyValue { get; set; }
- public Setting(string controlName, string propertyName, string propertyValue)
- {
- ControlName = controlName;
- PropertyName = propertyName;
- PropertyValue = propertyValue;
- }
- }
-
- private List ControlsAndPropertiesList = new();
- public class ControlsAndProperties
- {
- public Type ControlType { get; set; }
- public string PropertyName { get; set; }
- public ControlsAndProperties(Type controlType, string propertyName)
- {
- ControlType = controlType;
- PropertyName = propertyName;
- }
- }
-
- private readonly char Delimiter = '|';
- public Settings(Control form, string? xmlFilePath = null)
- {
- if (xmlFilePath != null)
- {
- if (Xml.IsValidXMLFile(xmlFilePath))
- LoadFromXMLFile(form, xmlFilePath);
- else
- CustomMessageBox.Show("XML file is not valid.");
- }
- }
-
- public XDocument Export()
- {
- return XDoc;
- }
-
- public void LoadFromXML(string xmlString)
- {
- if (Xml.IsValidXML(xmlString))
- XDoc = XDocument.Parse(xmlString);
- }
-
- public void LoadFromXMLFile(Control form, string xmlFilePath)
- {
- if (xmlFilePath != null && Xml.IsValidXMLFile(xmlFilePath))
- {
- // Clear List
- SettingList.Clear();
-
- // Clear XDoc
- XElement? settingsx = XDoc.Element("Settings");
- if (settingsx != null)
- settingsx.RemoveAll();
-
- // Add Settings to XDoc
- XDoc = XDocument.Load(xmlFilePath);
-
- // Add Settings to List
- // Begin Check
- var settings = XDoc.Elements("Settings");
- bool settingExist = settings.Any();
- if (settingExist)
- {
- // Top Exist
- XElement? setting0 = XDoc.Element("Settings");
- if (setting0 != null)
- {
- var controls = setting0.Elements().ToArray();
- bool controlExist = controls.Any();
- if (controlExist)
- {
- // Control Exist
- for (int n1 = 0; n1 < controls.Length; n1++)
- {
- XElement? control0 = controls.ToArray()[n1];
- if (control0 != null)
- {
- var controlProperties = control0.Elements();
- bool controlPropertyExist = controlProperties.Any();
- if (controlPropertyExist)
- {
- // Control Property Exist
- for (int n2 = 0; n2 < controlProperties.Count(); n2++)
- {
- XElement? controlProperty0 = controlProperties.ToArray()[n2];
- if (controlProperty0 != null)
- {
- if (IsControlExistInForm(form, control0.Name.LocalName))
- AddSettingToList(control0.Name.LocalName, controlProperty0.Name.LocalName, controlProperty0.Value);
- else
- {
- // Remove old controls settings
- XElement? elementToRemove = setting0.Element(control0.Name.LocalName);
- if (elementToRemove != null)
- elementToRemove.Remove();
- }
- }
- }
- }
- }
- }
- LoadAllSettings(form);
- }
- }
- }
- }
- }
-
- private static bool IsControlExistInForm(Control form, string controlName)
- {
- List controls = Controllers.GetAllControls(form);
- for (int n = 0; n < controls.Count; n++)
- {
- Control control = controls[n];
- if (control.Name == controlName)
- return true;
- }
- return false;
- }
-
- public void LoadAllSettings(Control form)
- {
- List controls = Controllers.GetAllControls(form);
- for (int n1 = 0; n1 < controls.Count; n1++)
- {
- Control control = controls[n1];
- PropertyInfo[] properties = control.GetType().GetProperties();
- for (int n2 = 0; n2 < properties.Length; n2++)
- {
- PropertyInfo property = properties[n2];
- List settingList = SettingList.ToList(); // ToList: Fix: Collection was modified; enumeration operation may not execute.
- for (int n3 = 0; n3 < settingList.Count; n3++)
- {
- Setting setting = settingList[n3];
- if (control.Name == setting.ControlName && property.Name == setting.PropertyName && setting.PropertyValue != null)
- {
- try
- {
- TypeConverter typeConverter = TypeDescriptor.GetConverter(property.PropertyType);
- if (typeConverter.CanConvertFrom(typeof(string)))
- {
- property.SetValue(control, typeConverter.ConvertFrom(setting.PropertyValue), null);
- break;
- }
- }
- catch (Exception ex1)
- {
- Debug.WriteLine(property.Name + ": " + ex1.Message);
- try
- {
- property.SetValue(control, Convert.ChangeType(setting.PropertyValue, property.PropertyType), null);
- break;
- }
- catch (Exception ex2)
- {
- Debug.WriteLine(property.Name + ": " + ex2.Message);
- }
- }
- }
- }
- }
- }
- }
-
- public void Save(string xmlFilePath)
- {
- XmlWriterSettings xmlWriterSettings = new();
- xmlWriterSettings.Async = true;
- xmlWriterSettings.Indent = true;
- xmlWriterSettings.OmitXmlDeclaration = true;
- xmlWriterSettings.Encoding = new UTF8Encoding(false);
- using XmlWriter xmlWriter = XmlWriter.Create(xmlFilePath, xmlWriterSettings);
- XDoc.Save(xmlWriter);
- }
-
- public async Task SaveAsync(string xmlFilePath)
- {
- try
- {
- XmlWriterSettings xmlWriterSettings = new();
- xmlWriterSettings.WriteEndDocumentOnClose = true;
- xmlWriterSettings.Async = true;
- xmlWriterSettings.Indent = true;
- xmlWriterSettings.OmitXmlDeclaration = true;
- xmlWriterSettings.Encoding = new UTF8Encoding(false);
- using XmlWriter xmlWriter = XmlWriter.Create(xmlFilePath, xmlWriterSettings);
- await XDoc.SaveAsync(xmlWriter, CancellationToken.None);
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Save Settings: {ex.Message}");
- }
- }
-
- private void SaveToFileAsTXT(string txtFilePath)
- {
- using FileStream fileStream = new(txtFilePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
- using StreamWriter streamWriter = new(fileStream);
- for (int n = 0; n < SettingList.Count; n++)
- {
- var setting = SettingList[n];
- if (string.IsNullOrWhiteSpace(setting.ControlName) && string.IsNullOrWhiteSpace(setting.PropertyName) && setting.PropertyValue != null)
- {
- object line = setting.ControlName + Delimiter + setting.PropertyName + Delimiter + setting.PropertyValue;
- streamWriter.WriteLine(line.ToString());
- }
- }
- }
-
- ///
- /// Get Setting e.g.
- /// Settings settings = new();
- /// var test = settings.GetSettingFromList<bool>(CheckBox1, nameof(CheckBox1.Checked));
- ///
- public T? GetSettingFromList(Control control, string propertyName)
- {
- for (int n = 0; n < SettingList.Count; n++)
- {
- var setting = SettingList[n];
- if (control.Name == setting.ControlName && propertyName == setting.PropertyName && setting.PropertyValue != null)
- {
- TypeConverter typeConverter = TypeDescriptor.GetConverter(typeof(T));
- if (typeConverter.CanConvertFrom(typeof(object)))
- {
- return (T?)typeConverter.ConvertFrom(setting.PropertyValue);
- }
- }
- }
- return default;
- }
-
- ///
- /// Get Setting e.g.
- /// Settings settings = new();
- /// var test = settings.GetSettingFromXML<bool>(CheckBox1, nameof(CheckBox1.Checked));
- ///
- public T? GetSettingFromXML(Control control, string propertyName)
- {
- // Begin Check
- var settings = XDoc.Elements("Settings");
- bool settingExist = settings.Any();
- if (settingExist)
- {
- // Top Exist
- XElement? setting0 = XDoc.Element("Settings");
- if (setting0 != null)
- {
- var controls = setting0.Elements(control.Name);
- bool controlExist = controls.Any();
- if (controlExist)
- {
- // Control Exist
- XElement? control0 = setting0.Element(control.Name);
- if (control0 != null)
- {
- var controlProperties = control0.Elements(propertyName);
- bool controlPropertyExist = controlProperties.Any();
- if (controlPropertyExist)
- {
- // Control Property Exist
- XElement? controlProperty0 = control0.Element(propertyName);
- if (controlProperty0 != null)
- {
- if (control0.Name.LocalName == control.Name && controlProperty0.Name.LocalName == propertyName)
- {
- TypeConverter typeConverter = TypeDescriptor.GetConverter(typeof(T));
- if (typeConverter.CanConvertFrom(typeof(string)))
- {
- return (T?)typeConverter.ConvertFrom(controlProperty0.Value);
- }
- }
- }
- }
- }
- }
- }
- }
- return default;
- }
-
- public void AddAllSettings(Form form)
- {
- List controls = Controllers.GetAllControls(form);
- for (int n1 = 0; n1 < controls.Count; n1++)
- {
- Control control = controls[n1];
- PropertyInfo[] properties = control.GetType().GetProperties();
- for (int n2 = 0; n2 < properties.Length; n2++)
- {
- PropertyInfo property = properties[n2];
- string propertyName = property.Name;
-
- try
- {
- object? propertyValue = property.GetValue(control, null);
- //Type propertyType = TypeToType(property.PropertyType);
-
- if (!string.IsNullOrWhiteSpace(control.Name) && !string.IsNullOrWhiteSpace(propertyName) && propertyValue != null)
- {
- AddSetting(control, propertyName, propertyValue);
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine("SaveAllSettings: " + ex.Message);
- }
- }
- }
- }
-
- ///
- /// Select which control type and properties should be saved with \"AddSelectedSettings\" method.
- /// e.g.
- /// Settings settings = new();
- /// settings.AddSelectedControlAndProperty(typeof(CustomCheckBox), \"Checked\");
- ///
- public void AddSelectedControlAndProperty(Type controlType, string propertyName)
- {
- ControlsAndProperties controlsAndProperties = new(controlType, propertyName);
- bool alreadyExist = false;
-
- for (int n = 0; n < ControlsAndPropertiesList.Count; n++)
- {
- ControlsAndProperties cap = ControlsAndPropertiesList[n];
- if (controlsAndProperties == cap)
- {
- alreadyExist = true;
- break;
- }
- }
-
- if (!alreadyExist)
- ControlsAndPropertiesList.Add(controlsAndProperties);
- }
-
- ///
- /// Add selected settings to be saved with \"Save\" or \"SaveAsync\" methods.
- ///
- public void AddSelectedSettings(Form form)
- {
- List controls = Controllers.GetAllControls(form);
- for (int n1 = 0; n1 < controls.Count; n1++)
- {
- Control control = controls[n1];
- PropertyInfo[] properties = control.GetType().GetProperties();
- for (int n2 = 0; n2 < properties.Length; n2++)
- {
- PropertyInfo property = properties[n2];
- string propertyName = property.Name;
-
- try
- {
- object? propertyValue = property.GetValue(control, null);
-
- if (!string.IsNullOrWhiteSpace(control.Name) && !string.IsNullOrWhiteSpace(propertyName) && propertyValue != null)
- {
- // Read filters (to speed up settings loading)
- for (int n3 = 0; n3 < ControlsAndPropertiesList.Count; n3++)
- {
- ControlsAndProperties controlsAndProperties = ControlsAndPropertiesList[n3];
- Type selectedControlType = controlsAndProperties.ControlType;
- string selectedPropertyName = controlsAndProperties.PropertyName;
-
- if (control.GetType() == selectedControlType && propertyName.Equals(selectedPropertyName))
- AddSetting(control, propertyName, propertyValue);
- }
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine("SaveAllSettings: " + ex.Message);
- continue;
- }
- }
- }
- }
-
- ///
- /// Add Setting e.g.
- /// Settings settings = new();
- /// settings.AddSetting(CheckBox1, nameof(CheckBox1.Checked), CheckBox1.Checked);
- ///
- public void AddSetting(Control control, string propertyName, object propertyValue)
- {
- // Add Setting to List
- AddSettingToList(control.Name, propertyName, propertyValue);
-
- // Add Setting to XDoc
- AddSettingToXDoc(control.Name, propertyName, propertyValue);
- }
-
- private void AddSettingToList(string controlName, string propertyName, object propertyValue)
- {
- if (string.IsNullOrWhiteSpace(controlName)) return;
- if (string.IsNullOrWhiteSpace(propertyName)) return;
- if (propertyValue == null) return;
-
- string? value = propertyValue.ToString();
- if (value == null) return;
-
- Setting setting = new(controlName, propertyName, value);
-
- // Begin Check
- bool alreadyExist = false;
- for (int n = 0; n < SettingList.Count; n++)
- {
- Setting s = SettingList[n];
- if (controlName.Equals(s.ControlName) && propertyName.Equals(s.PropertyName))
- {
- // Control Property Exist
- s.PropertyValue = value;
- alreadyExist = true;
- break;
- }
- }
-
- if (!alreadyExist)
- SettingList.Add(setting);
- }
-
- private void AddSettingToXDoc(string controlName, string propertyName, object propertyValue)
- {
- if (string.IsNullOrWhiteSpace(controlName)) return;
- if (string.IsNullOrWhiteSpace(propertyName)) return;
- if (propertyValue == null) return;
-
- string? value = propertyValue.ToString();
- if (value == null) return;
-
- // Create Control Property
- XElement xControlProperty = new(propertyName);
- xControlProperty.Value = value;
-
- // Create Control Name
- XElement xControl = new(controlName);
- xControl.Add(xControlProperty);
-
- // Create Settings
- XElement xSettings = new("Settings");
- xSettings.Add(xControl);
-
- // Begin Check
- var settings = XDoc.Elements("Settings");
- bool settingExist = settings.Any();
- if (settingExist)
- {
- // Top Exist
- XElement? setting0 = XDoc.Element("Settings");
- if (setting0 == null) return;
-
- var controls = setting0.Elements(controlName);
- bool controlExist = controls.Any();
- if (controlExist)
- {
- // Control Exist
- XElement? control0 = setting0.Element(controlName);
- if (control0 == null) return;
-
- var controlProperties = control0.Elements(propertyName);
- bool controlPropertyExist = controlProperties.Any();
- if (controlPropertyExist)
- {
- // Control Property Exist
- XElement? controlProperty0 = control0.Element(propertyName);
- if (controlProperty0 == null) return;
-
- controlProperty0.Value = value;
- }
- else
- {
- // Control Property Not Exist
- control0.Add(xControlProperty);
- }
- }
- else
- {
- // Control Not Exist
- setting0.Add(xControl);
- }
- }
- else
- {
- // Setiings Not Exist
- XDoc.Add(xSettings);
- }
- }
-
- private static Type NameToType(string typeName, Type defaultType)
- {
- Type propertyType = defaultType;
-
- switch (typeName)
- {
- case "Boolean": propertyType = typeof(bool); break;
- case "Byte": propertyType = typeof(byte); break;
- case "Char": propertyType = typeof(char); break;
- case "DateTime": propertyType = typeof(DateTime); break;
- case "DBNull": propertyType = typeof(DBNull); break;
- case "Decimal": propertyType = typeof(decimal); break;
- case "Double": propertyType = typeof(double); break;
- case "Int16": propertyType = typeof(short); break;
- case "Int32": propertyType = typeof(int); break;
- case "Int64": propertyType = typeof(long); break;
- case "Object": propertyType = typeof(object); break;
- case "SByte": propertyType = typeof(sbyte); break;
- case "Single": propertyType = typeof(float); break;
- case "String": propertyType = typeof(string); break;
- case "UInt16": propertyType = typeof(ushort); break;
- case "UInt32": propertyType = typeof(uint); break;
- case "UInt64": propertyType = typeof(ulong); break;
- }
-
- return propertyType;
- }
-
-
- }
-}
diff --git a/MsmhTools/MsmhTools/SniModifire.cs b/MsmhTools/MsmhTools/SniModifire.cs
deleted file mode 100644
index bfb322a..0000000
--- a/MsmhTools/MsmhTools/SniModifire.cs
+++ /dev/null
@@ -1,453 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- // https://tls13.xargs.org
- public class SniModifire
- {
- // Needs Certificate
- public class TlsExtensions
- {
- public byte[] Data { get; set; } = Array.Empty();
- public int StartIndex { get; set; } = -1;
- public int Length { get; set; } = -1;
- }
-
- public class SniExtension
- {
- public byte[] Data { get; set; } = Array.Empty();
- public int StartIndex { get; set; } = -1;
- public int Length { get; set; } = -1;
- }
-
- public class SNI
- {
- public string ServerName { get; set; } = string.Empty;
- public byte[] Data { get; set; } = Array.Empty();
- public int StartIndex { get; set; } = -1;
- public int Length { get; set; } = -1;
- }
-
- public int Padding { get; set; } = 0;
- public bool PutSniLast { get; set; } = false;
-
- public string ReasonPhrase { get; private set; } = string.Empty;
- public bool HasTlsExtensions { get; private set; } = false;
- public TlsExtensions AllExtensions { get; private set; } = new();
- public bool HasSniExtension { get; private set; } = false;
- public List SniExtensionList { get; private set; } = new();
- public bool HasSni { get; private set; } = false;
- public List SniList { get; private set; } = new();
- public byte[] ModifiedData { get; private set; } = Array.Empty();
-
- private readonly byte[] Data = Array.Empty();
- private readonly int MaxDataLength = 65536;
- private const int TLS_HEADER_LEN = 5;
- private const int TLS_HANDSHAKE_CONTENT_TYPE = 0x16;
- private const int TLS_HANDSHAKE_TYPE_CLIENT_HELLO = 0x01;
-
- public SniModifire(byte[] data)
- {
- Data = data;
-
- int maxPadding = MaxDataLength - data.Length - 4;
- if (Padding > maxPadding) Padding = maxPadding;
-
- int pos = TLS_HEADER_LEN;
- int dataLength = data.Length;
-
- if (dataLength < TLS_HEADER_LEN)
- {
- ReasonPhrase = "TCP payload is not large enough for a TLS header.";
- return;
- }
-
- // RECORD HEADER
- if (data[0] == 1 & 0x80 == 1 && data[2] == 1)
- {
- ReasonPhrase = "Received SSL 2.0 Client Hello which can not support SNI.";
- return;
- }
- else
- {
- if (data[0] != TLS_HANDSHAKE_CONTENT_TYPE)
- {
- ReasonPhrase = "Request did not begin with TLS handshake.";
- return;
- }
-
- int tls_version_major = data[1];
- int tls_version_minor = data[2];
-
- if (tls_version_major < 3)
- {
- ReasonPhrase = $"Received SSL handshake cannot support SNI. Min TLS: {tls_version_minor} Max TLS: {tls_version_major}";
- return;
- }
-
- // TLS Record Length (Length of handshake message) (2 bytes length)
- int len = (data[3] << 8) + data[4];
- dataLength = Math.Min(dataLength, len + TLS_HEADER_LEN);
-
- // Check we received entire TLS record length
- if (dataLength < len + TLS_HEADER_LEN)
- {
- ReasonPhrase = "Didn't receive entire TLS record length.";
- return;
- }
-
- // HANDSHAKE HEADER
- if (pos + 1 > dataLength)
- {
- ReasonPhrase = "Handshake error.";
- return;
- }
-
- // data[5] == 0x01
- if (data[pos] != TLS_HANDSHAKE_TYPE_CLIENT_HELLO)
- {
- ReasonPhrase = "Not a client hello.";
- return;
- }
-
- //== Create Modified Data
- int mPos = 0;
- byte[] mData1 = new byte[pos - mPos];
- Buffer.BlockCopy(data, 0, mData1, 0, mData1.Length);
- mPos += mData1.Length;
- if (Padding > 0)
- {
- int padding = len + Padding + 4;
- mData1[mData1.Length - 2] = (byte)(padding >> 8);
- mData1[mData1.Length - 1] = (byte)padding;
-
- int len2 = (mData1[mData1.Length - 2] << 8) + mData1[mData1.Length - 1];
- Debug.WriteLine(len2);
- }
- ModifiedData = ModifiedData.Concat(mData1).ToArray();
-
- // Skip Handshake Message Type
- pos += 1;
-
- // Length of client hello data (3 bytes length)
- len = (data[pos] << 16) + (data[pos + 1] << 8) + data[pos + 2];
- // Skip Length of client hello data
- pos += 3;
-
- //== Create Modified Data
- byte[] mData2 = new byte[pos - mPos];
- Buffer.BlockCopy(data, mPos, mData2, 0, mData2.Length);
- mPos += mData2.Length;
- if (Padding > 0)
- {
- int padding = len + Padding + 4;
- mData2[mData2.Length - 3] = (byte)(padding >> 16); // (byte)(padding >> 16)
- mData2[mData2.Length - 2] = (byte)(padding >> 8);
- mData2[mData2.Length - 1] = (byte)padding;
-
- int len2 = (mData2[mData2.Length - 3] << 16) + (mData2[mData2.Length - 2] << 8) + mData2[mData2.Length - 1];
- Debug.WriteLine(len2);
- }
- ModifiedData = ModifiedData.Concat(mData2).ToArray();
-
- // CLIENT VERSION (This field is no longer used for negotiation and is hardcoded to the 1.2 version)
- pos += 2;
-
- // CLIENT RANDOM (32 bytes constant)
- pos += 32;
-
- // SESSION ID
- if (pos + 1 > dataLength)
- {
- ReasonPhrase = "Session ID error.";
- return;
- }
-
- // Session ID Length (1 byte length)
- len = data[pos];
- pos += 1 + len;
-
- // CIPHER SUITES
- if (pos + 2 > dataLength)
- {
- ReasonPhrase = "Cipher Suit error.";
- return;
- }
-
- // Cipher Suits Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2 + len;
-
- // COMPRESSION METHODS (TLS 1.3 no longer allows compression, so this field is always a single entry.
- // 01 - 1 bytes of compression methods. 00 - assigned value for "null" compression.)
- if (pos + 1 > dataLength)
- {
- ReasonPhrase = "Compression Method error.";
- return;
- }
-
- // Compression Methods Length (1 byte length)
- len = data[pos];
- pos += 1 + len;
-
- if (pos == dataLength && tls_version_major == 3 && tls_version_minor == 0)
- {
- ReasonPhrase = "Received SSL 3.0 handshake without extensions.";
- return;
- }
-
- // EXTENSIONS
- if (pos + 2 > dataLength)
- {
- ReasonPhrase = "Extensions error.";
- return;
- }
-
- // Extensions Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2;
-
- //== Create Modified Data
- byte[] mData3 = new byte[pos - mPos];
- Buffer.BlockCopy(data, mPos, mData3, 0, mData3.Length);
- mPos += mData3.Length;
- if (Padding > 0)
- {
- int padding = len + Padding + 4;
- mData3[mData3.Length - 2] = (byte)(padding >> 8);
- mData3[mData3.Length - 1] = (byte)padding;
-
- int len2 = (mData3[mData3.Length - 2] << 8) + mData3[mData3.Length - 1];
- Debug.WriteLine(len2);
- }
- ModifiedData = ModifiedData.Concat(mData3).ToArray();
-
- if (pos + len > dataLength)
- {
- ReasonPhrase = "Wrong Data.";
- return;
- }
-
- byte[] extensionsData = new byte[len];
- Buffer.BlockCopy(data, pos, extensionsData, 0, extensionsData.Length);
-
- ParseExtensions(extensionsData, pos);
- }
- }
-
- private void ParseExtensions(byte[] data, int pos0)
- {
- if (data.Length <= 0) return;
-
- HasTlsExtensions = true;
- AllExtensions.Data = data;
- AllExtensions.Length = data.Length;
- AllExtensions.StartIndex = pos0;
-
- int pos = 0;
- int len;
-
- // Put SNI Extension Last 1
- byte[] sniExtensionLast = Array.Empty();
- bool hasSniLast = false;
-
- // Parse each 4 bytes for the extension header (to avoid index out of range)
- while (pos + 4 <= data.Length)
- {
- len = 2; // Add Extension Type
- len += 2; // Add Extension Length (2 bytes length)
-
- // Add SNI Extension Data
- len += (data[pos + 2] << 8) + data[pos + 3];
-
- byte[] extData = new byte[len];
- Buffer.BlockCopy(data, pos, extData, 0, len);
-
- //if (data[pos] == 0x00 && data[pos + 1] == 0x15) // Extension: Padding
- if (data[pos] == 0x00 && data[pos + 1] == 0x00) // Extension: SNI
- {
- ParseSniExtension(extData, pos0 + pos);
-
- hasSniLast = true;
- sniExtensionLast = extData;
-
- if (!PutSniLast)
- {
- //== Create Modified Data
- if (Padding > 0)
- ModifiedData = ModifiedData.Concat(GetPadding()).ToArray(); // Add Padding before SNI extension
- ModifiedData = ModifiedData.Concat(extData).ToArray(); // Add SNI Extension
- }
- }
- else
- {
- //== Create Modified Data for other extensions
- ModifiedData = ModifiedData.Concat(extData).ToArray();
- }
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x0b) // Extension: EC Point Formats
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x0a) // Extension: Supported Groups
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x23) // Extension: Session Ticket
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x16) // Extension: Encrypt-Then-MAC
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x17) // Extension: Extended Master Secret
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x0d) // Extension: Signature Algorithms
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x2b) // Extension: Supported Versions
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x2d) // Extension: PSK Key Exchange Modes
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x33) // Extension: Key Share
-
- // Advance to the next extension
- pos += len;
- }
-
- // Put SNI Extension Last 2
- if (PutSniLast && hasSniLast)
- {
- //== Create Modified Data
- if (Padding > 0)
- ModifiedData = ModifiedData.Concat(GetPadding()).ToArray(); // Add Padding before SNI extension
- ModifiedData = ModifiedData.Concat(sniExtensionLast).ToArray(); // Add SNI Extension
- }
-
- if (SniList.Any())
- {
- HasSni = true;
- ReasonPhrase = "Successfully read SNI.";
- }
- else
- {
- HasSni = false;
- ReasonPhrase = "Wrong Data.";
- SniList.Clear();
- }
- }
-
- private void ParseSniExtension(byte[] data, int pos0)
- {
- // EXTENSION SERVER NAME
- if (data.Length <= 0) return;
-
- // Google SNI Extension
- //byte[] google = new byte[23];
- //google[0] = 0;
- //google[1] = 0;
- //google[2] = 0;
- //google[3] = 19;
- //google[4] = 0;
- //google[5] = 17;
- //google[6] = 0;
- //google[7] = 0;
- //google[8] = 14;
- //byte[] googleSNI = Encoding.UTF8.GetBytes("www.google.com");
- //Buffer.BlockCopy(googleSNI, 0, google, 9, googleSNI.Length);
- //data = google;
-
- HasSniExtension = true;
- SniExtension sniExtension = new();
- sniExtension.Data = data;
- sniExtension.Length = data.Length;
- sniExtension.StartIndex = pos0;
- SniExtensionList.Add(sniExtension);
-
- int pos = 0;
-
- // Check if it's a server name extension
- if (data[pos] == 0x00 && data[pos + 1] == 0x00)
- {
- pos += 2; // skip server name list length (00 00)
- int len;
-
- while (pos + 1 < data.Length)
- {
- // SNI Extension Data Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2;
-
- // First and Only List Entry Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2; // skip extension header
-
- // List Entry Type - 0x00 is DNS Hostname (1 byte)
- if (data[pos] == 0x00)
- {
- pos += 1; // Skip List Entry Type
-
- // Hostname Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2; // Skip Hostname Length
-
- if (pos + len > data.Length) break;
-
- if (len > 0)
- {
- byte[] outData = new byte[len];
- Buffer.BlockCopy(data, pos, outData, 0, len);
-
- string serverName = Encoding.UTF8.GetString(outData);
- Debug.WriteLine("----------Server Name: " + serverName + ", Length: " + len + ", Whole Data Length: " + Data.Length);
-
- SNI sni = new();
- sni.Data = outData;
- sni.Length = len;
- sni.ServerName = serverName;
- sni.StartIndex = pos0 + pos;
-
- // Add SNI to List
- SniList.Add(sni);
- }
- }
- else
- {
- Debug.WriteLine("SniReader: Unknown server name extension name type.");
- }
-
- pos += len; // Skip Hostname
- }
- }
-
- }
-
- // Padding is a TLS Extension (We add Padding before SNI extension)
- private byte[] GetPadding()
- {
- int padding = Padding + 4;
-
- byte[] paddingData = new byte[padding];
-
- // Padding Extension Type (2 bytes)
- paddingData[0] = 0x00;
- paddingData[1] = 0x15;
-
- // Padding Extension Data Length (2 bytes length)
- paddingData[2] = (byte)(Padding >> 8);
- paddingData[3] = (byte)Padding;
-
- // Add Padding Data which is bunch of zeros
- for (int n = 4; n < padding; n++)
- {
- paddingData[n] = 0x00;
- }
-
- return paddingData;
- }
-
- private byte[] GetMinPadding()
- {
- byte[] paddingData = new byte[4];
-
- // Padding Extension Type (2 bytes)
- paddingData[0] = 0x00;
- paddingData[1] = 0x15;
-
- // Padding Extension Data Length (2 bytes length)
- paddingData[2] = 0x00;
- paddingData[3] = 0x00;
-
- return paddingData;
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/SniReader.cs b/MsmhTools/MsmhTools/SniReader.cs
deleted file mode 100644
index decd2ee..0000000
--- a/MsmhTools/MsmhTools/SniReader.cs
+++ /dev/null
@@ -1,311 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- // https://tls13.xargs.org
- public class SniReader
- {
- public class TlsExtensions
- {
- public byte[] Data { get; set; } = Array.Empty();
- public int StartIndex { get; set; } = -1;
- public int Length { get; set; } = -1;
- }
-
- public class SniExtension
- {
- public byte[] Data { get; set; } = Array.Empty();
- public int StartIndex { get; set; } = -1;
- public int Length { get; set; } = -1;
- }
-
- public class SNI
- {
- public string ServerName { get; set; } = string.Empty;
- public byte[] Data { get; set; } = Array.Empty();
- public int StartIndex { get; set; } = -1;
- public int Length { get; set; } = -1;
- }
-
- public string ReasonPhrase { get; private set; } = string.Empty;
- public bool HasTlsExtensions { get; private set; } = false;
- public TlsExtensions AllExtensions { get; private set; } = new();
- public bool HasSniExtension { get; private set; } = false;
- public List SniExtensionList { get; private set; } = new();
- public bool HasSni { get; private set; } = false;
- public List SniList { get; private set; } = new();
-
- private readonly byte[] Data = Array.Empty();
- private const int TLS_HEADER_LEN = 5;
- private const int TLS_HANDSHAKE_CONTENT_TYPE = 0x16;
- private const int TLS_HANDSHAKE_TYPE_CLIENT_HELLO = 0x01;
-
- public SniReader(byte[] data)
- {
- Data = data;
-
- int pos = TLS_HEADER_LEN;
- int dataLength = data.Length;
-
- if (dataLength < TLS_HEADER_LEN)
- {
- ReasonPhrase = "TCP payload is not large enough for a TLS header.";
- return;
- }
-
- // RECORD HEADER
- if (data[0] == 1 & 0x80 == 1 && data[2] == 1)
- {
- ReasonPhrase = "Received SSL 2.0 Client Hello which can not support SNI.";
- return;
- }
- else
- {
- if (data[0] != TLS_HANDSHAKE_CONTENT_TYPE)
- {
- ReasonPhrase = "Request did not begin with TLS handshake.";
- return;
- }
-
- int tls_version_major = data[1];
- int tls_version_minor = data[2];
-
- if (tls_version_major < 3)
- {
- ReasonPhrase = $"Received SSL handshake cannot support SNI. Min TLS: {tls_version_minor} Max TLS: {tls_version_major}";
- return;
- }
-
- // TLS Record Length (Length of handshake message) (2 bytes length)
- int len = (data[3] << 8) + data[4];
- dataLength = Math.Min(dataLength, len + TLS_HEADER_LEN);
-
- // Check we received entire TLS record length
- if (dataLength < len + TLS_HEADER_LEN)
- {
- ReasonPhrase = "Didn't receive entire TLS record length.";
- return;
- }
-
- // HANDSHAKE HEADER
- if (pos + 1 > dataLength)
- {
- ReasonPhrase = "Handshake error.";
- return;
- }
-
- // data[5] == 0x01
- if (data[pos] != TLS_HANDSHAKE_TYPE_CLIENT_HELLO)
- {
- ReasonPhrase = "Not a client hello.";
- return;
- }
-
- // Skip Handshake Message Type
- pos += 1;
-
- // Length of client hello data (3 bytes length)
- len = (data[pos] << 16) + (data[pos + 1] << 8) + data[pos + 2];
- // Skip Length of client hello data
- pos += 3;
-
- // CLIENT VERSION (This field is no longer used for negotiation and is hardcoded to the 1.2 version)
- pos += 2;
-
- // CLIENT RANDOM (32 bytes constant)
- pos += 32;
-
- // SESSION ID
- if (pos + 1 > dataLength)
- {
- ReasonPhrase = "Session ID error.";
- return;
- }
-
- // Session ID Length (1 byte length)
- len = data[pos];
- pos += 1 + len;
-
- // CIPHER SUITES
- if (pos + 2 > dataLength)
- {
- ReasonPhrase = "Cipher Suit error.";
- return;
- }
-
- // Cipher Suits Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2 + len;
-
- // COMPRESSION METHODS (TLS 1.3 no longer allows compression, so this field is always a single entry.
- // 01 - 1 bytes of compression methods. 00 - assigned value for "null" compression.)
- if (pos + 1 > dataLength)
- {
- ReasonPhrase = "Compression Method error.";
- return;
- }
-
- // Compression Methods Length (1 byte length)
- len = data[pos];
- pos += 1 + len;
-
- if (pos == dataLength && tls_version_major == 3 && tls_version_minor == 0)
- {
- ReasonPhrase = "Received SSL 3.0 handshake without extensions.";
- return;
- }
-
- // EXTENSIONS
- if (pos + 2 > dataLength)
- {
- ReasonPhrase = "Extensions error.";
- return;
- }
-
- // Extensions Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2;
-
- if (pos + len > dataLength)
- {
- ReasonPhrase = "Wrong Data.";
- return;
- }
-
- byte[] extensionsData = new byte[len];
- Buffer.BlockCopy(data, pos, extensionsData, 0, extensionsData.Length);
-
- ParseExtensions(extensionsData, pos);
- }
- }
-
- private void ParseExtensions(byte[] data, int pos0)
- {
- if (data.Length <= 0) return;
-
- HasTlsExtensions = true;
- AllExtensions.Data = data;
- AllExtensions.Length = data.Length;
- AllExtensions.StartIndex = pos0;
-
- int pos = 0;
- int len;
- // Parse each 4 bytes for the extension header (to avoid index out of range)
- while (pos + 4 <= data.Length)
- {
- len = 2; // Add Extension Type
- len += 2; // Add Extension Length (2 bytes length)
-
- // Add SNI Extension Data
- len += (data[pos + 2] << 8) + data[pos + 3];
-
- byte[] extData = new byte[len];
- Buffer.BlockCopy(data, pos, extData, 0, len);
-
- //if (data[pos] == 0x00 && data[pos + 1] == 0x15) // Extension: Padding
- if (data[pos] == 0x00 && data[pos + 1] == 0x00) // Extension: SNI
- ParseSniExtension(extData, pos0 + pos);
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x0b) // Extension: EC Point Formats
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x0a) // Extension: Supported Groups
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x23) // Extension: Session Ticket
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x16) // Extension: Encrypt-Then-MAC
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x17) // Extension: Extended Master Secret
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x0d) // Extension: Signature Algorithms
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x2b) // Extension: Supported Versions
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x2d) // Extension: PSK Key Exchange Modes
- //else if (data[pos] == 0x00 && data[pos + 1] == 0x33) // Extension: Key Share
-
- // Advance to the next extension
- pos += len;
- }
-
- if (SniList.Any())
- {
- HasSni = true;
- ReasonPhrase = "Successfully read SNI.";
- }
- else
- {
- HasSni = false;
- ReasonPhrase = "Wrong Data.";
- SniList.Clear();
- }
- }
-
- private void ParseSniExtension(byte[] data, int pos0)
- {
- // EXTENSION SERVER NAME
- if (data.Length <= 0) return;
-
- HasSniExtension = true;
- SniExtension sniExtension = new();
- sniExtension.Data = data;
- sniExtension.Length = data.Length;
- sniExtension.StartIndex = pos0;
- SniExtensionList.Add(sniExtension);
-
- int pos = 0;
-
- // Check if it's a server name extension
- if (data[pos] == 0x00 && data[pos + 1] == 0x00)
- {
- pos += 2; // skip server name list length (00 00)
- int len;
-
- while (pos + 1 < data.Length)
- {
- // SNI Extension Data Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2;
-
- // First and Only List Entry Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2; // skip extension header
-
- // List Entry Type - 0x00 is DNS Hostname (1 byte)
- if (data[pos] == 0x00)
- {
- pos += 1; // Skip List Entry Type
-
- // Hostname Length (2 bytes length)
- len = (data[pos] << 8) + data[pos + 1];
- pos += 2; // Skip Hostname Length
-
- if (pos + len > data.Length) break;
-
- if (len > 0)
- {
- byte[] outData = new byte[len];
- Buffer.BlockCopy(data, pos, outData, 0, len);
-
- string serverName = Encoding.UTF8.GetString(outData);
- //Debug.WriteLine("----------Server Name: " + serverName + ", Length: " + len + ", Whole Data Length: " + Data.Length);
-
- SNI sni = new();
- sni.Data = outData;
- sni.Length = len;
- sni.ServerName = serverName;
- sni.StartIndex = pos0 + pos;
-
- // Add SNI to List
- SniList.Add(sni);
- }
- }
- else
- {
- Debug.WriteLine("SniReader: Unknown server name extension name type.");
- }
-
- pos += len; // Skip Hostname
- }
- }
-
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/StringTool.cs b/MsmhTools/MsmhTools/StringTool.cs
deleted file mode 100644
index b07449e..0000000
--- a/MsmhTools/MsmhTools/StringTool.cs
+++ /dev/null
@@ -1,698 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-
-namespace MsmhTools
-{
- public static class StringTool
- {
-
- public static bool StartsWith(this string s, char c)
- {
- return s.Length > 0 && s[0] == c;
- }
-
- public static bool StartsWith(this StringBuilder sb, char c)
- {
- return sb.Length > 0 && sb[0] == c;
- }
-
- public static bool EndsWith(this string s, char c)
- {
- return s.Length > 0 && s[^1] == c;
- }
-
- public static bool EndsWith(this StringBuilder sb, char c)
- {
- return sb.Length > 0 && sb[^1] == c;
- }
-
- public static bool Contains(this string source, char value)
- {
- return source.Contains(value);
- }
-
- public static bool Contains(this string source, char[] value)
- {
- return source.IndexOfAny(value) >= 0;
- }
-
- public static bool Contains(this string source, string value, StringComparison comparisonType)
- {
- return source.Contains(value, comparisonType);
- }
-
- //============================================================================================
- private static char[] UnicodeControlChars { get; } = { '\u200E', '\u200F', '\u202A', '\u202B', '\u202C', '\u202D', '\u202E' };
-
- private static char[] PersianChars { get; } = { '\u06CC' };
- //public static char[] PersianChars { get; } = { 'ی' };
-
- public static bool ContainsUnicodeControlChars(this string s)
- {
- return s.Contains(UnicodeControlChars);
- }
-
- public static bool ContainsPersianChars(this string s)
- {
- return s.IndexOfAny(PersianChars) >= 0;
- }
- //============================================================================================
- public static bool IsEmpty(this string text)
- {
- text = text.RemoveHtmlTags();
- if (string.IsNullOrWhiteSpace(text) || text == string.Empty)
- return true;
-
- int countControlChar = 0;
- for (int a = 0; a < text.ToCharArray().Length; a++)
- {
- char ch = text.ToCharArray()[a];
- if (char.IsControl(ch))
- countControlChar++;
- }
-
- if (countControlChar == text.ToCharArray().Length)
- return true;
-
- bool isMatch = Regex.IsMatch(text, @"^[\r\n\s\t\v]+$");
- if (isMatch) return true;
-
- bool ucc = Regex.IsMatch(text, @"^[\u200E\u200F\u202A\u202B\u202C\u202D\u202E']+$");
- if (ucc) return true;
-
- return false;
- }
- //============================================================================================
- public static string RemoveUnicodeControlChars(this string s)
- {
- int max = s.Length;
- var newStr = new char[max];
- int newIdx = 0;
- for (int index = 0; index < max; index++)
- {
- char ch = s[index];
- if (!UnicodeControlChars.Contains(ch))
- {
- newStr[newIdx++] = ch;
- }
- }
-
- return new string(newStr, 0, newIdx);
- }
- //============================================================================================
- public static string RemoveControlChars(this string s)
- {
- int max = s.Length;
- var newStr = new char[max];
- int newIdx = 0;
- for (int index = 0; index < max; index++)
- {
- char ch = s[index];
- if (!char.IsControl(ch))
- {
- newStr[newIdx++] = ch;
- }
- }
-
- return new string(newStr, 0, newIdx);
- }
- //============================================================================================
- public static string RemoveHtmlTags(this string text)
- {
- string? output = HTML.RemoveHtmlTags(text);
- if (output != null)
- return output;
- else
- return string.Empty;
- }
- //============================================================================================
- ///
- /// Truncates the TextBox.Text property so it will fit in the TextBox.
- ///
- public static void Truncate(this TextBox textBox)
- {
- //Determine direction of truncation
- bool direction = false;
- if (textBox.TextAlign == HorizontalAlignment.Right) direction = true;
-
- //Get text
- string truncatedText = textBox.Text;
-
- //Truncate text
- truncatedText = truncatedText.Truncate(textBox.Font, textBox.Width, direction);
-
- //If text truncated
- if (truncatedText != textBox.Text)
- {
- //Set textBox text
- textBox.Text = truncatedText;
-
- //After setting the text, the cursor position changes. Here we set the location of the cursor manually.
- //First we determine the position, the default value applies to direction = left.
-
- //This position is when the cursor needs to be behind the last char. (Example:"…My Text|");
- int position = 0;
-
- //If the truncation direction is to the right the position should be before the ellipsis
- if (!direction)
- {
- //This position is when the cursor needs to be before the last char (which would be the ellipsis). (Example:"My Text|…");
- position = 1;
- }
-
- //Set the cursor position
- textBox.Select(textBox.Text.Length - position, 0);
- }
- }
-
- ///
- /// Truncates the string to be smaller than the desired width.
- ///
- /// The font used to determine the size of the string.
- /// The maximum size the string should be after truncating.
- /// The direction of the truncation. True for left (…ext), False for right(Tex…).
- static public string Truncate(this string text, Font font, int width, bool direction)
- {
- string truncatedText, returnText;
- int charIndex = 0;
- bool truncated = false;
- //When the user is typing and the truncation happens in a TextChanged event, already typed text could get lost.
- //Example: Imagine that the string "Hello Worl" would truncate if we add 'd'. Depending on the font the output
- //could be: "Hello Wor…" (notice the 'l' is missing). This is an undesired effect.
- //To prevent this from happening the ellipsis is included in the initial sizecheck.
- //At this point, the direction is not important so we place ellipsis behind the text.
- truncatedText = text + "…";
-
- //Get the size of the string in pixels.
- SizeF size = MeasureString(truncatedText, font);
-
- //Do while the string is bigger than the desired width.
- while (size.Width > width)
- {
- //Go to next char
- charIndex++;
- //If the character index is larger than or equal to the length of the text, the truncation is unachievable.
- if (charIndex >= text.Length)
- {
- //Truncation is unachievable!
- truncated = true;
- truncatedText = string.Empty;
- //Throw exception so the user knows what's going on.
- string msg = "The desired width of the string is too small to truncate to.";
- Console.WriteLine(msg);
- break;
- //throw new IndexOutOfRangeException(msg);
- }
- else
- {
- //Truncation is still applicable!
- //Raise the flag, indicating that text is truncated.
- truncated = true;
- //Check which way to text should be truncated to, then remove one char and add an ellipsis.
- if (direction)
- {
- //Truncate to the left. Add ellipsis and remove from the left.
- truncatedText = string.Concat("…", text.AsSpan(charIndex));
- }
- else
- {
- //Truncate to the right. Remove from the right and add the ellipsis.
- truncatedText = string.Concat(text.AsSpan(0, text.Length - charIndex), "…");
- }
-
- //Measure the string again.
- size = MeasureString(truncatedText, font);
- }
- }
- //If the text got truncated, change the return value to the truncated text.
- if (truncated) returnText = truncatedText;
- else returnText = text;
- //Return the desired text.
- return returnText;
- }
-
- ///
- /// Measures the size of this string object.
- ///
- /// The string that will be measured.
- /// The font that will be used to measure to size of the string.
- /// A SizeF object containing the height and size of the string.
- private static SizeF MeasureString(string text, Font font)
- {
- //To measure the string we use the Graphics.MeasureString function, which is a method that can be called from a PaintEventArgs instance.
- //To call the constructor of the PaintEventArgs class, we must pass a Graphics object. We'll use a PictureBox object to achieve this.
- PictureBox pb = new();
-
- //Create the PaintEventArgs with the correct parameters.
- PaintEventArgs pea = new(pb.CreateGraphics(), new Rectangle());
- pea.Graphics.PageUnit = GraphicsUnit.Pixel;
- pea.Graphics.PageScale = 1;
-
- //Call the MeasureString method. This methods calculates what the height and width of a string would be, given the specified font.
- SizeF size = pea.Graphics.MeasureString(text, font);
-
- //Return the SizeF object.
- return size;
- }
- //============================================================================================
-
- public static bool LineStartsWithHtmlTag(this string text, bool threeLengthTag, bool includeFont = false)
- {
- if (text == null || !threeLengthTag && !includeFont)
- {
- return false;
- }
-
- return StartsWithHtmlTag(text, threeLengthTag, includeFont);
- }
-
- public static bool LineEndsWithHtmlTag(this string text, bool threeLengthTag, bool includeFont = false)
- {
- if (text == null)
- {
- return false;
- }
-
- var len = text.Length;
- if (len < 6 || text[len - 1] != '>')
- {
- return false;
- }
-
- //
- if (threeLengthTag && len > 3 && text[len - 4] == '<' && text[len - 3] == '/')
- {
- return true;
- }
-
- if (includeFont && len > 8 && text[len - 7] == '<' && text[len - 6] == '/')
- {
- return true;
- }
-
- return false;
- }
-
- public static bool LineBreakStartsWithHtmlTag(this string text, bool threeLengthTag, bool includeFont = false)
- {
- if (text == null || (!threeLengthTag && !includeFont))
- {
- return false;
- }
-
- var newLineIdx = text.IndexOf(Environment.NewLine, StringComparison.Ordinal);
- if (newLineIdx < 0 || text.Length < newLineIdx + 5)
- {
- return false;
- }
-
- text = text[(newLineIdx + 2)..];
- return StartsWithHtmlTag(text, threeLengthTag, includeFont);
- }
-
- private static bool StartsWithHtmlTag(string text, bool threeLengthTag, bool includeFont)
- {
- if (threeLengthTag && text.Length >= 3 && text[0] == '<' && text[2] == '>' && (text[1] == 'i' || text[1] == 'I' || text[1] == 'u' || text[1] == 'U' || text[1] == 'b' || text[1] == 'B'))
- {
- return true;
- }
-
- if (includeFont && text.Length > 5 && text.StartsWith("', 5) >= 5; // or
- }
-
- return false;
- }
-
- public static int CountWords(this string source)
- {
- return HTML.RemoveHtmlTags(source).Split(new[] { ' ', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries).Length;
- }
-
- // http://www.codeproject.com/Articles/43726/Optimizing-string-operations-in-C
- public static int FastIndexOf(this string source, string pattern)
- {
- if (string.IsNullOrEmpty(pattern))
- {
- return -1;
- }
-
- char c0 = pattern[0];
- if (pattern.Length == 1)
- {
- return source.IndexOf(c0);
- }
-
- int limit = source.Length - pattern.Length + 1;
- if (limit < 1)
- {
- return -1;
- }
-
- char c1 = pattern[1];
-
- // Find the first occurrence of the first character
- int first = source.IndexOf(c0, 0, limit);
- while (first != -1)
- {
- // Check if the following character is the same like
- // the 2nd character of "pattern"
- if (source[first + 1] != c1)
- {
- first = source.IndexOf(c0, ++first, limit - first);
- continue;
- }
-
- // Check the rest of "pattern" (starting with the 3rd character)
- var found = true;
- for (int j = 2; j < pattern.Length; j++)
- {
- if (source[first + j] != pattern[j])
- {
- found = false;
- break;
- }
- }
-
- // If the whole word was found, return its index, otherwise try again
- if (found)
- {
- return first;
- }
-
- first = source.IndexOf(c0, ++first, limit - first);
- }
-
- return -1;
- }
-
- public static int IndexOfAny(this string s, string[] words, StringComparison comparisonType)
- {
- if (words == null || string.IsNullOrEmpty(s))
- {
- return -1;
- }
-
- for (int i = 0; i < words.Length; i++)
- {
- var idx = s.IndexOf(words[i], comparisonType);
- if (idx >= 0)
- {
- return idx;
- }
- }
-
- return -1;
- }
-
- public static string FixExtraSpaces(this string s)
- {
- if (string.IsNullOrEmpty(s))
- {
- return s;
- }
-
- const char whiteSpace = ' ';
- int k = -1;
- for (int i = s.Length - 1; i >= 0; i--)
- {
- char ch = s[i];
- if (k < 2)
- {
- if (ch == whiteSpace)
- {
- k = i + 1;
- }
- }
- else if (ch != whiteSpace)
- {
- // only keep white space if it doesn't succeed/precede CRLF
- int skipCount = (ch == '\n' || ch == '\r') || (k < s.Length && (s[k] == '\n' || s[k] == '\r')) ? 1 : 2;
-
- // extra space found
- if (k - (i + skipCount) >= 1)
- {
- s = s.Remove(i + 1, k - (i + skipCount));
- }
-
- // Reset remove length.
- k = -1;
- }
- }
-
- return s;
- }
-
- public static bool ContainsLetter(this string s)
- {
- if (s != null)
- {
- foreach (var index in StringInfo.ParseCombiningCharacters(s))
- {
- var uc = CharUnicodeInfo.GetUnicodeCategory(s, index);
- if (uc == UnicodeCategory.LowercaseLetter || uc == UnicodeCategory.UppercaseLetter || uc == UnicodeCategory.TitlecaseLetter || uc == UnicodeCategory.ModifierLetter || uc == UnicodeCategory.OtherLetter)
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- public static bool ContainsNumber(this string s)
- {
- if (s == null)
- {
- return false;
- }
-
- int max = s.Length;
- for (int index = 0; index < max; index++)
- {
- var ch = s[index];
- if (char.IsNumber(ch))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public static bool IsOnlyControlCharsOrWhiteSpace(this string s)
- {
- if (string.IsNullOrEmpty(s))
- {
- return true;
- }
-
- int max = s.Length;
- for (int index = 0; index < max; index++)
- {
- char ch = s[index];
- if (!char.IsControl(ch) && !char.IsWhiteSpace(ch) && !UnicodeControlChars.Contains(ch))
- {
- return false;
- }
- }
-
- return true;
- }
-
-
- public static string RemoveControlCharsButWhiteSpace(this string s)
- {
- int max = s.Length;
- var newStr = new char[max];
- int newIdx = 0;
- for (int index = 0; index < max; index++)
- {
- var ch = s[index];
- if (!char.IsControl(ch) || ch == '\u000d' || ch == '\u000a' || ch == '\u0009')
- {
- newStr[newIdx++] = ch;
- }
- }
-
- return new string(newStr, 0, newIdx);
- }
-
- public static string CapitalizeFirstLetter(this string s, CultureInfo? ci = null)
- {
- var si = new StringInfo(s);
- if (ci == null)
- {
- ci = CultureInfo.CurrentCulture;
- }
-
- if (si.LengthInTextElements > 0)
- {
- s = si.SubstringByTextElements(0, 1).ToUpper(ci);
- }
-
- if (si.LengthInTextElements > 1)
- {
- s += si.SubstringByTextElements(1);
- }
-
- return s;
- }
-
- public static string RemoveChar(this string value, char charToRemove)
- {
- char[] array = new char[value.Length];
- int arrayIndex = 0;
- for (int i = 0; i < value.Length; i++)
- {
- char ch = value[i];
- if (ch != charToRemove)
- {
- array[arrayIndex++] = ch;
- }
- }
-
- return new string(array, 0, arrayIndex);
- }
-
- public static string RemoveChar(this string value, char charToRemove, char charToRemove2)
- {
- char[] array = new char[value.Length];
- int arrayIndex = 0;
- for (int i = 0; i < value.Length; i++)
- {
- char ch = value[i];
- if (ch != charToRemove && ch != charToRemove2)
- {
- array[arrayIndex++] = ch;
- }
- }
-
- return new string(array, 0, arrayIndex);
- }
-
- public static string RemoveChar(this string value, params char[] charsToRemove)
- {
- var h = new HashSet(charsToRemove);
- char[] array = new char[value.Length];
- int arrayIndex = 0;
- for (int i = 0; i < value.Length; i++)
- {
- char ch = value[i];
- if (!h.Contains(ch))
- {
- array[arrayIndex++] = ch;
- }
- }
-
- return new string(array, 0, arrayIndex);
- }
-
- ///
- /// Count characters excl. white spaces, ssa-tags, html-tags, control-characters, normal spaces and
- /// Arabic diacritics depending on parameter.
- ///
- public static int CountCharacters(this string value, bool removeNormalSpace, bool ignoreArabicDiacritics)
- {
- int length = 0;
- const char zeroWidthSpace = '\u200B';
- const char zeroWidthNoBreakSpace = '\uFEFF';
- char normalSpace = removeNormalSpace ? ' ' : zeroWidthSpace;
- bool ssaTagOn = false;
- bool htmlTagOn = false;
- var max = value.Length;
- for (int i = 0; i < max; i++)
- {
- char ch = value[i];
- if (ssaTagOn)
- {
- if (ch == '}')
- {
- ssaTagOn = false;
- }
- }
- else if (htmlTagOn)
- {
- if (ch == '>')
- {
- htmlTagOn = false;
- }
- }
- else if (ch == '{' && i < value.Length - 1 && value[i + 1] == '\\')
- {
- ssaTagOn = true;
- }
- else if (ch == '<' && i < value.Length - 1 && (value[i + 1] == '/' || char.IsLetter(value[i + 1])) &&
- value.IndexOf('>', i) > 0 && IsKnownHtmlTag(value, i))
- {
- htmlTagOn = true;
- }
- else if (!char.IsControl(ch) &&
- ch != zeroWidthSpace &&
- ch != zeroWidthNoBreakSpace &&
- ch != normalSpace &&
- ch != '\u200E' &&
- ch != '\u200F' &&
- ch != '\u202A' &&
- ch != '\u202B' &&
- ch != '\u202C' &&
- ch != '\u202D' &&
- ch != '\u202E' &&
- !(ignoreArabicDiacritics && ch >= '\u064B' && ch <= '\u0653'))
- {
- length++;
- }
- }
-
- return length;
- }
-
- private static bool IsKnownHtmlTag(string input, int idx)
- {
- var s = input.Remove(0, idx + 1).ToLowerInvariant();
- return s.StartsWith('/') ||
- s.StartsWith("i>", StringComparison.Ordinal) ||
- s.StartsWith("b>", StringComparison.Ordinal) ||
- s.StartsWith("u>", StringComparison.Ordinal) ||
- s.StartsWith("font ", StringComparison.Ordinal) ||
- s.StartsWith("ruby", StringComparison.Ordinal) ||
- s.StartsWith("span>", StringComparison.Ordinal) ||
- s.StartsWith("p>", StringComparison.Ordinal) ||
- s.StartsWith("br>", StringComparison.Ordinal) ||
- s.StartsWith("div>", StringComparison.Ordinal) ||
- s.StartsWith("div ", StringComparison.Ordinal);
- }
-
- public static bool HasSentenceEnding(this string value)
- {
- return value.HasSentenceEnding(string.Empty);
- }
-
- public static bool HasSentenceEnding(this string value, string twoLetterLanguageCode)
- {
- if (string.IsNullOrEmpty(value))
- {
- return false;
- }
-
- string s = HTML.RemoveHtmlTags(value).TrimEnd('"').TrimEnd('”');
- if (s == string.Empty)
- {
- return false;
- }
-
- var last = s[^1];
- return last == '.' || last == '!' || last == '?' || last == ']' || last == ')' || last == '…' || last == '♪' || last == '؟' ||
- twoLetterLanguageCode == "el" && last == ';' || twoLetterLanguageCode == "el" && last == '\u037E' ||
- last == '-' && s.Length > 3 && s.EndsWith("--", StringComparison.Ordinal) && char.IsLetter(s[^3]) ||
- last == '—' && s.Length > 2 && char.IsLetter(s[^2]);
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/Texts.cs b/MsmhTools/MsmhTools/Texts.cs
deleted file mode 100644
index c81fe91..0000000
--- a/MsmhTools/MsmhTools/Texts.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System;
-using System.Text;
-using System.Security.Cryptography;
-using Force.Crc32;
-using System.Text.RegularExpressions;
-
-namespace MsmhTools
-{
- public class Texts
- {
- //-----------------------------------------------------------------------------------
- public static string? GetTextByLineNumber(string text, int lineNo)
- {
- string[] lines = text.Replace("\r", "").Split('\n');
- return lines.Length >= lineNo ? lines[lineNo - 1] : null;
- }
- //-----------------------------------------------------------------------------------
- public static bool IsValidRegex(string pattern)
- {
- if (string.IsNullOrWhiteSpace(pattern)) return false;
-
- try
- {
- Regex.Match("", pattern);
- }
- catch (ArgumentException)
- {
- return false;
- }
-
- return true;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/Themes.cs b/MsmhTools/MsmhTools/Themes.cs
deleted file mode 100644
index 8788bb1..0000000
--- a/MsmhTools/MsmhTools/Themes.cs
+++ /dev/null
@@ -1,292 +0,0 @@
-using System;
-using CustomControls;
-using MsmhTools;
-
-namespace MsmhTools.Themes
-{
- public static class Theme
- {
- // DodgerBlue: HEX value: #1E90FF RGB value: 30,144,255
- // IndianRed: HEX value: #CD5C5C RGB value: 205,92,92
- //=======================================================================================
- public struct Themes
- {
- public const string Light = "Light";
- public const string Dark = "Dark";
- }
- //=======================================================================================
- public static void LoadTheme(Form form, string theme)
- {
- if (theme.Equals(Themes.Light))
- {
- // Load Light Theme
- Colors.InitializeLight();
- foreach (Control c in Controllers.GetAllControls(form))
- {
- SetColors(c);
- }
- SetColorsByType(form);
- }
- else if (theme.Equals(Themes.Dark))
- {
- // Load Dark Theme
- Colors.InitializeDark();
- form.SetDarkTitleBar(true); // Make TitleBar Black
- foreach (Control c in Controllers.GetAllControls(form))
- {
- SetColors(c);
- }
- SetColorsByType(form);
- }
-
- // Set Static CustomMessageBox Parent
- CustomMessageBox.SetParent = form;
- }
- //=======================================================================================
- private static void SetColorsByType(Form form)
- {
- // Find ContextMenu Controls
- foreach (var ccms in Controllers.GetAllControlsByType(form))
- {
- ccms.BackColor = Colors.BackColor;
- ccms.ForeColor = Colors.ForeColor;
- ccms.BorderColor = Colors.Border;
- ccms.SelectionColor = Colors.Selection;
- }
- // Find LinkLabel
- foreach (var ll in Controllers.GetAllControlsByType(form))
- {
- ll.BackColor = Colors.BackColor;
- ll.ForeColor = Colors.ForeColor;
- ll.LinkColor = Colors.Link;
- ll.ActiveLinkColor = Colors.LinkActive;
- ll.VisitedLinkColor = Colors.LinkVisited;
- }
- // Find ToolStrip Controls
- foreach (var ctscb in Controllers.GetAllControlsByType(form))
- {
- ctscb.BackColor = Colors.BackColor;
- ctscb.ForeColor = Colors.ForeColor;
- ctscb.BorderColor = Colors.Border;
- ctscb.SelectionColor = Colors.Selection;
- }
- }
- //=======================================================================================
- public static void SetColors(Control c)
- {
- if (c is TabPage) return;
-
- c.BackColor = Colors.BackColor;
- c.ForeColor = Colors.ForeColor;
- if (c is CustomButton customButton)
- {
- customButton.BorderColor = Colors.Border;
- customButton.SelectionColor = Colors.SelectionRectangle;
- }
- else if (c is CustomCheckBox customCheckBox)
- {
- customCheckBox.BorderColor = Colors.Border;
- customCheckBox.CheckColor = Colors.Tick;
- customCheckBox.SelectionColor = Colors.SelectionRectangle;
- }
- else if (c is CustomComboBox customComboBox)
- {
- customComboBox.BorderColor = Colors.Border;
- customComboBox.SelectionColor = Colors.Selection;
- }
- else if (c is CustomContextMenuStrip customContextMenuStrip)
- {
- customContextMenuStrip.BorderColor = Colors.Border;
- customContextMenuStrip.SelectionColor = Colors.Selection;
- }
- else if (c is CustomDataGridView customDataGridView)
- {
- customDataGridView.BorderColor = Colors.Border;
- customDataGridView.SelectionColor = Colors.Selection;
- customDataGridView.GridColor = Colors.GridLines;
- customDataGridView.CheckColor = Colors.Tick;
- }
- else if (c is CustomGroupBox customGroupBox)
- {
- customGroupBox.BorderColor = Colors.Border;
- }
- else if (c is CustomLabel customLabel)
- {
- customLabel.BorderColor = Colors.Border;
- customLabel.BackColor = Colors.BackColor;
- customLabel.ForeColor = Colors.ForeColor;
- }
- else if (c is CustomMenuStrip customMenuStrip)
- {
- customMenuStrip.BorderColor = Colors.Border;
- customMenuStrip.SelectionColor = Colors.Selection;
- }
- else if (c is CustomNumericUpDown customNumericUpDown)
- {
- customNumericUpDown.BorderColor = Colors.Border;
- }
- else if (c is CustomPanel customPanel)
- {
- customPanel.BorderColor = Colors.Border;
- }
- else if (c is CustomProgressBar customProgressBar)
- {
- customProgressBar.BorderColor = Colors.Border;
- customProgressBar.ChunksColor = Colors.Chunks;
- }
- else if (c is CustomRadioButton customRadioButton)
- {
- customRadioButton.BorderColor = Colors.Border;
- customRadioButton.CheckColor = Colors.Tick;
- customRadioButton.SelectionColor = Colors.SelectionRectangle;
- }
- else if (c is CustomRichTextBox customRichTextBox)
- {
- customRichTextBox.BorderColor = Colors.Border;
- }
- else if (c is CustomStatusStrip customStatusStrip)
- {
- customStatusStrip.BorderColor = Colors.Border;
- customStatusStrip.SelectionColor = Colors.Selection;
- }
- else if (c is CustomTabControl customTabControl)
- {
- customTabControl.BackColor = Colors.BackColor;
- customTabControl.ForeColor = Colors.ForeColor;
- customTabControl.BorderColor = Colors.Border;
- }
- else if (c is CustomTextBox customTextBox)
- {
- customTextBox.BorderColor = Colors.Border;
- }
- else if (c is CustomTimeUpDown customTimeUpDown)
- {
- customTimeUpDown.BorderColor = Colors.Border;
- }
- else if (c is CustomToolStrip customToolStrip)
- {
- customToolStrip.BorderColor = Colors.Border;
- customToolStrip.SelectionColor = Colors.Selection;
- foreach (ToolStripItem item in customToolStrip.Items)
- {
- var items = Controllers.GetAllToolStripItems(item);
- foreach (ToolStripItem? toolItem in items)
- if (toolItem is ToolStripSeparator tss)
- {
- tss.ForeColor = Colors.Border;
- }
- }
- }
- else if (c is CustomVScrollBar customVScrollBar)
- {
- customVScrollBar.BorderColor = Colors.Border;
- }
- else if (c is Label label)
- {
- label.BackColor = Colors.BackColor;
- label.ForeColor = Colors.ForeColor;
- }
- else if (c is LinkLabel linkLabel)
- {
- linkLabel.LinkColor = Colors.Link;
- linkLabel.ActiveLinkColor = Colors.LinkActive;
- linkLabel.VisitedLinkColor = Colors.LinkVisited;
- }
- }
- //=======================================================================================
- private sealed class Colors
- {
- internal static Color BackColor { get; set; }
- internal static Color BackColorDisabled { get; set; }
- internal static Color BackColorDarker { get; set; }
- internal static Color BackColorDarkerDisabled { get; set; }
- internal static Color BackColorMouseHover { get; set; }
- internal static Color BackColorMouseDown { get; set; }
- internal static Color ForeColor { get; set; }
- internal static Color ForeColorDisabled { get; set; }
- internal static Color Border { get; set; }
- internal static Color BorderDisabled { get; set; }
- internal static Color Chunks { get; set; }
- internal static Color GridLines { get; set; }
- internal static Color GridLinesDisabled { get; set; }
- internal static Color Link { get; set; }
- internal static Color LinkActive { get; set; }
- internal static Color LinkVisited { get; set; }
- internal static Color Selection { get; set; }
- internal static Color SelectionRectangle { get; set; }
- internal static Color SelectionUnfocused { get; set; }
- internal static Color Tick { get; set; }
- internal static Color TickDisabled { get; set; }
- internal static Color TitleBarBackColor { get; set; }
- internal static Color TitleBarForeColor { get; set; }
- internal static void InitializeLight()
- {
- BackColor = SystemColors.Control;
- BackColorDisabled = BackColor.ChangeBrightness(-0.3f);
- BackColorDarker = BackColor.ChangeBrightness(-0.3f);
- BackColorDarkerDisabled = BackColorDarker.ChangeBrightness(-0.3f);
- BackColorMouseHover = BackColor.ChangeBrightness(-0.1f);
- BackColorMouseDown = BackColorMouseHover.ChangeBrightness(-0.1f);
- ForeColor = Color.Black;
- ForeColorDisabled = ForeColor.ChangeBrightness(0.3f);
- Border = Color.DodgerBlue;
- BorderDisabled = Border.ChangeBrightness(0.3f);
- Chunks = Color.DodgerBlue;
- GridLines = ForeColor.ChangeBrightness(0.5f);
- GridLinesDisabled = GridLines.ChangeBrightness(0.3f);
- Link = ForeColor;
- LinkActive = Color.IndianRed;
- LinkVisited = Link;
- Selection = Color.FromArgb(104, 151, 187);
- SelectionRectangle = Selection;
- SelectionUnfocused = Selection.ChangeBrightness(0.3f);
- Tick = Border;
- TickDisabled = Tick.ChangeBrightness(0.3f);
- TitleBarBackColor = Color.LightBlue;
- TitleBarForeColor = Color.Black;
- CC();
- }
- internal static void InitializeDark()
- {
- BackColor = Color.DarkGray.ChangeBrightness(-0.8f);
- BackColorDisabled = BackColor.ChangeBrightness(0.3f);
- BackColorDarker = BackColor.ChangeBrightness(-0.3f);
- BackColorDarkerDisabled = BackColorDarker.ChangeBrightness(0.3f);
- BackColorMouseHover = BackColor.ChangeBrightness(0.1f);
- BackColorMouseDown = BackColorMouseHover.ChangeBrightness(0.1f);
- ForeColor = Color.LightGray;
- ForeColorDisabled = ForeColor.ChangeBrightness(-0.3f);
- Border = Color.DodgerBlue;
- BorderDisabled = Border.ChangeBrightness(-0.3f);
- Chunks = Color.DodgerBlue;
- GridLines = ForeColor.ChangeBrightness(-0.5f);
- GridLinesDisabled = GridLines.ChangeBrightness(-0.3f);
- Link = ForeColor;
- LinkActive = Color.IndianRed;
- LinkVisited = Link;
- Selection = Color.Black;
- SelectionRectangle = Selection;
- SelectionUnfocused = Selection.ChangeBrightness(0.3f);
- Tick = Border;
- TickDisabled = Tick.ChangeBrightness(-0.3f);
- TitleBarBackColor = Color.DarkBlue;
- TitleBarForeColor = Color.White;
- CC();
- }
-
- private static void CC()
- {
- // MessageBox
- //CustomMessageBox
- CustomMessageBox.BackColor = BackColor;
- CustomMessageBox.ForeColor = ForeColor;
- CustomMessageBox.BorderColor = Border;
-
- // InputBox
- CustomInputBox.BackColor = BackColor;
- CustomInputBox.ForeColor = ForeColor;
- CustomInputBox.BorderColor = Border;
- }
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/TimeConvert.cs b/MsmhTools/MsmhTools/TimeConvert.cs
deleted file mode 100644
index d87506a..0000000
--- a/MsmhTools/MsmhTools/TimeConvert.cs
+++ /dev/null
@@ -1,390 +0,0 @@
-using System;
-using System.Globalization;
-
-namespace MsmhTools
-{
- public class TimeConvert
- {
- private static readonly char[] TimeSplitChars = { ':', ',', '.' };
- private const double BaseUnit = 1000.0; // Base unit of time
-
- public bool IsMaxTime => Math.Abs(TotalMilliseconds - MaxTimeTotalMilliseconds) < 0.01;
- public const double MaxTimeTotalMilliseconds = 359999999; // new TimeConvert(99, 59, 59, 999).TotalMilliseconds
-
- public static double CurrentFrameRate { get; set; } = FrameRate.f23976;
- public static string CurrentTimeFormat { get; set; } = TimeFormat.HHMMSSMS;
-
- public static TimeConvert FromSeconds(double seconds)
- {
- return new TimeConvert(seconds * BaseUnit);
- }
-
- public static TimeConvert FromMilliseconds(double milliseconds)
- {
- return new TimeConvert(milliseconds);
- }
-
- public static double ParseToMilliseconds(string text)
- {
- var parts = text.Split(TimeSplitChars, StringSplitOptions.RemoveEmptyEntries);
- if (parts.Length == 4)
- {
- if (int.TryParse(parts[0], out var hours) && int.TryParse(parts[1], out var minutes) && int.TryParse(parts[2], out var seconds) && int.TryParse(parts[3], out var milliseconds))
- {
- return new TimeSpan(0, hours, minutes, seconds, milliseconds).TotalMilliseconds;
- }
- }
- return 0;
- }
-
- public static double ParseHHMMSSFFToMilliseconds(string text)
- {
- var parts = text.Split(TimeSplitChars, StringSplitOptions.RemoveEmptyEntries);
- if (parts.Length == 4)
- {
- if (int.TryParse(parts[0], out var hours) && int.TryParse(parts[1], out var minutes) && int.TryParse(parts[2], out var seconds) && int.TryParse(parts[3], out var frames))
- {
- return new TimeConvert(hours, minutes, seconds, FramesToMillisecondsMax999(frames)).TotalMilliseconds;
- }
- }
- return 0;
- }
-
- public static double ParseHHMMSSToMilliseconds(string text)
- {
- var parts = text.Split(TimeSplitChars, StringSplitOptions.RemoveEmptyEntries);
- if (parts.Length == 3)
- {
- if (int.TryParse(parts[0], out var hours) && int.TryParse(parts[1], out var minutes) && int.TryParse(parts[2], out var seconds))
- {
- return new TimeConvert(hours, minutes, seconds, 0).TotalMilliseconds;
- }
- }
- return 0;
- }
-
- public TimeConvert()
- {
- }
-
- public TimeConvert(TimeSpan timeSpan)
- {
- TotalMilliseconds = timeSpan.TotalMilliseconds;
- }
-
- public TimeConvert(double totalMilliseconds)
- {
- TotalMilliseconds = totalMilliseconds;
- }
-
- public TimeConvert(int hours, int minutes, int seconds, int milliseconds)
- {
- TotalMilliseconds = hours * 60 * 60 * BaseUnit + minutes * 60 * BaseUnit + seconds * BaseUnit + milliseconds;
- }
-
- public int Hours
- {
- get
- {
- var ts = TimeSpan;
- return ts.Hours + ts.Days * 24;
- }
- set
- {
- var ts = TimeSpan;
- TotalMilliseconds = new TimeSpan(ts.Days, value, ts.Minutes, ts.Seconds, ts.Milliseconds).TotalMilliseconds;
- }
- }
-
- public int Minutes
- {
- get => TimeSpan.Minutes;
- set
- {
- var ts = TimeSpan;
- TotalMilliseconds = new TimeSpan(ts.Days, ts.Hours, value, ts.Seconds, ts.Milliseconds).TotalMilliseconds;
- }
- }
-
- public int Seconds
- {
- get => TimeSpan.Seconds;
- set
- {
- var ts = TimeSpan;
- TotalMilliseconds = new TimeSpan(ts.Days, ts.Hours, ts.Minutes, value, ts.Milliseconds).TotalMilliseconds;
- }
- }
-
- public int Milliseconds
- {
- get => TimeSpan.Milliseconds;
- set
- {
- var ts = TimeSpan;
- TotalMilliseconds = new TimeSpan(ts.Days, ts.Hours, ts.Minutes, ts.Seconds, value).TotalMilliseconds;
- }
- }
-
- public double TotalMilliseconds { get; set; }
-
- public double TotalSeconds
- {
- get => TotalMilliseconds / BaseUnit;
- set => TotalMilliseconds = value * BaseUnit;
- }
-
- public TimeSpan TimeSpan
- {
- get
- {
- if (TotalMilliseconds > MaxTimeTotalMilliseconds || TotalMilliseconds < -MaxTimeTotalMilliseconds)
- {
- return new TimeSpan();
- }
-
- return TimeSpan.FromMilliseconds(TotalMilliseconds);
- }
- set => TotalMilliseconds = value.TotalMilliseconds;
- }
-
- public override string ToString() => ToString(false);
-
- public string ToString(bool localize)
- {
- var ts = TimeSpan;
- string decimalSeparator = localize ? CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator : ",";
- string s = $"{ts.Hours + ts.Days * 24:00}:{ts.Minutes:00}:{ts.Seconds:00}{decimalSeparator}{ts.Milliseconds:000}";
-
- return PrefixSign(s);
- }
-
- public string ToShortString(bool localize = false)
- {
- var ts = TimeSpan;
- string decimalSeparator = localize ? CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator : ",";
- string s;
- if (ts.Minutes == 0 && ts.Hours == 0 && ts.Days == 0)
- {
- s = $"{ts.Seconds:0}{decimalSeparator}{ts.Milliseconds:000}";
- }
- else if (ts.Hours == 0 && ts.Days == 0)
- {
- s = $"{ts.Minutes:0}:{ts.Seconds:00}{decimalSeparator}{ts.Milliseconds:000}";
- }
- else
- {
- s = $"{ts.Hours + ts.Days * 24:0}:{ts.Minutes:00}:{ts.Seconds:00}{decimalSeparator}{ts.Milliseconds:000}";
- }
- return PrefixSign(s);
- }
-
- public string ToShortStringHHMMSSFF()
- {
- string s = ToHHMMSSFF();
- string pre = string.Empty;
- if (s.StartsWith('-'))
- {
- pre = "-";
- s = s.TrimStart('-');
- }
- int j = 0;
- int len = s.Length;
- while (j + 6 < len && s[j] == '0' && s[j + 1] == '0' && s[j + 2] == ':')
- {
- j += 3;
- }
- s = j > 0 ? s.Substring(j) : s;
- return pre + s;
- }
-
- public string ToHHMMSSFF()
- {
- string s;
- var ts = TimeSpan;
- var frames = Math.Round(ts.Milliseconds / (BaseUnit / CurrentFrameRate));
- if (frames >= CurrentFrameRate - 0.001)
- {
- var newTs = new TimeSpan(ts.Ticks);
- newTs = newTs.Add(new TimeSpan(0, 0, 1));
- s = $"{newTs.Days * 24 + newTs.Hours:00}:{newTs.Minutes:00}:{newTs.Seconds:00}:{0:00}";
- }
- else
- {
- s = $"{ts.Days * 24 + ts.Hours:00}:{ts.Minutes:00}:{ts.Seconds:00}:{MillisecondsToFramesMaxFrameRate(ts.Milliseconds):00}";
- }
- return PrefixSign(s);
- }
-
- public string ToHHMMSS()
- {
- string s;
- var ts = TimeSpan;
- var frames = Math.Round(ts.Milliseconds / (BaseUnit / CurrentFrameRate));
- if (frames >= CurrentFrameRate - 0.001)
- {
- var newTs = new TimeSpan(ts.Ticks);
- newTs = newTs.Add(new TimeSpan(0, 0, 1));
- s = $"{newTs.Days * 24 + newTs.Hours:00}:{newTs.Minutes:00}:{newTs.Seconds:00}";
- }
- else
- {
- s = $"{ts.Days * 24 + ts.Hours:00}:{ts.Minutes:00}:{ts.Seconds:00}";
- }
- return PrefixSign(s);
- }
-
- public string ToHHMMSSFFDropFrame()
- {
- string s;
- var ts = TimeSpan;
- var frames = Math.Round(ts.Milliseconds / (BaseUnit / CurrentFrameRate));
- if (frames >= CurrentFrameRate - 0.001)
- {
- var newTs = new TimeSpan(ts.Ticks);
- newTs = newTs.Add(new TimeSpan(0, 0, 1));
- s = $"{newTs.Days * 24 + newTs.Hours:00}:{newTs.Minutes:00}:{newTs.Seconds:00};{0:00}";
- }
- else
- {
- s = $"{ts.Days * 24 + ts.Hours:00}:{ts.Minutes:00}:{ts.Seconds:00};{MillisecondsToFramesMaxFrameRate(ts.Milliseconds):00}";
- }
- return PrefixSign(s);
- }
-
- public string ToSSFF()
- {
- string s;
- var ts = TimeSpan;
- var frames = Math.Round(ts.Milliseconds / (BaseUnit / CurrentFrameRate));
- if (frames >= CurrentFrameRate - 0.001)
- {
- s = $"{ts.Seconds + 1:00}:{0:00}";
- }
- else
- {
- s = $"{ts.Seconds:00}:{MillisecondsToFramesMaxFrameRate(ts.Milliseconds):00}";
- }
- return PrefixSign(s);
- }
-
- public string ToHHMMSSPeriodFF()
- {
- string s;
- var ts = TimeSpan;
- var frames = Math.Round(ts.Milliseconds / (BaseUnit / CurrentFrameRate));
- if (frames >= CurrentFrameRate - 0.001)
- {
- var newTs = new TimeSpan(ts.Ticks);
- newTs = newTs.Add(new TimeSpan(0, 0, 1));
- s = $"{newTs.Days * 24 + newTs.Hours:00}:{newTs.Minutes:00}:{newTs.Seconds:00}.{0:00}";
- }
- else
- {
- s = $"{ts.Days * 24 + ts.Hours:00}:{ts.Minutes:00}:{ts.Seconds:00}.{MillisecondsToFramesMaxFrameRate(ts.Milliseconds):00}";
- }
-
- return PrefixSign(s);
- }
-
- private string PrefixSign(string time) => TotalMilliseconds >= 0 ? time : $"-{time.RemoveChar('-')}";
-
- public string ToDisplayString()
- {
- if (IsMaxTime)
- {
- return "-";
- }
-
- if (CurrentTimeFormat == TimeFormat.HHMMSSFF)
- {
- return ToHHMMSSFF();
- }
-
- return ToString(true);
- }
-
- public string ToShortDisplayString()
- {
- if (IsMaxTime)
- {
- return "-";
- }
-
- if (CurrentTimeFormat == TimeFormat.HHMMSSFF)
- {
- return ToShortStringHHMMSSFF();
- }
-
- return ToShortString(true);
- }
-
- //=======================================================================================
- public static int FramesToMillisecondsMax999(double frames)
- {
- int ms = (int)Math.Round(frames * (BaseUnit / GetFrameForCalculation(CurrentFrameRate)));
- return Math.Min(ms, 999);
- }
-
- public static int FramesToMilliseconds(double frames)
- {
- return (int)Math.Round(frames * (BaseUnit / GetFrameForCalculation(CurrentFrameRate)));
-
- }
-
- public static int MillisecondsToFrames(double milliseconds)
- {
- return MillisecondsToFrames(milliseconds, CurrentFrameRate);
- }
-
- public static int MillisecondsToFrames(double milliseconds, double frameRate)
- {
- return (int)Math.Round(milliseconds / (BaseUnit / GetFrameForCalculation(frameRate)), MidpointRounding.AwayFromZero);
- }
-
- private static double GetFrameForCalculation(double frameRate)
- {
- if (Math.Abs(frameRate - 23.976) < 0.01)
- {
- return 24000.0 / 1001.0;
- }
- if (Math.Abs(frameRate - 29.97) < 0.01)
- {
- return 30000.0 / 1001.0;
- }
- if (Math.Abs(frameRate - 59.94) < 0.01)
- {
- return 60000.0 / 1001.0;
- }
-
- return frameRate;
- }
-
- private static int MillisecondsToFramesMaxFrameRate(double milliseconds)
- {
- int frames = (int)Math.Round(milliseconds / (BaseUnit / GetFrameForCalculation(CurrentFrameRate)), MidpointRounding.AwayFromZero);
- if (frames >= CurrentFrameRate)
- {
- frames = (int)(CurrentFrameRate - 0.01);
- }
-
- return frames;
- }
-
- public struct FrameRate
- {
- public const double f23976 = 23.976;
- public const double f24 = 24;
- public const double f25 = 25;
- public const double f2997 = 29.97;
- public const double f30 = 30;
- }
-
- public struct TimeFormat
- {
- public const string HHMMSSMS = "HHMMSSMS";
- public const string HHMMSSFF = "HHMMSSFF";
- }
-
- }
-}
diff --git a/MsmhTools/MsmhTools/Win32/ControlScrollFilter.cs b/MsmhTools/MsmhTools/Win32/ControlScrollFilter.cs
deleted file mode 100644
index 1ea3e20..0000000
--- a/MsmhTools/MsmhTools/Win32/ControlScrollFilter.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.Drawing;
-using System.Windows.Forms;
-
-namespace MsmhTools.Win32
-{
- public class ControlScrollFilter : IMessageFilter
- {
- public bool PreFilterMessage(ref Message m)
- {
- switch (m.Msg)
- {
- case (int)WindowsMessages.MOUSEWHEEL:
- case (int)WindowsMessages.MOUSEHWHEEL:
- var hControlUnderMouse = NativeMethods.WindowFromPoint(new Point((int)m.LParam));
-
- if (hControlUnderMouse == m.HWnd)
- return false;
-
- NativeMethods.SendMessage(hControlUnderMouse, m.Msg, m.WParam, m.LParam);
- return true;
- }
-
- return false;
- }
- }
-}
diff --git a/MsmhTools/MsmhTools/Win32/NativeMethods.cs b/MsmhTools/MsmhTools/Win32/NativeMethods.cs
deleted file mode 100644
index 107204e..0000000
--- a/MsmhTools/MsmhTools/Win32/NativeMethods.cs
+++ /dev/null
@@ -1,296 +0,0 @@
-//using Nikse.SubtitleEdit.Core.Common;
-using System;
-using System.Runtime.InteropServices;
-
-namespace MsmhTools
-{
- internal static class NativeMethods
- {
-
- #region Hunspell
-
- [DllImport("libhunspell", SetLastError = true, CharSet = CharSet.Ansi, BestFitMapping = false)]
- internal static extern IntPtr Hunspell_create(string affpath, string dpath);
-
- [DllImport("libhunspell")]
- internal static extern IntPtr Hunspell_destroy(IntPtr hunspellHandle);
-
- [DllImport("libhunspell", SetLastError = true, CharSet = CharSet.Ansi, BestFitMapping = false)]
- internal static extern int Hunspell_spell(IntPtr hunspellHandle, string word);
-
- [DllImport("libhunspell", SetLastError = true, CharSet = CharSet.Ansi, BestFitMapping = false)]
- internal static extern int Hunspell_suggest(IntPtr hunspellHandle, IntPtr slst, string word);
-
- [DllImport("libhunspell")]
- internal static extern void Hunspell_free_list(IntPtr hunspellHandle, IntPtr slst, int n);
-
- #endregion Hunspell
-
- #region Win32 API
-
- // Win32 API functions for dynamically loading DLLs
- [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi, BestFitMapping = false)]
- internal static extern IntPtr LoadLibrary(string dllToLoad);
-
- [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Ansi, BestFitMapping = false)]
- internal static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
-
- [DllImport("kernel32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool FreeLibrary(IntPtr hModule);
-
- [DllImport("kernel32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool AttachConsole(int dwProcessId);
- internal const int ATTACH_PARENT_PROCESS = -1;
-
- [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool FreeConsole();
-
- [DllImport("user32.dll")]
- internal static extern short GetKeyState(int vKey);
-
- [DllImport("user32.dll")]
- public static extern int GetWindowLong(IntPtr hWnd, int Index);
-
- [DllImport("user32.dll")]
- public static extern int SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong);
-
-
- [StructLayout(LayoutKind.Sequential)]
- public struct COMBOBOXINFO
- {
- public int cbSize;
- public RECT rcItem;
- public RECT rcButton;
- public ComboBoxButtonState buttonState;
- public IntPtr hwndCombo;
- public IntPtr hwndEdit;
- public IntPtr hwndList;
- }
- public enum ComboBoxButtonState
- {
- STATE_SYSTEM_NONE = 0,
- STATE_SYSTEM_INVISIBLE = 0x00008000,
- STATE_SYSTEM_PRESSED = 0x00000008
- }
- [DllImport("user32.dll")]
- public static extern bool GetComboBoxInfo(IntPtr hWnd, ref COMBOBOXINFO pcbi);
-
-
- [StructLayout(LayoutKind.Sequential)]
- public struct RECT
- {
- public int Left; // x position of upper-left corner
- public int Top; // y position of upper-left corner
- public int Right; // x position of lower-right corner
- public int Bottom; // y position of lower-right corner
- }
- [DllImport("user32.dll", SetLastError = true)]
- public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);
-
-
- [DllImport("user32.dll", EntryPoint = "SetWindowPos")]
- internal static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int width, int height, int wFlags);
-
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- internal static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
- internal const int WM_SETREDRAW = 0x0b;
-
- [DllImport("user32.dll", EntryPoint = "SendMessageA")]
- public static extern int SendMessageA(IntPtr hwnd, int wMsg, int wParam, int lParam);
-
- [DllImport("user32.dll")]
- internal static extern IntPtr WindowFromPoint(Point point);
-
- [DllImport("dwmapi.dll")]
- internal static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize);
-
- [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
- internal extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string? pszSubIdList);
- // Usage: SetWindowTheme(control.Handle, "DarkMode_Explorer", null);
-
- #endregion Win32 API
-
- #region VLC
-
- // LibVLC Core - http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__core.html
- [DllImport("libvlc")]
- internal static extern IntPtr libvlc_new(int argc, [MarshalAs(UnmanagedType.LPArray)] string[] argv);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_release(IntPtr libVlc);
-
- // LibVLC Media - http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__media.html
- [DllImport("libvlc")]
- internal static extern IntPtr libvlc_media_new_path(IntPtr instance, byte[] input);
-
- [DllImport("libvlc")]
- internal static extern IntPtr libvlc_media_player_new_from_media(IntPtr media);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_media_release(IntPtr media);
-
- // LibVLC Audio Controls - http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html
- [DllImport("libvlc")]
- internal static extern int libvlc_audio_get_track_count(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern int libvlc_audio_get_track(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern int libvlc_audio_set_track(IntPtr mediaPlayer, int trackNumber);
-
- // LibVLC Audio Controls - http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__audio.html
- [DllImport("libvlc")]
- internal static extern int libvlc_audio_get_volume(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_audio_set_volume(IntPtr mediaPlayer, int volume);
-
- // LibVLC media player - http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc__media__player.html
- [DllImport("libvlc")]
- internal static extern void libvlc_media_player_play(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_media_player_stop(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_media_player_pause(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_media_player_set_hwnd(IntPtr mediaPlayer, IntPtr windowsHandle);
-
- [DllImport("libvlc")]
- internal static extern Int64 libvlc_media_player_get_time(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_media_player_set_time(IntPtr mediaPlayer, Int64 position);
-
- [DllImport("libvlc")]
- internal static extern byte libvlc_media_player_get_state(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern Int64 libvlc_media_player_get_length(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern void libvlc_media_list_player_release(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern float libvlc_media_player_get_rate(IntPtr mediaPlayer);
-
- [DllImport("libvlc")]
- internal static extern int libvlc_media_player_set_rate(IntPtr mediaPlayer, float rate);
-
- #endregion VLC
-
- #region MPV
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr mpv_create();
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_initialize(IntPtr mpvHandle);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_command(IntPtr mpvHandle, IntPtr utf8Strings);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_terminate_destroy(IntPtr mpvHandle);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr mpv_wait_event(IntPtr mpvHandle, double wait);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_set_option(IntPtr mpvHandle, byte[] name, int format, ref long data);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_set_option_string(IntPtr mpvHandle, byte[] name, byte[] value);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr mpv_get_property_string(IntPtr mpvHandle, byte[] name);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_get_property(IntPtr mpvHandle, byte[] name, int format, ref double data);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_set_property(IntPtr mpvHandle, byte[] name, int format, ref byte[] data);
-
-
- [DllImport("mpv", CallingConvention = CallingConvention.Cdecl)]
- internal static extern int mpv_free(IntPtr data);
-
- #endregion MPV
-
- #region Linux System
-
- internal const int LC_NUMERIC = 1;
-
- internal const int RTLD_NOW = 0x0001;
- internal const int RTLD_GLOBAL = 0x0100;
-
- [DllImport("libc.so.6")]
- internal static extern IntPtr setlocale(int category, string locale);
-
- [DllImport("libdl.so.2")]
- internal static extern IntPtr dlopen(string filename, int flags);
-
- [DllImport("libdl.so.2")]
- internal static extern IntPtr dlclose(IntPtr handle);
-
- [DllImport("libdl.so.2")]
- internal static extern IntPtr dlsym(IntPtr handle, string symbol);
-
- #endregion
-
- #region Cross platform
-
- internal static IntPtr CrossLoadLibrary(string fileName)
- {
- if (Info.IsRunningOnWindows)
- {
- return LoadLibrary(fileName);
- }
-
- return dlopen(fileName, RTLD_NOW | RTLD_GLOBAL);
- }
-
- internal static void CrossFreeLibrary(IntPtr handle)
- {
- if (Info.IsRunningOnWindows)
- {
- FreeLibrary(handle);
- }
- else
- {
- dlclose(handle);
- }
- }
-
- internal static IntPtr CrossGetProcAddress(IntPtr handle, string name)
- {
- if (Info.IsRunningOnWindows)
- {
- return GetProcAddress(handle, name);
- }
- return dlsym(handle, name);
- }
-
- #endregion
-
- #region MSasanMH Methods
-
-
-
- #endregion
- }
-}
diff --git a/MsmhTools/MsmhTools/Win32/WindowsMessages.cs b/MsmhTools/MsmhTools/Win32/WindowsMessages.cs
deleted file mode 100644
index 9ab90c1..0000000
--- a/MsmhTools/MsmhTools/Win32/WindowsMessages.cs
+++ /dev/null
@@ -1,1199 +0,0 @@
-using System;
-
-namespace MsmhTools.Win32
-{
- ///
- /// Windows Messages
- /// Defined in winuser.h from Windows SDK v6.1
- /// Documentation pulled from MSDN.
- ///
- internal enum WindowsMessages : uint
- {
- ///
- /// The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.
- ///
- NULL = 0x0000,
-
- ///
- /// The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.
- ///
- CREATE = 0x0001,
-
- ///
- /// The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen.
- /// This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.
- /// ///
- DESTROY = 0x0002,
-
- ///
- /// The WM_MOVE message is sent after a window has been moved.
- ///
- MOVE = 0x0003,
-
- ///
- /// The WM_SIZE message is sent to a window after its size has changed.
- ///
- SIZE = 0x0005,
-
- ///
- /// The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately.
- ///
- ACTIVATE = 0x0006,
-
- ///
- /// The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus.
- ///
- SETFOCUS = 0x0007,
-
- ///
- /// The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.
- ///
- KILLFOCUS = 0x0008,
-
- ///
- /// The WM_ENABLE message is sent when an application changes the enabled state of a window. It is sent to the window whose enabled state is changing. This message is sent before the EnableWindow function returns, but after the enabled state (WS_DISABLED style bit) of the window has changed.
- ///
- ENABLE = 0x000A,
-
- ///
- /// An application sends the WM_SETREDRAW message to a window to allow changes in that window to be redrawn or to prevent changes in that window from being redrawn.
- ///
- SETREDRAW = 0x000B,
-
- ///
- /// An application sends a WM_SETTEXT message to set the text of a window.
- ///
- SETTEXT = 0x000C,
-
- ///
- /// An application sends a WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller.
- ///
- GETTEXT = 0x000D,
-
- ///
- /// An application sends a WM_GETTEXTLENGTH message to determine the length, in characters, of the text associated with a window.
- ///
- GETTEXTLENGTH = 0x000E,
-
- ///
- /// The WM_PAINT message is sent when the system or another application makes a request to paint a portion of an application's window. The message is sent when the UpdateWindow or RedrawWindow function is called, or by the DispatchMessage function when the application obtains a WM_PAINT message by using the GetMessage or PeekMessage function.
- ///
- PAINT = 0x000F,
-
- ///
- /// The WM_CLOSE message is sent as a signal that a window or an application should terminate.
- ///
- CLOSE = 0x0010,
-
- ///
- /// The WM_QUERYENDSESSION message is sent when the user chooses to end the session or when an application calls one of the system shutdown functions. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.
- /// After processing this message, the system sends the WM_ENDSESSION message with the wParam parameter set to the results of the WM_QUERYENDSESSION message.
- ///
- QUERYENDSESSION = 0x0011,
-
- ///
- /// The WM_QUERYOPEN message is sent to an icon when the user requests that the window be restored to its previous size and position.
- ///
- QUERYOPEN = 0x0013,
-
- ///
- /// The WM_ENDSESSION message is sent to an application after the system processes the results of the WM_QUERYENDSESSION message. The WM_ENDSESSION message informs the application whether the session is ending.
- ///
- ENDSESSION = 0x0016,
-
- ///
- /// The WM_QUIT message indicates a request to terminate an application and is generated when the application calls the PostQuitMessage function. It causes the GetMessage function to return zero.
- ///
- QUIT = 0x0012,
-
- ///
- /// The WM_ERASEBKGND message is sent when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting.
- ///
- ERASEBKGND = 0x0014,
-
- ///
- /// This message is sent to all top-level windows when a change is made to a system color setting.
- ///
- SYSCOLORCHANGE = 0x0015,
-
- ///
- /// The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown.
- ///
- SHOWWINDOW = 0x0018,
-
- ///
- /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.
- /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.
- ///
- WININICHANGE = 0x001A,
-
- ///
- /// An application sends the WM_WININICHANGE message to all top-level windows after making a change to the WIN.INI file. The SystemParametersInfo function sends this message after an application uses the function to change a setting in WIN.INI.
- /// Note The WM_WININICHANGE message is provided only for compatibility with earlier versions of the system. Applications should use the WM_SETTINGCHANGE message.
- ///
- SETTINGCHANGE = WININICHANGE,
-
- ///
- /// The WM_DEVMODECHANGE message is sent to all top-level windows whenever the user changes device-mode settings.
- ///
- DEVMODECHANGE = 0x001B,
-
- ///
- /// The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.
- ///
- ACTIVATEAPP = 0x001C,
-
- ///
- /// An application sends the WM_FONTCHANGE message to all top-level windows in the system after changing the pool of font resources.
- ///
- FONTCHANGE = 0x001D,
-
- ///
- /// A message that is sent whenever there is a change in the system time.
- ///
- TIMECHANGE = 0x001E,
-
- ///
- /// The WM_CANCELMODE message is sent to cancel certain modes, such as mouse capture. For example, the system sends this message to the active window when a dialog box or message box is displayed. Certain functions also send this message explicitly to the specified window regardless of whether it is the active window. For example, the EnableWindow function sends this message when disabling the specified window.
- ///
- CANCELMODE = 0x001F,
-
- ///
- /// The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.
- ///
- SETCURSOR = 0x0020,
-
- ///
- /// The WM_MOUSEACTIVATE message is sent when the cursor is in an inactive window and the user presses a mouse button. The parent window receives this message only if the child window passes it to the DefWindowProc function.
- ///
- MOUSEACTIVATE = 0x0021,
-
- ///
- /// The WM_CHILDACTIVATE message is sent to a child window when the user clicks the window's title bar or when the window is activated, moved, or sized.
- ///
- CHILDACTIVATE = 0x0022,
-
- ///
- /// The WM_QUEUESYNC message is sent by a computer-based training (CBT) application to separate user-input messages from other messages sent through the WH_JOURNALPLAYBACK Hook procedure.
- ///
- QUEUESYNC = 0x0023,
-
- ///
- /// The WM_GETMINMAXINFO message is sent to a window when the size or position of the window is about to change. An application can use this message to override the window's default maximized size and position, or its default minimum or maximum tracking size.
- ///
- GETMINMAXINFO = 0x0024,
-
- ///
- /// Windows NT 3.51 and earlier: The WM_PAINTICON message is sent to a minimized window when the icon is to be painted. This message is not sent by newer versions of Microsoft Windows, except in unusual circumstances explained in the Remarks.
- ///
- PAINTICON = 0x0026,
-
- ///
- /// Windows NT 3.51 and earlier: The WM_ICONERASEBKGND message is sent to a minimized window when the background of the icon must be filled before painting the icon. A window receives this message only if a class icon is defined for the window; otherwise, WM_ERASEBKGND is sent. This message is not sent by newer versions of Windows.
- ///
- ICONERASEBKGND = 0x0027,
-
- ///
- /// The WM_NEXTDLGCTL message is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box.
- ///
- NEXTDLGCTL = 0x0028,
-
- ///
- /// The WM_SPOOLERSTATUS message is sent from Print Manager whenever a job is added to or removed from the Print Manager queue.
- ///
- SPOOLERSTATUS = 0x002A,
-
- ///
- /// The WM_DRAWITEM message is sent to the parent window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
- ///
- DRAWITEM = 0x002B,
-
- ///
- /// The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created.
- ///
- MEASUREITEM = 0x002C,
-
- ///
- /// Sent to the owner of a list box or combo box when the list box or combo box is destroyed or when items are removed by the LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT message. The system sends a WM_DELETEITEM message for each deleted item. The system sends the WM_DELETEITEM message for any deleted list box or combo box item with nonzero item data.
- ///
- DELETEITEM = 0x002D,
-
- ///
- /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.
- ///
- VKEYTOITEM = 0x002E,
-
- ///
- /// Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_CHAR message.
- ///
- CHARTOITEM = 0x002F,
-
- ///
- /// An application sends a WM_SETFONT message to specify the font that a control is to use when drawing text.
- ///
- SETFONT = 0x0030,
-
- ///
- /// An application sends a WM_GETFONT message to a control to retrieve the font with which the control is currently drawing its text.
- ///
- GETFONT = 0x0031,
-
- ///
- /// An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window.
- ///
- SETHOTKEY = 0x0032,
-
- ///
- /// An application sends a WM_GETHOTKEY message to determine the hot key associated with a window.
- ///
- GETHOTKEY = 0x0033,
-
- ///
- /// The WM_QUERYDRAGICON message is sent to a minimized (iconic) window. The window is about to be dragged by the user but does not have an icon defined for its class. An application can return a handle to an icon or cursor. The system displays this cursor or icon while the user drags the icon.
- ///
- QUERYDRAGICON = 0x0037,
-
- ///
- /// The system sends the WM_COMPAREITEM message to determine the relative position of a new item in the sorted list of an owner-drawn combo box or list box. Whenever the application adds a new item, the system sends this message to the owner of a combo box or list box created with the CBS_SORT or LBS_SORT style.
- ///
- COMPAREITEM = 0x0039,
-
- ///
- /// Active Accessibility sends the WM_GETOBJECT message to obtain information about an accessible object contained in a server application.
- /// Applications never send this message directly. It is sent only by Active Accessibility in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message.
- ///
- GETOBJECT = 0x003D,
-
- ///
- /// The WM_COMPACTING message is sent to all top-level windows when the system detects more than 12.5 percent of system time over a 30- to 60-second interval is being spent compacting memory. This indicates that system memory is low.
- ///
- COMPACTING = 0x0041,
-
- ///
- /// WM_COMMNOTIFY is Obsolete for Win32-Based Applications
- ///
- [Obsolete]
- COMMNOTIFY = 0x0044,
-
- ///
- /// The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in the Z order is about to change as a result of a call to the SetWindowPos function or another window-management function.
- ///
- WINDOWPOSCHANGING = 0x0046,
-
- ///
- /// The WM_WINDOWPOSCHANGED message is sent to a window whose size, position, or place in the Z order has changed as a result of a call to the SetWindowPos function or another window-management function.
- ///
- WINDOWPOSCHANGED = 0x0047,
-
- ///
- /// Notifies applications that the system, typically a battery-powered personal computer, is about to enter a suspended mode.
- /// Use: POWERBROADCAST
- ///
- [Obsolete]
- POWER = 0x0048,
-
- ///
- /// An application sends the WM_COPYDATA message to pass data to another application.
- ///
- COPYDATA = 0x004A,
-
- ///
- /// The WM_CANCELJOURNAL message is posted to an application when a user cancels the application's journaling activities. The message is posted with a NULL window handle.
- ///
- CANCELJOURNAL = 0x004B,
-
- ///
- /// Sent by a common control to its parent window when an event has occurred or the control requires some information.
- ///
- NOTIFY = 0x004E,
-
- ///
- /// The WM_INPUTLANGCHANGEREQUEST message is posted to the window with the focus when the user chooses a new input language, either with the hotkey (specified in the Keyboard control panel application) or from the indicator on the system taskbar. An application can accept the change by passing the message to the DefWindowProc function or reject the change (and prevent it from taking place) by returning immediately.
- ///
- INPUTLANGCHANGEREQUEST = 0x0050,
-
- ///
- /// The WM_INPUTLANGCHANGE message is sent to the topmost affected window after an application's input language has been changed. You should make any application-specific settings and pass the message to the DefWindowProc function, which passes the message to all first-level child windows. These child windows can pass the message to DefWindowProc to have it pass the message to their child windows, and so on.
- ///
- INPUTLANGCHANGE = 0x0051,
-
- ///
- /// Sent to an application that has initiated a training card with Microsoft Windows Help. The message informs the application when the user clicks an authorable button. An application initiates a training card by specifying the HELP_TCARD command in a call to the WinHelp function.
- ///
- TCARD = 0x0052,
-
- ///
- /// Indicates that the user pressed the F1 key. If a menu is active when F1 is pressed, WM_HELP is sent to the window associated with the menu; otherwise, WM_HELP is sent to the window that has the keyboard focus. If no window has the keyboard focus, WM_HELP is sent to the currently active window.
- ///
- HELP = 0x0053,
-
- ///
- /// The WM_USERCHANGED message is sent to all windows after the user has logged on or off. When the user logs on or off, the system updates the user-specific settings. The system sends this message immediately after updating the settings.
- ///
- USERCHANGED = 0x0054,
-
- ///
- /// Determines if a window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. WM_NOTIFYFORMAT messages are sent from a common control to its parent window and from the parent window to the common control.
- ///
- NOTIFYFORMAT = 0x0055,
-
- ///
- /// The WM_CONTEXTMENU message notifies a window that the user clicked the right mouse button (right-clicked) in the window.
- ///
- CONTEXTMENU = 0x007B,
-
- ///
- /// The WM_STYLECHANGING message is sent to a window when the SetWindowLong function is about to change one or more of the window's styles.
- ///
- STYLECHANGING = 0x007C,
-
- ///
- /// The WM_STYLECHANGED message is sent to a window after the SetWindowLong function has changed one or more of the window's styles
- ///
- STYLECHANGED = 0x007D,
-
- ///
- /// The WM_DISPLAYCHANGE message is sent to all windows when the display resolution has changed.
- ///
- DISPLAYCHANGE = 0x007E,
-
- ///
- /// The WM_GETICON message is sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption.
- ///
- GETICON = 0x007F,
-
- ///
- /// An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.
- ///
- SETICON = 0x0080,
-
- ///
- /// The WM_NCCREATE message is sent prior to the WM_CREATE message when a window is first created.
- ///
- NCCREATE = 0x0081,
-
- ///
- /// The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY message. WM_DESTROY is used to free the allocated memory object associated with the window.
- /// The WM_NCDESTROY message is sent after the child windows have been destroyed. In contrast, WM_DESTROY is sent before the child windows are destroyed.
- ///
- NCDESTROY = 0x0082,
-
- ///
- /// The WM_NCCALCSIZE message is sent when the size and position of a window's client area must be calculated. By processing this message, an application can control the content of the window's client area when the size or position of the window changes.
- ///
- NCCALCSIZE = 0x0083,
-
- ///
- /// The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse.
- ///
- NCHITTEST = 0x0084,
-
- ///
- /// The WM_NCPAINT message is sent to a window when its frame must be painted.
- ///
- NCPAINT = 0x0085,
-
- ///
- /// The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.
- ///
- NCACTIVATE = 0x0086,
-
- ///
- /// The WM_GETDLGCODE message is sent to the window procedure associated with a control. By default, the system handles all keyboard input to the control; the system interprets certain types of keyboard input as dialog box navigation keys. To override this default behavior, the control can respond to the WM_GETDLGCODE message to indicate the types of input it wants to process itself.
- ///
- GETDLGCODE = 0x0087,
-
- ///
- /// The WM_SYNCPAINT message is used to synchronize painting while avoiding linking independent GUI threads.
- ///
- SYNCPAINT = 0x0088,
-
- ///
- /// The WM_NCMOUSEMOVE message is posted to a window when the cursor is moved within the nonclient area of the window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCMOUSEMOVE = 0x00A0,
-
- ///
- /// The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCLBUTTONDOWN = 0x00A1,
-
- ///
- /// The WM_NCLBUTTONUP message is posted when the user releases the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCLBUTTONUP = 0x00A2,
-
- ///
- /// The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCLBUTTONDBLCLK = 0x00A3,
-
- ///
- /// The WM_NCRBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCRBUTTONDOWN = 0x00A4,
-
- ///
- /// The WM_NCRBUTTONUP message is posted when the user releases the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCRBUTTONUP = 0x00A5,
-
- ///
- /// The WM_NCRBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCRBUTTONDBLCLK = 0x00A6,
-
- ///
- /// The WM_NCMBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCMBUTTONDOWN = 0x00A7,
-
- ///
- /// The WM_NCMBUTTONUP message is posted when the user releases the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCMBUTTONUP = 0x00A8,
-
- ///
- /// The WM_NCMBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCMBUTTONDBLCLK = 0x00A9,
-
- ///
- /// The WM_NCXBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCXBUTTONDOWN = 0x00AB,
-
- ///
- /// The WM_NCXBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCXBUTTONUP = 0x00AC,
-
- ///
- /// The WM_NCXBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
- ///
- NCXBUTTONDBLCLK = 0x00AD,
-
- ///
- /// The WM_INPUT_DEVICE_CHANGE message is sent to the window that registered to receive raw input. A window receives this message through its WindowProc function.
- ///
- INPUT_DEVICE_CHANGE = 0x00FE,
-
- ///
- /// The WM_INPUT message is sent to the window that is getting raw input.
- ///
- INPUT = 0x00FF,
-
- ///
- /// This message filters for keyboard messages.
- ///
- KEYFIRST = 0x0100,
-
- ///
- /// The WM_KEYDOWN message is posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when the ALT key is not pressed.
- ///
- KEYDOWN = 0x0100,
-
- ///
- /// The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
- ///
- KEYUP = 0x0101,
-
- ///
- /// The WM_CHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed.
- ///
- CHAR = 0x0102,
-
- ///
- /// The WM_DEADCHAR message is posted to the window with the keyboard focus when a WM_KEYUP message is translated by the TranslateMessage function. WM_DEADCHAR specifies a character code generated by a dead key. A dead key is a key that generates a character, such as the umlaut (double-dot), that is combined with another character to form a composite character. For example, the umlaut-O character (Ö) is generated by typing the dead key for the umlaut character, and then typing the O key.
- ///
- DEADCHAR = 0x0103,
-
- ///
- /// The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
- ///
- SYSKEYDOWN = 0x0104,
-
- ///
- /// The WM_SYSKEYUP message is posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter.
- ///
- SYSKEYUP = 0x0105,
-
- ///
- /// The WM_SYSCHAR message is posted to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. It specifies the character code of a system character key — that is, a character key that is pressed while the ALT key is down.
- ///
- SYSCHAR = 0x0106,
-
- ///
- /// The WM_SYSDEADCHAR message is sent to the window with the keyboard focus when a WM_SYSKEYDOWN message is translated by the TranslateMessage function. WM_SYSDEADCHAR specifies the character code of a system dead key — that is, a dead key that is pressed while holding down the ALT key.
- ///
- SYSDEADCHAR = 0x0107,
-
- ///
- /// The WM_UNICHAR message is posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_UNICHAR message contains the character code of the key that was pressed.
- /// The WM_UNICHAR message is equivalent to WM_CHAR, but it uses Unicode Transformation Format (UTF)-32, whereas WM_CHAR uses UTF-16. It is designed to send or post Unicode characters to ANSI windows and it can can handle Unicode Supplementary Plane characters.
- ///
- UNICHAR = 0x0109,
-
- ///
- /// This message filters for keyboard messages.
- ///
- KEYLAST = 0x0109,
-
- ///
- /// Sent immediately before the IME generates the composition string as a result of a keystroke. A window receives this message through its WindowProc function.
- ///
- IME_STARTCOMPOSITION = 0x010D,
-
- ///
- /// Sent to an application when the IME ends composition. A window receives this message through its WindowProc function.
- ///
- IME_ENDCOMPOSITION = 0x010E,
-
- ///
- /// Sent to an application when the IME changes composition status as a result of a keystroke. A window receives this message through its WindowProc function.
- ///
- IME_COMPOSITION = 0x010F,
- IME_KEYLAST = 0x010F,
-
- ///
- /// The WM_INITDIALOG message is sent to the dialog box procedure immediately before a dialog box is displayed. Dialog box procedures typically use this message to initialize controls and carry out any other initialization tasks that affect the appearance of the dialog box.
- ///
- INITDIALOG = 0x0110,
-
- ///
- /// The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
- ///
- COMMAND = 0x0111,
-
- ///
- /// A window receives this message when the user chooses a command from the Window menu, clicks the maximize button, minimize button, restore button, close button, or moves the form. You can stop the form from moving by filtering this out.
- ///
- SYSCOMMAND = 0x0112,
-
- ///
- /// The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function.
- ///
- TIMER = 0x0113,
-
- ///
- /// The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.
- ///
- HSCROLL = 0x0114,
-
- ///
- /// The WM_VSCROLL message is sent to a window when a scroll event occurs in the window's standard vertical scroll bar. This message is also sent to the owner of a vertical scroll bar control when a scroll event occurs in the control.
- ///
- VSCROLL = 0x0115,
-
- ///
- /// The WM_INITMENU message is sent when a menu is about to become active. It occurs when the user clicks an item on the menu bar or presses a menu key. This allows the application to modify the menu before it is displayed.
- ///
- INITMENU = 0x0116,
-
- ///
- /// The WM_INITMENUPOPUP message is sent when a drop-down menu or submenu is about to become active. This allows an application to modify the menu before it is displayed, without changing the entire menu.
- ///
- INITMENUPOPUP = 0x0117,
-
- ///
- /// The WM_MENUSELECT message is sent to a menu's owner window when the user selects a menu item.
- ///
- MENUSELECT = 0x011F,
-
- ///
- /// The WM_MENUCHAR message is sent when a menu is active and the user presses a key that does not correspond to any mnemonic or accelerator key. This message is sent to the window that owns the menu.
- ///
- MENUCHAR = 0x0120,
-
- ///
- /// The WM_ENTERIDLE message is sent to the owner window of a modal dialog box or menu that is entering an idle state. A modal dialog box or menu enters an idle state when no messages are waiting in its queue after it has processed one or more previous messages.
- ///
- ENTERIDLE = 0x0121,
-
- ///
- /// The WM_MENURBUTTONUP message is sent when the user releases the right mouse button while the cursor is on a menu item.
- ///
- MENURBUTTONUP = 0x0122,
-
- ///
- /// The WM_MENUDRAG message is sent to the owner of a drag-and-drop menu when the user drags a menu item.
- ///
- MENUDRAG = 0x0123,
-
- ///
- /// The WM_MENUGETOBJECT message is sent to the owner of a drag-and-drop menu when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item.
- ///
- MENUGETOBJECT = 0x0124,
-
- ///
- /// The WM_UNINITMENUPOPUP message is sent when a drop-down menu or submenu has been destroyed.
- ///
- UNINITMENUPOPUP = 0x0125,
-
- ///
- /// The WM_MENUCOMMAND message is sent when the user makes a selection from a menu.
- ///
- MENUCOMMAND = 0x0126,
-
- ///
- /// An application sends the WM_CHANGEUISTATE message to indicate that the user interface (UI) state should be changed.
- ///
- CHANGEUISTATE = 0x0127,
-
- ///
- /// An application sends the WM_UPDATEUISTATE message to change the user interface (UI) state for the specified window and all its child windows.
- ///
- UPDATEUISTATE = 0x0128,
-
- ///
- /// An application sends the WM_QUERYUISTATE message to retrieve the user interface (UI) state for a window.
- ///
- QUERYUISTATE = 0x0129,
-
- ///
- /// The WM_CTLCOLORMSGBOX message is sent to the owner window of a message box before Windows draws the message box. By responding to this message, the owner window can set the text and background colors of the message box by using the given display device context handle.
- ///
- CTLCOLORMSGBOX = 0x0132,
-
- ///
- /// An edit control that is not read-only or disabled sends the WM_CTLCOLOREDIT message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the edit control.
- ///
- CTLCOLOREDIT = 0x0133,
-
- ///
- /// Sent to the parent window of a list box before the system draws the list box. By responding to this message, the parent window can set the text and background colors of the list box by using the specified display device context handle.
- ///
- CTLCOLORLISTBOX = 0x0134,
-
- ///
- /// The WM_CTLCOLORBTN message is sent to the parent window of a button before drawing the button. The parent window can change the button's text and background colors. However, only owner-drawn buttons respond to the parent window processing this message.
- ///
- CTLCOLORBTN = 0x0135,
-
- ///
- /// The WM_CTLCOLORDLG message is sent to a dialog box before the system draws the dialog box. By responding to this message, the dialog box can set its text and background colors using the specified display device context handle.
- ///
- CTLCOLORDLG = 0x0136,
-
- ///
- /// The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a scroll bar control when the control is about to be drawn. By responding to this message, the parent window can use the display context handle to set the background color of the scroll bar control.
- ///
- CTLCOLORSCROLLBAR = 0x0137,
-
- ///
- /// A static control, or an edit control that is read-only or disabled, sends the WM_CTLCOLORSTATIC message to its parent window when the control is about to be drawn. By responding to this message, the parent window can use the specified device context handle to set the text and background colors of the static control.
- ///
- CTLCOLORSTATIC = 0x0138,
-
- ///
- /// Use WM_MOUSEFIRST to specify the first mouse message. Use the PeekMessage() Function.
- ///
- MOUSEFIRST = 0x0200,
-
- ///
- /// The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- MOUSEMOVE = 0x0200,
-
- ///
- /// The WM_LBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- LBUTTONDOWN = 0x0201,
-
- ///
- /// The WM_LBUTTONUP message is posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- LBUTTONUP = 0x0202,
-
- ///
- /// The WM_LBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- LBUTTONDBLCLK = 0x0203,
-
- ///
- /// The WM_RBUTTONDOWN message is posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- RBUTTONDOWN = 0x0204,
-
- ///
- /// The WM_RBUTTONUP message is posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- RBUTTONUP = 0x0205,
-
- ///
- /// The WM_RBUTTONDBLCLK message is posted when the user double-clicks the right mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- RBUTTONDBLCLK = 0x0206,
-
- ///
- /// The WM_MBUTTONDOWN message is posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- MBUTTONDOWN = 0x0207,
-
- ///
- /// The WM_MBUTTONUP message is posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- MBUTTONUP = 0x0208,
-
- ///
- /// The WM_MBUTTONDBLCLK message is posted when the user double-clicks the middle mouse button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- MBUTTONDBLCLK = 0x0209,
-
- ///
- /// The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.
- ///
- MOUSEWHEEL = 0x020A,
-
- ///
- /// The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- XBUTTONDOWN = 0x020B,
-
- ///
- /// The WM_XBUTTONUP message is posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- XBUTTONUP = 0x020C,
-
- ///
- /// The WM_XBUTTONDBLCLK message is posted when the user double-clicks the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
- ///
- XBUTTONDBLCLK = 0x020D,
-
- ///
- /// The WM_MOUSEHWHEEL message is sent to the focus window when the mouse's horizontal scroll wheel is tilted or rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.
- ///
- MOUSEHWHEEL = 0x020E,
-
- ///
- /// Use WM_MOUSELAST to specify the last mouse message. Used with PeekMessage() Function.
- ///
- MOUSELAST = 0x020E,
-
- ///
- /// The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. When the child window is being created, the system sends WM_PARENTNOTIFY just before the CreateWindow or CreateWindowEx function that creates the window returns. When the child window is being destroyed, the system sends the message before any processing to destroy the window takes place.
- ///
- PARENTNOTIFY = 0x0210,
-
- ///
- /// The WM_ENTERMENULOOP message informs an application's main window procedure that a menu modal loop has been entered.
- ///
- ENTERMENULOOP = 0x0211,
-
- ///
- /// The WM_EXITMENULOOP message informs an application's main window procedure that a menu modal loop has been exited.
- ///
- EXITMENULOOP = 0x0212,
-
- ///
- /// The WM_NEXTMENU message is sent to an application when the right or left arrow key is used to switch between the menu bar and the system menu.
- ///
- NEXTMENU = 0x0213,
-
- ///
- /// The WM_SIZING message is sent to a window that the user is resizing. By processing this message, an application can monitor the size and position of the drag rectangle and, if needed, change its size or position.
- ///
- SIZING = 0x0214,
-
- ///
- /// The WM_CAPTURECHANGED message is sent to the window that is losing the mouse capture.
- ///
- CAPTURECHANGED = 0x0215,
-
- ///
- /// The WM_MOVING message is sent to a window that the user is moving. By processing this message, an application can monitor the position of the drag rectangle and, if needed, change its position.
- ///
- MOVING = 0x0216,
-
- ///
- /// Notifies applications that a power-management event has occurred.
- ///
- POWERBROADCAST = 0x0218,
-
- ///
- /// Notifies an application of a change to the hardware configuration of a device or the computer.
- ///
- DEVICECHANGE = 0x0219,
-
- ///
- /// An application sends the WM_MDICREATE message to a multiple-document interface (MDI) client window to create an MDI child window.
- ///
- MDICREATE = 0x0220,
-
- ///
- /// An application sends the WM_MDIDESTROY message to a multiple-document interface (MDI) client window to close an MDI child window.
- ///
- MDIDESTROY = 0x0221,
-
- ///
- /// An application sends the WM_MDIACTIVATE message to a multiple-document interface (MDI) client window to instruct the client window to activate a different MDI child window.
- ///
- MDIACTIVATE = 0x0222,
-
- ///
- /// An application sends the WM_MDIRESTORE message to a multiple-document interface (MDI) client window to restore an MDI child window from maximized or minimized size.
- ///
- MDIRESTORE = 0x0223,
-
- ///
- /// An application sends the WM_MDINEXT message to a multiple-document interface (MDI) client window to activate the next or previous child window.
- ///
- MDINEXT = 0x0224,
-
- ///
- /// An application sends the WM_MDIMAXIMIZE message to a multiple-document interface (MDI) client window to maximize an MDI child window. The system resizes the child window to make its client area fill the client window. The system places the child window's window menu icon in the rightmost position of the frame window's menu bar, and places the child window's restore icon in the leftmost position. The system also appends the title bar text of the child window to that of the frame window.
- ///
- MDIMAXIMIZE = 0x0225,
-
- ///
- /// An application sends the WM_MDITILE message to a multiple-document interface (MDI) client window to arrange all of its MDI child windows in a tile format.
- ///
- MDITILE = 0x0226,
-
- ///
- /// An application sends the WM_MDICASCADE message to a multiple-document interface (MDI) client window to arrange all its child windows in a cascade format.
- ///
- MDICASCADE = 0x0227,
-
- ///
- /// An application sends the WM_MDIICONARRANGE message to a multiple-document interface (MDI) client window to arrange all minimized MDI child windows. It does not affect child windows that are not minimized.
- ///
- MDIICONARRANGE = 0x0228,
-
- ///
- /// An application sends the WM_MDIGETACTIVE message to a multiple-document interface (MDI) client window to retrieve the handle to the active MDI child window.
- ///
- MDIGETACTIVE = 0x0229,
-
- ///
- /// An application sends the WM_MDISETMENU message to a multiple-document interface (MDI) client window to replace the entire menu of an MDI frame window, to replace the window menu of the frame window, or both.
- ///
- MDISETMENU = 0x0230,
-
- ///
- /// The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
- /// The system sends the WM_ENTERSIZEMOVE message regardless of whether the dragging of full windows is enabled.
- ///
- ENTERSIZEMOVE = 0x0231,
-
- ///
- /// The WM_EXITSIZEMOVE message is sent one time to a window, after it has exited the moving or sizing modal loop. The window enters the moving or sizing modal loop when the user clicks the window's title bar or sizing border, or when the window passes the WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the message specifies the SC_MOVE or SC_SIZE value. The operation is complete when DefWindowProc returns.
- ///
- EXITSIZEMOVE = 0x0232,
-
- ///
- /// Sent when the user drops a file on the window of an application that has registered itself as a recipient of dropped files.
- ///
- DROPFILES = 0x0233,
-
- ///
- /// An application sends the WM_MDIREFRESHMENU message to a multiple-document interface (MDI) client window to refresh the window menu of the MDI frame window.
- ///
- MDIREFRESHMENU = 0x0234,
-
- ///
- /// Sent to an application when a window is activated. A window receives this message through its WindowProc function.
- ///
- IME_SETCONTEXT = 0x0281,
-
- ///
- /// Sent to an application to notify it of changes to the IME window. A window receives this message through its WindowProc function.
- ///
- IME_NOTIFY = 0x0282,
-
- ///
- /// Sent by an application to direct the IME window to carry out the requested command. The application uses this message to control the IME window that it has created. To send this message, the application calls the SendMessage function with the following parameters.
- ///
- IME_CONTROL = 0x0283,
-
- ///
- /// Sent to an application when the IME window finds no space to extend the area for the composition window. A window receives this message through its WindowProc function.
- ///
- IME_COMPOSITIONFULL = 0x0284,
-
- ///
- /// Sent to an application when the operating system is about to change the current IME. A window receives this message through its WindowProc function.
- ///
- IME_SELECT = 0x0285,
-
- ///
- /// Sent to an application when the IME gets a character of the conversion result. A window receives this message through its WindowProc function.
- ///
- IME_CHAR = 0x0286,
-
- ///
- /// Sent to an application to provide commands and request information. A window receives this message through its WindowProc function.
- ///
- IME_REQUEST = 0x0288,
-
- ///
- /// Sent to an application by the IME to notify the application of a key press and to keep message order. A window receives this message through its WindowProc function.
- ///
- IME_KEYDOWN = 0x0290,
-
- ///
- /// Sent to an application by the IME to notify the application of a key release and to keep message order. A window receives this message through its WindowProc function.
- ///
- IME_KEYUP = 0x0291,
-
- ///
- /// The WM_MOUSEHOVER message is posted to a window when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent.
- ///
- MOUSEHOVER = 0x02A1,
-
- ///
- /// The WM_MOUSELEAVE message is posted to a window when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent.
- ///
- MOUSELEAVE = 0x02A3,
-
- ///
- /// The WM_NCMOUSEHOVER message is posted to a window when the cursor hovers over the nonclient area of the window for the period of time specified in a prior call to TrackMouseEvent.
- ///
- NCMOUSEHOVER = 0x02A0,
-
- ///
- /// The WM_NCMOUSELEAVE message is posted to a window when the cursor leaves the nonclient area of the window specified in a prior call to TrackMouseEvent.
- ///
- NCMOUSELEAVE = 0x02A2,
-
- ///
- /// The WM_WTSSESSION_CHANGE message notifies applications of changes in session state.
- ///
- WTSSESSION_CHANGE = 0x02B1,
- TABLET_FIRST = 0x02c0,
- TABLET_LAST = 0x02df,
-
- ///
- /// An application sends a WM_CUT message to an edit control or combo box to delete (cut) the current selection, if any, in the edit control and copy the deleted text to the clipboard in CF_TEXT format.
- ///
- CUT = 0x0300,
-
- ///
- /// An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format.
- ///
- COPY = 0x0301,
-
- ///
- /// An application sends a WM_PASTE message to an edit control or combo box to copy the current content of the clipboard to the edit control at the current caret position. Data is inserted only if the clipboard contains data in CF_TEXT format.
- ///
- PASTE = 0x0302,
-
- ///
- /// An application sends a WM_CLEAR message to an edit control or combo box to delete (clear) the current selection, if any, from the edit control.
- ///
- CLEAR = 0x0303,
-
- ///
- /// An application sends a WM_UNDO message to an edit control to undo the last operation. When this message is sent to an edit control, the previously deleted text is restored or the previously added text is deleted.
- ///
- UNDO = 0x0304,
-
- ///
- /// The WM_RENDERFORMAT message is sent to the clipboard owner if it has delayed rendering a specific clipboard format and if an application has requested data in that format. The clipboard owner must render data in the specified format and place it on the clipboard by calling the SetClipboardData function.
- ///
- RENDERFORMAT = 0x0305,
-
- ///
- /// The WM_RENDERALLFORMATS message is sent to the clipboard owner before it is destroyed, if the clipboard owner has delayed rendering one or more clipboard formats. For the content of the clipboard to remain available to other applications, the clipboard owner must render data in all the formats it is capable of generating, and place the data on the clipboard by calling the SetClipboardData function.
- ///
- RENDERALLFORMATS = 0x0306,
-
- ///
- /// The WM_DESTROYCLIPBOARD message is sent to the clipboard owner when a call to the EmptyClipboard function empties the clipboard.
- ///
- DESTROYCLIPBOARD = 0x0307,
-
- ///
- /// The WM_DRAWCLIPBOARD message is sent to the first window in the clipboard viewer chain when the content of the clipboard changes. This enables a clipboard viewer window to display the new content of the clipboard.
- ///
- DRAWCLIPBOARD = 0x0308,
-
- ///
- /// The WM_PAINTCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area needs repainting.
- ///
- PAINTCLIPBOARD = 0x0309,
-
- ///
- /// The WM_VSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's vertical scroll bar. The owner should scroll the clipboard image and update the scroll bar values.
- ///
- VSCROLLCLIPBOARD = 0x030A,
-
- ///
- /// The WM_SIZECLIPBOARD message is sent to the clipboard owner by a clipboard viewer window when the clipboard contains data in the CF_OWNERDISPLAY format and the clipboard viewer's client area has changed size.
- ///
- SIZECLIPBOARD = 0x030B,
-
- ///
- /// The WM_ASKCBFORMATNAME message is sent to the clipboard owner by a clipboard viewer window to request the name of a CF_OWNERDISPLAY clipboard format.
- ///
- ASKCBFORMATNAME = 0x030C,
-
- ///
- /// The WM_CHANGECBCHAIN message is sent to the first window in the clipboard viewer chain when a window is being removed from the chain.
- ///
- CHANGECBCHAIN = 0x030D,
-
- ///
- /// The WM_HSCROLLCLIPBOARD message is sent to the clipboard owner by a clipboard viewer window. This occurs when the clipboard contains data in the CF_OWNERDISPLAY format and an event occurs in the clipboard viewer's horizontal scroll bar. The owner should scroll the clipboard image and update the scroll bar values.
- ///
- HSCROLLCLIPBOARD = 0x030E,
-
- ///
- /// This message informs a window that it is about to receive the keyboard focus, giving the window the opportunity to realize its logical palette when it receives the focus.
- ///
- QUERYNEWPALETTE = 0x030F,
-
- ///
- /// The WM_PALETTEISCHANGING message informs applications that an application is going to realize its logical palette.
- ///
- PALETTEISCHANGING = 0x0310,
-
- ///
- /// This message is sent by the OS to all top-level and overlapped windows after the window with the keyboard focus realizes its logical palette.
- /// This message enables windows that do not have the keyboard focus to realize their logical palettes and update their client areas.
- ///
- PALETTECHANGED = 0x0311,
-
- ///
- /// The WM_HOTKEY message is posted when the user presses a hot key registered by the RegisterHotKey function. The message is placed at the top of the message queue associated with the thread that registered the hot key.
- ///
- HOTKEY = 0x0312,
-
- ///
- /// The WM_PRINT message is sent to a window to request that it draw itself in the specified device context, most commonly in a printer device context.
- ///
- PRINT = 0x0317,
-
- ///
- /// The WM_PRINTCLIENT message is sent to a window to request that it draw its client area in the specified device context, most commonly in a printer device context.
- ///
- PRINTCLIENT = 0x0318,
-
- ///
- /// The WM_APPCOMMAND message notifies a window that the user generated an application command event, for example, by clicking an application command button using the mouse or typing an application command key on the keyboard.
- ///
- APPCOMMAND = 0x0319,
-
- ///
- /// The WM_THEMECHANGED message is broadcast to every window following a theme change event. Examples of theme change events are the activation of a theme, the deactivation of a theme, or a transition from one theme to another.
- ///
- THEMECHANGED = 0x031A,
-
- ///
- /// Sent when the contents of the clipboard have changed.
- ///
- CLIPBOARDUPDATE = 0x031D,
-
- ///
- /// The system will send a window the WM_DWMCOMPOSITIONCHANGED message to indicate that the availability of desktop composition has changed.
- ///
- DWMCOMPOSITIONCHANGED = 0x031E,
-
- ///
- /// WM_DWMNCRENDERINGCHANGED is called when the non-client area rendering status of a window has changed. Only windows that have set the flag DWM_BLURBEHIND.fTransitionOnMaximized to true will get this message.
- ///
- DWMNCRENDERINGCHANGED = 0x031F,
-
- ///
- /// Sent to all top-level windows when the colorization color has changed.
- ///
- DWMCOLORIZATIONCOLORCHANGED = 0x0320,
-
- ///
- /// WM_DWMWINDOWMAXIMIZEDCHANGE will let you know when a DWM composed window is maximized. You also have to register for this message as well. You'd have other windowd go opaque when this message is sent.
- ///
- DWMWINDOWMAXIMIZEDCHANGE = 0x0321,
-
- ///
- /// Sent to request extended title bar information. A window receives this message through its WindowProc function.
- ///
- GETTITLEBARINFOEX = 0x033F,
- HANDHELDFIRST = 0x0358,
- HANDHELDLAST = 0x035F,
- AFXFIRST = 0x0360,
- AFXLAST = 0x037F,
- PENWINFIRST = 0x0380,
- PENWINLAST = 0x038F,
-
- ///
- /// The WM_APP constant is used by applications to help define private messages, usually of the form WM_APP+X, where X is an integer value.
- ///
- APP = 0x8000,
-
- ///
- /// The WM_USER constant is used by applications to help define private messages for use by private window classes, usually of the form WM_USER+X, where X is an integer value.
- ///
- USER = 0x0400,
-
- ///
- /// An application sends the WM_CPL_LAUNCH message to Windows Control Panel to request that a Control Panel application be started.
- ///
- CPL_LAUNCH = USER + 0x1000,
-
- ///
- /// The WM_CPL_LAUNCHED message is sent when a Control Panel application, started by the WM_CPL_LAUNCH message, has closed. The WM_CPL_LAUNCHED message is sent to the window identified by the wParam parameter of the WM_CPL_LAUNCH message that started the application.
- ///
- CPL_LAUNCHED = USER + 0x1001,
-
- ///
- /// WM_SYSTIMER is a well-known yet still undocumented message. Windows uses WM_SYSTIMER for internal actions like scrolling.
- ///
- SYSTIMER = 0x118,
-
- ///
- /// The accessibility state has changed.
- ///
- HSHELL_ACCESSIBILITYSTATE = 11,
-
- ///
- /// The shell should activate its main window.
- ///
- HSHELL_ACTIVATESHELLWINDOW = 3,
-
- ///
- /// The user completed an input event (for example, pressed an application command button on the mouse or an application command key on the keyboard), and the application did not handle the WM_APPCOMMAND message generated by that input.
- /// If the Shell procedure handles the WM_COMMAND message, it should not call CallNextHookEx. See the Return Value section for more information.
- ///
- HSHELL_APPCOMMAND = 12,
-
- ///
- /// A window is being minimized or maximized. The system needs the coordinates of the minimized rectangle for the window.
- ///
- HSHELL_GETMINRECT = 5,
-
- ///
- /// Keyboard language was changed or a new keyboard layout was loaded.
- ///
- HSHELL_LANGUAGE = 8,
-
- ///
- /// The title of a window in the task bar has been redrawn.
- ///
- HSHELL_REDRAW = 6,
-
- ///
- /// The user has selected the task list. A shell application that provides a task list should return TRUE to prevent Windows from starting its task list.
- ///
- HSHELL_TASKMAN = 7,
-
- ///
- /// A top-level, unowned window has been created. The window exists when the system calls this hook.
- ///
- HSHELL_WINDOWCREATED = 1,
-
- ///
- /// A top-level, unowned window is about to be destroyed. The window still exists when the system calls this hook.
- ///
- HSHELL_WINDOWDESTROYED = 2,
-
- ///
- /// The activation has changed to a different top-level, unowned window.
- ///
- HSHELL_WINDOWACTIVATED = 4,
-
- ///
- /// A top-level window is being replaced. The window exists when the system calls this hook.
- ///
- HSHELL_WINDOWREPLACED = 13
- }
-}
diff --git a/MsmhTools/MsmhTools/Xml.cs b/MsmhTools/MsmhTools/Xml.cs
deleted file mode 100644
index a8e816b..0000000
--- a/MsmhTools/MsmhTools/Xml.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using System;
-using System.Xml;
-using System.Data;
-using System.Xml.Linq;
-using System.Diagnostics;
-
-namespace MsmhTools
-{
- public static class Xml
- {
- //-----------------------------------------------------------------------------------
- public static XDocument RemoveEmptyElements(XDocument xDoc)
- {
- xDoc.Descendants().Where(a => a.IsEmpty && !a.HasAttributes && !a.HasElements && string.IsNullOrWhiteSpace(a.Value)).Remove();
- return xDoc;
- }
- //-----------------------------------------------------------------------------------
- public static void RemoveNodesWithoutChild(string xmlFile)
- {
- if (File.Exists(xmlFile))
- {
- bool isXmlValid = IsValidXML(File.ReadAllText(xmlFile));
- if (isXmlValid == true)
- {
- XmlDocument doc = new();
- doc.Load(xmlFile);
- var nodes = doc.DocumentElement;
- if (nodes != null)
- {
- foreach (XmlNode node in nodes)
- if (node.HasChildNodes == false)
- nodes.RemoveChild(node);
- doc.Save(xmlFile);
- }
- }
- }
- else
- Console.WriteLine("XML File Not Exist.");
- }
- //-----------------------------------------------------------------------------------
- public static bool IsValidXML(string content)
- {
- try
- {
- if (!string.IsNullOrEmpty(content))
- {
- XmlDocument xmlDoc = new();
- xmlDoc.LoadXml(content);
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (XmlException ex)
- {
- Debug.WriteLine("XML Error: " + ex.Message);
- return false;
- }
- }
- //-----------------------------------------------------------------------------------
- public static bool IsValidXMLFile(string xmlFilePath)
- {
- try
- {
- if (!string.IsNullOrEmpty(xmlFilePath))
- {
- string content = File.ReadAllText(xmlFilePath);
- XmlDocument xmlDoc = new();
- xmlDoc.LoadXml(content);
- return true;
- }
- else
- {
- return false;
- }
- }
- catch (XmlException ex)
- {
- Debug.WriteLine("XML Error: " + ex.Message);
- return false;
- }
- }
- //-----------------------------------------------------------------------------------
- }
-}
diff --git a/MsmhTools/Properties/PublishProfiles/FolderProfile.pubxml b/MsmhTools/Properties/PublishProfiles/FolderProfile.pubxml
deleted file mode 100644
index 8a7deb4..0000000
--- a/MsmhTools/Properties/PublishProfiles/FolderProfile.pubxml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- Release
- Any CPU
- bin\Release\net6.0-windows\publish\
- FileSystem
- net6.0-windows
- false
-
-
\ No newline at end of file
diff --git a/MsmhTools/Properties/PublishProfiles/FolderProfile.pubxml.user b/MsmhTools/Properties/PublishProfiles/FolderProfile.pubxml.user
deleted file mode 100644
index b4d5f57..0000000
--- a/MsmhTools/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- True|2023-07-05T22:17:11.3258169Z;True|2023-07-06T02:23:56.8626061+04:30;
-
-
\ No newline at end of file
diff --git a/SDCHttpProxy/Program.cs b/SDCHttpProxy/Program.cs
index 5474ea1..f4b7be7 100644
--- a/SDCHttpProxy/Program.cs
+++ b/SDCHttpProxy/Program.cs
@@ -1,5 +1,5 @@
-using MsmhTools;
-using MsmhTools.HTTPProxyServer;
+using MsmhToolsClass;
+using MsmhToolsClass.HTTPProxyServer;
using System.Diagnostics;
using System.Net;
using System.Reflection;
@@ -472,7 +472,7 @@ static void DpiBypassStaticProgram_OnChunkDetailsReceived(object? sender, EventA
int requests = int.Parse(split[3]);
// Check Port
- bool isPortOpen = Network.IsPortOpen(IPAddress.Loopback.ToString(), port, 3);
+ bool isPortOpen = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), port, 3);
if (isPortOpen)
{
WriteToStdout($"Port {port} is occupied.");
diff --git a/SDCHttpProxy/SDCHttpProxy.csproj b/SDCHttpProxy/SDCHttpProxy.csproj
index ffc7a2d..c56d786 100644
--- a/SDCHttpProxy/SDCHttpProxy.csproj
+++ b/SDCHttpProxy/SDCHttpProxy.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/SecureDNSClient.psd b/SecureDNSClient.psd
index 196cc4e..8bd661a 100644
Binary files a/SecureDNSClient.psd and b/SecureDNSClient.psd differ
diff --git a/SecureDNSClient.sln b/SecureDNSClient.sln
index e0012b1..3d4c528 100644
--- a/SecureDNSClient.sln
+++ b/SecureDNSClient.sln
@@ -10,9 +10,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecureDNSClient", "SecureDN
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SecureDNSClientPortable", "SecureDNSClientPortable\SecureDNSClientPortable.csproj", "{5C28D441-E382-4DB3-A45C-0A34FA0ABC79}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsmhTools", "MsmhTools\MsmhTools.csproj", "{6E69CE41-523D-4BD0-A826-A778CE41BE34}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDCHttpProxy", "SDCHttpProxy\SDCHttpProxy.csproj", "{5A71E005-ED6A-4AEF-B6D5-0C4DAF3E7F1E}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SDCHttpProxy", "SDCHttpProxy\SDCHttpProxy.csproj", "{5A71E005-ED6A-4AEF-B6D5-0C4DAF3E7F1E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsmhToolsClass", "MsmhToolsClass\MsmhToolsClass.csproj", "{3FCBF4E2-4039-4140-BA71-8D27CB76536B}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MsmhToolsWinFormsClass", "MsmhToolsWinFormsClass\MsmhToolsWinFormsClass.csproj", "{47B32391-1B42-406E-8EB4-D9A405C800D2}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SdcMaui", "SdcMaui\SdcMaui.csproj", "{D145F57A-C15F-4CD7-AFD3-D3A8BA407FDA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -28,14 +32,24 @@ Global
{5C28D441-E382-4DB3-A45C-0A34FA0ABC79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C28D441-E382-4DB3-A45C-0A34FA0ABC79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C28D441-E382-4DB3-A45C-0A34FA0ABC79}.Release|Any CPU.Build.0 = Release|Any CPU
- {6E69CE41-523D-4BD0-A826-A778CE41BE34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6E69CE41-523D-4BD0-A826-A778CE41BE34}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6E69CE41-523D-4BD0-A826-A778CE41BE34}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6E69CE41-523D-4BD0-A826-A778CE41BE34}.Release|Any CPU.Build.0 = Release|Any CPU
{5A71E005-ED6A-4AEF-B6D5-0C4DAF3E7F1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A71E005-ED6A-4AEF-B6D5-0C4DAF3E7F1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A71E005-ED6A-4AEF-B6D5-0C4DAF3E7F1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A71E005-ED6A-4AEF-B6D5-0C4DAF3E7F1E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3FCBF4E2-4039-4140-BA71-8D27CB76536B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3FCBF4E2-4039-4140-BA71-8D27CB76536B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3FCBF4E2-4039-4140-BA71-8D27CB76536B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3FCBF4E2-4039-4140-BA71-8D27CB76536B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {47B32391-1B42-406E-8EB4-D9A405C800D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {47B32391-1B42-406E-8EB4-D9A405C800D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {47B32391-1B42-406E-8EB4-D9A405C800D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {47B32391-1B42-406E-8EB4-D9A405C800D2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D145F57A-C15F-4CD7-AFD3-D3A8BA407FDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D145F57A-C15F-4CD7-AFD3-D3A8BA407FDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D145F57A-C15F-4CD7-AFD3-D3A8BA407FDA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {D145F57A-C15F-4CD7-AFD3-D3A8BA407FDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D145F57A-C15F-4CD7-AFD3-D3A8BA407FDA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D145F57A-C15F-4CD7-AFD3-D3A8BA407FDA}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/SecureDNSClient/Forms/Certificate.cs b/SecureDNSClient/Forms/Certificate.cs
index 5d3bd60..f01b4eb 100644
--- a/SecureDNSClient/Forms/Certificate.cs
+++ b/SecureDNSClient/Forms/Certificate.cs
@@ -1,5 +1,5 @@
using CustomControls;
-using MsmhTools;
+using MsmhToolsClass;
using System;
using System.Net;
using System.Security.Cryptography.X509Certificates;
@@ -18,7 +18,7 @@ private void GenerateCertificate()
// Generate certificate
if (!File.Exists(SecureDNS.IssuerCertPath) || !File.Exists(SecureDNS.CertPath) || !File.Exists(SecureDNS.KeyPath))
{
- IPAddress? gateway = Network.GetDefaultGateway();
+ IPAddress? gateway = NetworkTool.GetDefaultGateway();
if (gateway != null)
{
CertificateTool.GenerateCertificate(SecureDNS.CertificateDirPath, gateway, issuerSubjectName, subjectName);
@@ -34,12 +34,9 @@ private void GenerateCertificate()
if (!certInstalled)
{
string msg = "Local DoH Server doesn't work without certificate.\nYou can remove certificate anytime from Windows.\nTry again?";
- using (new CenterWinDialog(this))
- {
- DialogResult dr = CustomMessageBox.Show(msg, "Certificate", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- if (dr == DialogResult.Yes)
- CertificateTool.InstallCertificate(SecureDNS.IssuerCertPath, StoreName.Root, StoreLocation.CurrentUser);
- }
+ DialogResult dr = CustomMessageBox.Show(this, msg, "Certificate", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
+ if (dr == DialogResult.Yes)
+ CertificateTool.InstallCertificate(SecureDNS.IssuerCertPath, StoreName.Root, StoreLocation.CurrentUser);
}
}
}
@@ -53,7 +50,7 @@ private void UninstallCertificate()
if (IsDoHConnected)
{
string msg = "Disconnect local DoH first.";
- CustomMessageBox.Show(msg, "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ CustomMessageBox.Show(this, msg, "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
@@ -73,7 +70,7 @@ private void UninstallCertificate()
else
{
string msg = "Certificate is already uninstalled.";
- CustomMessageBox.Show(msg, "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ CustomMessageBox.Show(this, msg, "Certificate", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
diff --git a/SecureDNSClient/Forms/CheckServers.cs b/SecureDNSClient/Forms/CheckServers.cs
index d0ad69a..1c6f681 100644
--- a/SecureDNSClient/Forms/CheckServers.cs
+++ b/SecureDNSClient/Forms/CheckServers.cs
@@ -1,16 +1,17 @@
using System;
using System.Net;
using CustomControls;
-using MsmhTools;
-using MsmhTools.DnsTool;
+using MsmhToolsClass;
+using MsmhToolsClass.DnsTool;
using System.Diagnostics;
using System.Reflection;
+using System.Xml.Linq;
namespace SecureDNSClient
{
public partial class FormMain
{
- private async void StartCheck()
+ private async void StartCheck(string? groupName = null)
{
// Return if binary files are missing
if (!CheckNecessaryFiles()) return;
@@ -19,25 +20,25 @@ private async void StartCheck()
{
// Start Checking
IsCheckingStarted = true;
- IsCheckDone = false;
// Check Internet Connectivity
- if (!IsInternetAlive()) return;
+ if (!IsInternetAlive())
+ {
+ IsCheckingStarted = false;
+ return;
+ }
// Unset DNS if it's not connected before checking.
- if (!IsConnected)
+ if (!IsDNSConnected && IsDNSSet)
{
- if (IsDNSSet)
- SetDNS(); // Unset DNS
- else
- await UnsetSavedDNS();
+ SetDNS(); // Unset DNS
}
try
{
- Task task = Task.Run(async () => await CheckServers());
+ Task taskCheck = Task.Run(async () => await CheckServers(groupName));
- await task.ContinueWith(_ =>
+ await taskCheck.ContinueWith(_ =>
{
// Save working servers to file
if (!CustomRadioButtonBuiltIn.Checked && WorkingDnsAndLatencyListToFile.Any())
@@ -53,25 +54,17 @@ await task.ContinueWith(_ =>
}
IsCheckingStarted = false;
- IsCheckDone = true;
- string msg = NL + "Check operation finished." + NL;
+ string msg = $"{NL}Check Task: {taskCheck.Status}{NL}";
CustomRichTextBoxLog.AppendText(msg, Color.DodgerBlue);
CustomButtonCheck.Enabled = true;
- // Go to Connect Tab if it's not already connected
- if (ConnectAllClicked && !IsConnected && NumberOfWorkingServers > 0)
- {
- this.InvokeIt(() => CustomTabControlMain.SelectedIndex = 0);
- this.InvokeIt(() => CustomTabControlSecureDNS.SelectedIndex = 1);
- }
- Debug.WriteLine("Checking Task: " + task.Status);
StopChecking = false;
}, TaskScheduler.FromCurrentSynchronizationContext());
}
catch (Exception ex)
{
- CustomMessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ CustomMessageBox.Show(this, ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
@@ -119,27 +112,16 @@ private bool CheckDnsMatchRules(DnsReader dnsReader)
return matchRules;
}
- private async Task CheckServers()
+ ///
+ /// Check DNS Servers
+ ///
+ /// Custom Servers Group Name To Check
+ /// Returns True if find any working server
+ private async Task CheckServers(string? groupName = null)
{
// Get blocked domain
string blockedDomain = GetBlockedDomainSetting(out string blockedDomainNoWww);
- if (string.IsNullOrEmpty(blockedDomain)) return;
-
- // Warn users to deactivate DPI before checking servers
- if (IsGoodbyeDPIActive || (IsProxySet && IsProxyDPIActive))
- {
- string msg = "It's better to not check servers while DPI Bypass is active.\nStart checking servers?";
- var resume = CustomMessageBox.Show(msg, "DPI is active", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
- if (resume == DialogResult.No) return;
- }
-
- // Warn users to Unset DNS before checking servers
- if (IsDNSSet)
- {
- string msg = "It's better to not check servers while DNS is set.\nStart checking servers?";
- var resume = CustomMessageBox.Show(msg, "DNS is set", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
- if (resume == DialogResult.No) return;
- }
+ if (string.IsNullOrEmpty(blockedDomain)) return false;
// Clear Log on new Check
this.InvokeIt(() => CustomRichTextBoxLog.ResetText());
@@ -161,16 +143,16 @@ private async Task CheckServers()
// Check open ports
if (!checkInParallel)
{
- bool isPortOpen = Network.IsPortOpen(IPAddress.Loopback.ToString(), localPort, 3);
+ bool isPortOpen = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), localPort, 3);
if (isPortOpen)
{
- localPort = Network.GetNextPort(localPort);
- isPortOpen = Network.IsPortOpen(IPAddress.Loopback.ToString(), localPort, 3);
+ localPort = NetworkTool.GetNextPort(localPort);
+ isPortOpen = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), localPort, 3);
if (isPortOpen)
{
- localPort = Network.GetNextPort(localPort);
+ localPort = NetworkTool.GetNextPort(localPort);
bool isPortOk = GetListeningPort(localPort, "You need to resolve the conflict.", Color.IndianRed);
- if (!isPortOk) return;
+ if (!isPortOk) return false;
}
}
}
@@ -178,28 +160,48 @@ private async Task CheckServers()
// Built-in or Custom
bool builtInMode = CustomRadioButtonBuiltIn.Checked;
- // Clear working list to file on new check
- WorkingDnsListToFile.Clear();
- WorkingDnsAndLatencyListToFile.Clear();
+ // Override Built-in or Custom
+ if (!string.IsNullOrEmpty(groupName))
+ {
+ builtInMode = groupName.Equals("builtin");
+ }
string? fileContent = string.Empty;
if (builtInMode)
- fileContent = await Resource.GetResourceTextFileAsync("SecureDNSClient.DNS-Servers.txt", Assembly.GetExecutingAssembly());
+ {
+ string? xmlContent = await ResourceTool.GetResourceTextFileAsync("SecureDNSClient.DNS-Servers.sdcs", Assembly.GetExecutingAssembly());
+ fileContent = await ReadCustomServersXml(xmlContent, groupName, false); // Built-In based on custom
+ }
else
{
- FileDirectory.CreateEmptyFile(SecureDNS.CustomServersPath);
- fileContent = await File.ReadAllTextAsync(SecureDNS.CustomServersPath);
+ // Check if Custom Servers XML is NOT Valid
+ if (!XmlTool.IsValidXMLFile(SecureDNS.CustomServersXmlPath))
+ {
+ string notValid = $"Custom Servers XML file is not valid.{NL}";
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(notValid, Color.IndianRed));
+ return false;
+ }
+ string msg = $"Reading Custom Servers...{NL}";
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.DodgerBlue));
+
+ fileContent = await ReadCustomServersXml(SecureDNS.CustomServersXmlPath, groupName);
+
// Load saved working servers
+ WorkingDnsListToFile.Clear();
WorkingDnsListToFile.LoadFromFile(SecureDNS.WorkingServersPath, true, true);
}
+ // Clear working list to file on new check
+ WorkingDnsAndLatencyListToFile.Clear();
+
// Check if servers exist 1
+ string custom = builtInMode ? "built-in" : "custom";
+ string msgNoServers = $"There is no {custom} server.{NL}";
if (string.IsNullOrEmpty(fileContent) || string.IsNullOrWhiteSpace(fileContent))
{
- string msg = "Servers list is empty." + NL;
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- return;
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgNoServers, Color.IndianRed));
+ return false;
}
// Add Servers to list
@@ -209,9 +211,8 @@ private async Task CheckServers()
// Check if servers exist 2
if (dnsCount < 1)
{
- string msg = "Servers list is empty." + NL;
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- return;
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgNoServers, Color.IndianRed));
+ return false;
}
// init Check DNS
@@ -223,7 +224,7 @@ private async Task CheckServers()
WorkingDnsList.Clear();
// Get Company Data Content
- string? companyDataContent = await Resource.GetResourceTextFileAsync("SecureDNSClient.HostToCompany.txt", Assembly.GetExecutingAssembly()); // Load from Embedded Resource
+ string? companyDataContent = await ResourceTool.GetResourceTextFileAsync("SecureDNSClient.HostToCompany.txt", Assembly.GetExecutingAssembly()); // Load from Embedded Resource
// Set number of servers
int numberOfAllServers = 0;
@@ -236,44 +237,43 @@ private async Task CheckServers()
checkDns.CheckDNS(blockedDomainNoWww, dnsList[0], 100);
if (insecure)
- checkSeries();
+ await checkSeries();
else
{
if (checkInParallel)
await checkParallel();
else
- checkSeries();
+ await checkSeries();
}
- void checkSeries()
+ async Task checkSeries()
{
this.InvokeIt(() => CustomProgressBarCheck.StopTimer = false);
this.InvokeIt(() => CustomProgressBarCheck.ChunksColor = Color.DodgerBlue);
+ this.InvokeIt(() => CustomProgressBarCheck.Maximum = dnsCount);
for (int n = 0; n < dnsCount; n++)
{
if (StopChecking)
{
string msg = NL + "Canceling Check operation..." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.DodgerBlue));
-
break;
}
// Percentage
- int persent = n * 100 / dnsCount;
string checkDetail = $"{n + 1} of {dnsCount}";
this.InvokeIt(() => CustomProgressBarCheck.CustomText = checkDetail);
- this.InvokeIt(() => CustomProgressBarCheck.Value = persent);
+ this.InvokeIt(() => CustomProgressBarCheck.Value = n);
string dns = dnsList[n].Trim();
- checkOne(dns, n + 1);
+ await checkOne(dns, n + 1);
// Percentage (100%)
if (n == dnsCount - 1)
{
checkDetail = $"{n + 1} of {dnsCount}";
this.InvokeIt(() => CustomProgressBarCheck.CustomText = checkDetail);
- this.InvokeIt(() => CustomProgressBarCheck.Value = 100);
+ this.InvokeIt(() => CustomProgressBarCheck.Value = dnsCount);
}
}
}
@@ -288,29 +288,28 @@ await Task.Run(async () =>
this.InvokeIt(() => CustomProgressBarCheck.StopTimer = false);
this.InvokeIt(() => CustomProgressBarCheck.ChunksColor = Color.DodgerBlue);
+ this.InvokeIt(() => CustomProgressBarCheck.Maximum = lists.Count);
for (int n = 0; n < lists.Count; n++)
{
if (StopChecking)
{
string msg = NL + "Canceling Check operation..." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.DodgerBlue));
-
break;
}
List list = lists[n];
// Percentage
- int persent = n * 100 / lists.Count;
count += list.Count;
string checkDetail = $"{count} of {dnsCount}";
this.InvokeIt(() => CustomProgressBarCheck.CustomText = checkDetail);
- this.InvokeIt(() => CustomProgressBarCheck.Value = persent);
+ this.InvokeIt(() => CustomProgressBarCheck.Value = n);
- var parallelLoopResult = Parallel.For(0, list.Count, i =>
+ var parallelLoopResult = Parallel.For(0, list.Count, async i =>
{
string dns = list[i].Trim();
- checkOne(dns, -1);
+ await checkOne(dns, -1);
});
await Task.Run(async () =>
@@ -318,8 +317,7 @@ await Task.Run(async () =>
while (!parallelLoopResult.IsCompleted)
{
await Task.Delay(10);
- if (parallelLoopResult.IsCompleted)
- break;
+ if (parallelLoopResult.IsCompleted) break;
}
});
@@ -328,13 +326,13 @@ await Task.Run(async () =>
{
checkDetail = $"{dnsCount} of {dnsCount}";
this.InvokeIt(() => CustomProgressBarCheck.CustomText = checkDetail);
- this.InvokeIt(() => CustomProgressBarCheck.Value = 100);
+ this.InvokeIt(() => CustomProgressBarCheck.Value = lists.Count);
}
}
});
}
- void checkOne(string dns, int lineNumber)
+ async Task checkOne(string dns, int lineNumber)
{
if (!string.IsNullOrEmpty(dns) && !string.IsNullOrWhiteSpace(dns))
{
@@ -345,7 +343,7 @@ void checkOne(string dns, int lineNumber)
{
// All supported servers ++
numberOfAllSupportedServers++;
-
+
// Get DNS Details
DnsReader dnsReader = new(dns, companyDataContent);
@@ -364,7 +362,7 @@ void checkOne(string dns, int lineNumber)
// Apply Protocol Selection
bool matchRules = CheckDnsMatchRules(dnsReader);
if (!matchRules) return;
-
+
// Get Check timeout value
decimal timeoutSec = 1;
this.InvokeIt(() =>timeoutSec = CustomNumericUpDownSettingCheckTimeout.Value);
@@ -383,15 +381,15 @@ void checkOne(string dns, int lineNumber)
}
if (insecure)
- checkDns.CheckDNS(true, blockedDomainNoWww, dns, timeoutMS, localPort, bootstrap, bootstrapPort);
+ await checkDns.CheckDnsAsync(true, blockedDomainNoWww, dns, timeoutMS, localPort, bootstrap, bootstrapPort);
else
{
if (isParallel)
checkDns.CheckDNS(blockedDomainNoWww, dns, timeoutMS);
else
- checkDns.CheckDNS(false, blockedDomainNoWww, dns, timeoutMS, localPort, bootstrap, bootstrapPort);
+ await checkDns.CheckDnsAsync(false, blockedDomainNoWww, dns, timeoutMS, localPort, bootstrap, bootstrapPort);
}
-
+
// Get Status and Latency
bool dnsOK = checkDns.IsDnsOnline;
int latency = checkDns.DnsLatency;
@@ -535,12 +533,11 @@ void writeStatusToLog()
if (!WorkingDnsList.Any())
{
string noWorkingServer = NL + "There is no working server." + NL;
+ if (StopChecking || IsDisconnecting) noWorkingServer = NL + "Task Canceled." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(noWorkingServer, Color.IndianRed));
- return;
+ return false;
}
- //if (StopChecking) return;
-
// Sort by latency comment
string allWorkingServers = NL + "Working servers sorted by latency:" + NL + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(allWorkingServers, Color.MediumSeaGreen));
@@ -709,6 +706,7 @@ void writeSortedStatusToLog(DnsReader dnsReader)
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgAL2 + NL, Color.LightGray));
}
+ return true;
}
}
}
diff --git a/SecureDNSClient/Forms/Connect.cs b/SecureDNSClient/Forms/Connect.cs
index a0ed400..dfa3609 100644
--- a/SecureDNSClient/Forms/Connect.cs
+++ b/SecureDNSClient/Forms/Connect.cs
@@ -1,13 +1,14 @@
using CustomControls;
-using MsmhTools;
+using MsmhToolsClass;
using System;
+using System.Diagnostics;
using System.Net;
namespace SecureDNSClient
{
public partial class FormMain
{
- private async void StartConnect()
+ private async Task StartConnect(ConnectMode connectMode, bool reconnect = false)
{
// Return if binary files are missing
if (!CheckNecessaryFiles()) return;
@@ -20,11 +21,12 @@ private async void StartConnect()
try
{
// Connect
- if (IsConnecting) return;
-
// Check Internet Connectivity
if (!IsInternetAlive()) return;
+ if (IsConnecting) return;
+ IsConnecting = true;
+
// Create uid
SecureDNS.GenerateUid(this);
@@ -36,26 +38,26 @@ private async void StartConnect()
// Stop Check
if (IsCheckingStarted)
{
- CustomButtonCheck_Click(null, null);
+ StartCheck();
// Wait until check is done
- while (!IsCheckDone)
+ while (IsCheckingStarted)
Task.Delay(100).Wait();
}
- IsConnecting = true;
- await Connect();
+ await Connect(connectMode);
});
await taskConnect.ContinueWith(_ =>
{
IsConnecting = false;
+
string msg = $"{NL}Connect Task: {taskConnect.Status}{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.DodgerBlue));
if (taskConnect.Status == TaskStatus.Faulted)
{
- if (GetConnectMode() == ConnectMode.ConnectToWorkingServers)
+ if (connectMode == ConnectMode.ConnectToWorkingServers)
{
string faulted = $"Current DNS Servers are not stable, please check servers.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(faulted, Color.IndianRed));
@@ -66,7 +68,7 @@ await taskConnect.ContinueWith(_ =>
}
catch (Exception ex)
{
- CustomMessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ CustomMessageBox.Show(this, ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
@@ -75,34 +77,26 @@ await taskConnect.ContinueWith(_ =>
{
// Disconnect
if (IsDisconnecting) return;
-
IsDisconnecting = true;
// Write Disconnecting message to log
- string msgDisconnecting = NL + "Disconnecting..." + NL;
+ string msgDisconnecting = $"{NL}Disconnecting...{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDisconnecting, Color.MediumSeaGreen));
- Task taskWait1 = await Task.Run(async () =>
+ // Wait for Disconnect
+ Task wait1 = Task.Run(async () =>
{
- while (IsConnecting || IsConnected)
+ while (true)
{
- if (!IsConnecting && !IsConnected)
- return Task.CompletedTask;
+ if (!IsConnecting && !IsConnected) break;
disconnect();
- await Task.Delay(1000);
+ await Task.Delay(500);
}
- return Task.CompletedTask;
});
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(30)); } catch (Exception) { }
async void disconnect()
{
- // Unset DNS
- if (IsDNSSet)
- await UnsetSavedDNS();
-
- // Deactivate DPI
- DPIDeactive();
-
// Kill processes (DNSProxy, DNSCrypt)
ProcessManager.KillProcessByPID(PIDDNSProxy);
ProcessManager.KillProcessByPID(PIDDNSProxyBypass);
@@ -112,13 +106,13 @@ async void disconnect()
// Stop Cloudflare Bypass
BypassFakeProxyDohStop(true, true, true, false);
- //// Stop Fake Proxy
- //if (FakeProxy != null && FakeProxy.IsRunning)
- // FakeProxy.Stop();
+ // Unset Proxy if Proxy is Not Running
+ if (IsHttpProxySet && !IsHttpProxyRunning)
+ NetworkTool.UnsetProxy(false, true);
- // Unset Proxy
- if (IsProxySet && !IsSharing)
- Network.UnsetProxy(false, false);
+ // Unset DNS
+ if (IsDNSSet && !reconnect)
+ await UnsetSavedDNS();
// Update Groupbox Status
UpdateStatusLong();
@@ -135,10 +129,14 @@ async void disconnect()
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDisconnected, Color.MediumSeaGreen));
IsDisconnecting = false;
+
+ // Reconnect
+ if (!StopQuickConnect) // Make Quick Connect Cancel faster
+ if (reconnect) await StartConnect(connectMode);
}
catch (Exception ex)
{
- CustomMessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ CustomMessageBox.Show(this, ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
@@ -201,7 +199,7 @@ private bool CheckBypassWorks(int timeoutMS, int attempts, int pid)
return false;
}
- private async Task Connect()
+ private async Task Connect(ConnectMode connectMode)
{
// Write Connecting message to log
string msgConnecting = "Connecting... Please wait..." + NL + NL;
@@ -233,9 +231,6 @@ private async Task Connect()
if (CustomRadioButtonSettingWorkingModeDNSandDoH.Checked)
GenerateCertificate();
- // Get Connect mode
- ConnectMode connectMode = GetConnectMode();
-
// Connect modes
if (connectMode == ConnectMode.ConnectToWorkingServers)
{
@@ -245,26 +240,26 @@ private async Task Connect()
// Wait for DNSProxy
Task wait1 = Task.Run(async () =>
{
- while (!ProcessManager.FindProcessByPID(PIDDNSProxy))
+ while (true)
{
- if (ProcessManager.FindProcessByPID(PIDDNSProxy))
- break;
+ if (IsDisconnecting) break;
+ if (ProcessManager.FindProcessByPID(PIDDNSProxy)) break;
await Task.Delay(100);
}
});
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
// Wait Until DNS gets Online
Task wait2 = Task.Run(async () =>
{
- while (!IsDNSConnected)
+ while (true)
{
- if (IsDNSConnected)
- break;
+ if (IsDisconnecting) break;
+ if (IsDNSConnected) break;
await Task.Delay(100);
}
});
- await wait2.WaitAsync(TimeSpan.FromSeconds(30));
+ try { await wait2.WaitAsync(TimeSpan.FromSeconds(30)); } catch (Exception) { }
// Write dnsproxy message to log
string msgDnsProxy = string.Empty;
@@ -285,8 +280,8 @@ private async Task Connect()
else
{
msgDnsProxy = "Error: Couldn't start DNSProxy!" + NL;
- if (!IsDisconnecting)
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDnsProxy, Color.IndianRed));
+ if (IsDisconnecting) msgDnsProxy = "Task Canceled.";
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDnsProxy, Color.IndianRed));
}
}
else if (connectMode == ConnectMode.ConnectToFakeProxyDohViaProxyDPI || connectMode == ConnectMode.ConnectToFakeProxyDohViaGoodbyeDPI)
@@ -316,24 +311,33 @@ private async Task Connect()
// Wait for DNSCrypt
Task wait1 = Task.Run(async () =>
{
- while (!ProcessManager.FindProcessByPID(PIDDNSCrypt))
+ while (true)
{
- if (ProcessManager.FindProcessByPID(PIDDNSCrypt))
- break;
+ if (IsDisconnecting) break;
+ if (ProcessManager.FindProcessByPID(PIDDNSCrypt)) break;
await Task.Delay(100);
}
});
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
if (ProcessManager.FindProcessByPID(PIDDNSCrypt))
{
// Connected with DNSCrypt
internalConnect();
+
+ // Copy Local DoH to Clipboard
+ string localDoH;
+ if (ConnectedDohPort == 443)
+ localDoH = $"https://{IPAddress.Loopback}/dns-query";
+ else
+ localDoH = $"https://{IPAddress.Loopback}:{ConnectedDohPort}/dns-query";
+ this.InvokeIt(() => Clipboard.SetText(localDoH));
}
else
{
// Write DNSCryptProxy Error to log
string msg = "DNSCryptProxy couldn't connect, try again.";
+ if (IsDisconnecting) msg = "Task Canceled.";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg + NL, Color.IndianRed));
}
}
@@ -348,20 +352,12 @@ void internalConnect()
// Update Groupbox Status
UpdateStatusLong();
-
- // Go to DPI Tab if DPI is not already active
- if (ConnectAllClicked && !IsDPIActive)
- {
- this.InvokeIt(() => CustomTabControlMain.SelectedIndex = 0);
- this.InvokeIt(() => CustomTabControlSecureDNS.SelectedIndex = 2);
- this.InvokeIt(() => CustomTabControlDPIBasicAdvanced.SelectedIndex = 2);
- }
}
void connectMessage()
{
// Update Local IP
- LocalIP = Network.GetLocalIPv4();
+ LocalIP = NetworkTool.GetLocalIPv4();
// Get Loopback IP
IPAddress loopbackIP = IPAddress.Loopback;
@@ -399,7 +395,9 @@ void connectMessage()
msgLocalDoH3 += NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgLocalDoH3, Color.DodgerBlue));
}
-
+
+ // Copy Local DoH to Clipboard
+ this.InvokeIt(() => Clipboard.SetText(msgLocalDoH2.Trim(NL.ToCharArray())));
}
}
}
diff --git a/SecureDNSClient/Forms/ConnectToFakeProxy.cs b/SecureDNSClient/Forms/ConnectToFakeProxy.cs
index 72a7d86..6d78142 100644
--- a/SecureDNSClient/Forms/ConnectToFakeProxy.cs
+++ b/SecureDNSClient/Forms/ConnectToFakeProxy.cs
@@ -1,4 +1,4 @@
-using MsmhTools;
+using MsmhToolsClass;
using System;
using System.Diagnostics;
using System.Net;
@@ -14,9 +14,9 @@ private async Task BypassFakeProxyDohStart(int camouflagePort)
int getNextPort(int currentPort)
{
- currentPort = Network.GetNextPort(currentPort);
+ currentPort = NetworkTool.GetNextPort(currentPort);
if (currentPort == GetHTTPProxyPortSetting() || currentPort == GetCamouflageDnsPortSetting())
- currentPort = Network.GetNextPort(currentPort);
+ currentPort = NetworkTool.GetNextPort(currentPort);
return currentPort;
}
@@ -41,7 +41,7 @@ int getNextPort(int currentPort)
// Check Clean Ip is Valid
string cleanIP = CustomTextBoxSettingFakeProxyDohCleanIP.Text;
- bool isValid = Network.IsIPv4Valid(cleanIP, out IPAddress _);
+ bool isValid = NetworkTool.IsIPv4Valid(cleanIP, out IPAddress? _);
if (!isValid)
{
string msg = $"Fake Proxy DoH clean IP is not valid, check Settings.{NL}";
@@ -51,7 +51,7 @@ int getNextPort(int currentPort)
// Get Fake Proxy DoH Address
string dohUrl = CustomTextBoxSettingFakeProxyDohAddress.Text;
- Network.GetUrlDetails(dohUrl, 443, out string dohHost, out int _, out string _, out bool _);
+ NetworkTool.GetUrlDetails(dohUrl, 443, out _, out string dohHost, out int _, out string _, out bool _);
if (IsDisconnecting) return false;
@@ -73,7 +73,7 @@ int getNextPort(int currentPort)
if (checkDns.IsDnsOnline)
{
// Not blocked, connect normally
- return connectToFakeProxyDohNormally();
+ return await connectToFakeProxyDohNormally();
}
else
{
@@ -87,7 +87,7 @@ int getNextPort(int currentPort)
return await TryToBypassFakeProxyDohUsingGoodbyeDPIAsync(cleanIP, camouflagePort, timeoutMS);
}
- bool connectToFakeProxyDohNormally()
+ async Task connectToFakeProxyDohNormally()
{
if (IsDisconnecting) return false;
@@ -136,7 +136,18 @@ bool connectToFakeProxyDohNormally()
// Execute DNSProxy
PIDDNSProxyBypass = ProcessManager.ExecuteOnly(out Process _, SecureDNS.DnsProxy, dnsproxyArgs, true, true, SecureDNS.CurrentPath, GetCPUPriority());
- Task.Delay(500).Wait();
+
+ // Wait for DNSProxy
+ Task wait1 = Task.Run(async () =>
+ {
+ while (true)
+ {
+ if (IsDisconnecting) break;
+ if (ProcessManager.FindProcessByPID(PIDDNSProxyBypass)) break;
+ await Task.Delay(100);
+ }
+ });
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
if (ProcessManager.FindProcessByPID(PIDDNSProxyBypass))
{
@@ -169,6 +180,7 @@ bool connectToFakeProxyDohNormally()
// Couldn't connect normally!
string connectNormallyFailed = $"Couldn't connect. It's really weird!{NL}";
+ if (IsDisconnecting) connectNormallyFailed = $"Task Canceled.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(connectNormallyFailed, Color.IndianRed));
// Kill DNSProxy
@@ -178,10 +190,9 @@ bool connectToFakeProxyDohNormally()
}
else
{
- if (IsDisconnecting) return false;
-
// DNSProxy failed to execute
string msgDNSProxyFailed = $"DNSProxy failed to execute. Try again.{NL}";
+ if (IsDisconnecting) msgDNSProxyFailed = $"Task Canceled.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDNSProxyFailed, Color.IndianRed));
return false;
}
@@ -190,10 +201,10 @@ bool connectToFakeProxyDohNormally()
private void BypassFakeProxyDohStop(bool stopCamouflageServer, bool stopDNSProxyOrDNSCrypt, bool stopDPI, bool writeToLog)
{
- if (stopCamouflageServer && CamouflageProxyServer != null && CamouflageProxyServer.IsRunning)
+ if (stopCamouflageServer && CamouflageHttpProxyServer != null && CamouflageHttpProxyServer.IsRunning)
{
- CamouflageProxyServer.Stop();
- IsBypassProxyActive = false;
+ CamouflageHttpProxyServer.Stop();
+ IsBypassHttpProxyActive = false;
}
if (stopCamouflageServer && CamouflageDNSServer != null && CamouflageDNSServer.IsRunning)
diff --git a/SecureDNSClient/Forms/ConnectToServersUsingProxy.cs b/SecureDNSClient/Forms/ConnectToServersUsingProxy.cs
index 56c3c97..1632a54 100644
--- a/SecureDNSClient/Forms/ConnectToServersUsingProxy.cs
+++ b/SecureDNSClient/Forms/ConnectToServersUsingProxy.cs
@@ -1,5 +1,5 @@
-using MsmhTools;
-using MsmhTools.DnsTool;
+using MsmhToolsClass;
+using MsmhToolsClass.DnsTool;
using System;
using System.Diagnostics;
using System.Net;
@@ -27,25 +27,28 @@ void proxySchemeIncorrect()
}
// Get Host and Port of Proxy
- Network.GetUrlDetails(proxyScheme, 0, out string host, out int port, out string _, out bool _);
+ NetworkTool.GetUrlDetails(proxyScheme, 0, out _, out string host, out int port, out string _, out bool _);
// Convert proxy host to IP
+ string ipStr = string.Empty;
bool isIP = IPAddress.TryParse(host, out IPAddress? _);
- if (!isIP)
- {
- IPAddress? ip = Network.HostToIP(host);
- if (ip != null) host = ip.ToString();
- }
+ if (isIP)
+ ipStr = host;
+ else
+ ipStr = GetIP.GetIpFromSystem(host);
// Check if proxy works
- bool isProxyOk = Network.CanPing(host, 15);
- if (!isProxyOk)
+ if (!string.IsNullOrEmpty(ipStr))
{
- string msgWrongProxy = $"Proxy doesn't work.";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgWrongProxy + NL, Color.IndianRed));
- return;
+ bool isProxyOk = NetworkTool.CanPing(ipStr, 15);
+ if (!isProxyOk)
+ {
+ string msgWrongProxy = $"Proxy doesn't work.";
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgWrongProxy + NL, Color.IndianRed));
+ return;
+ }
}
-
+
// Check if config file exist
if (!File.Exists(SecureDNS.DNSCryptConfigPath))
{
diff --git a/SecureDNSClient/Forms/ConnectToWorkingServers.cs b/SecureDNSClient/Forms/ConnectToWorkingServers.cs
index a2a8536..763d37d 100644
--- a/SecureDNSClient/Forms/ConnectToWorkingServers.cs
+++ b/SecureDNSClient/Forms/ConnectToWorkingServers.cs
@@ -1,4 +1,4 @@
-using MsmhTools;
+using MsmhToolsClass;
using System;
using System.Diagnostics;
@@ -6,6 +6,8 @@ namespace SecureDNSClient
{
public partial class FormMain
{
+ private static bool ProcessOutputFilter = false;
+
private int ConnectToWorkingServers()
{
// Write Check first to log
@@ -65,7 +67,7 @@ private int ConnectToWorkingServers()
// Add Legacy DNS args
dnsproxyArgs += " -p 53";
-
+
// Add DoH args
if (CustomRadioButtonSettingWorkingModeDNSandDoH.Checked)
{
@@ -96,13 +98,32 @@ private int ConnectToWorkingServers()
dnsproxyArgs += $" --all-servers -b {bootstrap}:{bootstrapPort}";
else
dnsproxyArgs += $" -b {bootstrap}:{bootstrapPort}";
-
+ dnsproxyArgs += " -v";
if (IsDisconnecting) return -1;
// Execute DnsProxy
PIDDNSProxy = ProcessManager.ExecuteOnly(out Process _, SecureDNS.DnsProxy, dnsproxyArgs, true, false, SecureDNS.CurrentPath, GetCPUPriority());
+ // Write DNS Requests to Log (the output is heavy filtering queries causes high cpu usage)
+ //process.OutputDataReceived -= process_DataReceived;
+ //process.OutputDataReceived += process_DataReceived;
+ //process.ErrorDataReceived -= process_DataReceived;
+ //process.ErrorDataReceived += process_DataReceived;
+ //process.BeginOutputReadLine(); // Redirects Standard Output to Event
+ //process.BeginErrorReadLine();
+ //void process_DataReceived(object sender, DataReceivedEventArgs e)
+ //{
+ // string? msgReq = e.Data + NL;
+ // if (!string.IsNullOrEmpty(msgReq))
+ // {
+ // if (ProcessOutputFilter)
+ // this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgReq));
+ // ProcessOutputFilter = msgReq.Contains("ANSWER SECTION");
+ // }
+ //}
+
return countUsingServers;
}
+
}
}
diff --git a/SecureDNSClient/Forms/FormDnsLookup.Designer.cs b/SecureDNSClient/Forms/FormDnsLookup.Designer.cs
index 7fff969..d18630f 100644
--- a/SecureDNSClient/Forms/FormDnsLookup.Designer.cs
+++ b/SecureDNSClient/Forms/FormDnsLookup.Designer.cs
@@ -29,484 +29,480 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormDnsLookup));
- this.CustomRadioButtonSourceSDC = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonSourceCustom = new CustomControls.CustomRadioButton();
- this.CustomTextBoxSourceCustom = new CustomControls.CustomTextBox();
- this.CustomLabelDomain = new CustomControls.CustomLabel();
- this.CustomTextBoxDomain = new CustomControls.CustomTextBox();
- this.CustomButtonLookup = new CustomControls.CustomButton();
- this.CustomTextBoxResult = new CustomControls.CustomTextBox();
- this.CustomCheckBoxHTTP3 = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxVERIFY = new CustomControls.CustomCheckBox();
- this.CustomLabelRRTYPE = new CustomControls.CustomLabel();
- this.CustomTextBoxRRTYPE = new CustomControls.CustomTextBox();
- this.CustomLabelCLASS = new CustomControls.CustomLabel();
- this.CustomTextBoxCLASS = new CustomControls.CustomTextBox();
- this.CustomCheckBoxDNSSEC = new CustomControls.CustomCheckBox();
- this.CustomLabelSUBNET = new CustomControls.CustomLabel();
- this.CustomTextBoxSUBNET = new CustomControls.CustomTextBox();
- this.CustomCheckBoxPAD = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxVERBOSE = new CustomControls.CustomCheckBox();
- this.CustomLabelEDNSOPT = new CustomControls.CustomLabel();
- this.CustomTextBoxEDNSOPT = new CustomControls.CustomTextBox();
- this.CustomButtonDefault = new CustomControls.CustomButton();
- this.CustomCheckBoxJSON = new CustomControls.CustomCheckBox();
- this.SuspendLayout();
+ CustomRadioButtonSourceSDC = new CustomControls.CustomRadioButton();
+ CustomRadioButtonSourceCustom = new CustomControls.CustomRadioButton();
+ CustomTextBoxSourceCustom = new CustomControls.CustomTextBox();
+ CustomLabelDomain = new CustomControls.CustomLabel();
+ CustomTextBoxDomain = new CustomControls.CustomTextBox();
+ CustomButtonLookup = new CustomControls.CustomButton();
+ CustomTextBoxResult = new CustomControls.CustomTextBox();
+ CustomCheckBoxHTTP3 = new CustomControls.CustomCheckBox();
+ CustomCheckBoxVERIFY = new CustomControls.CustomCheckBox();
+ CustomLabelRRTYPE = new CustomControls.CustomLabel();
+ CustomTextBoxRRTYPE = new CustomControls.CustomTextBox();
+ CustomLabelCLASS = new CustomControls.CustomLabel();
+ CustomTextBoxCLASS = new CustomControls.CustomTextBox();
+ CustomCheckBoxDNSSEC = new CustomControls.CustomCheckBox();
+ CustomLabelSUBNET = new CustomControls.CustomLabel();
+ CustomTextBoxSUBNET = new CustomControls.CustomTextBox();
+ CustomCheckBoxPAD = new CustomControls.CustomCheckBox();
+ CustomCheckBoxVERBOSE = new CustomControls.CustomCheckBox();
+ CustomLabelEDNSOPT = new CustomControls.CustomLabel();
+ CustomTextBoxEDNSOPT = new CustomControls.CustomTextBox();
+ CustomButtonDefault = new CustomControls.CustomButton();
+ CustomCheckBoxJSON = new CustomControls.CustomCheckBox();
+ SuspendLayout();
//
// CustomRadioButtonSourceSDC
//
- this.CustomRadioButtonSourceSDC.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSourceSDC.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSourceSDC.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSourceSDC.Checked = true;
- this.CustomRadioButtonSourceSDC.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSourceSDC.Location = new System.Drawing.Point(12, 10);
- this.CustomRadioButtonSourceSDC.Name = "CustomRadioButtonSourceSDC";
- this.CustomRadioButtonSourceSDC.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSourceSDC.Size = new System.Drawing.Size(43, 17);
- this.CustomRadioButtonSourceSDC.TabIndex = 0;
- this.CustomRadioButtonSourceSDC.TabStop = true;
- this.CustomRadioButtonSourceSDC.Text = "SDC";
- this.CustomRadioButtonSourceSDC.UseVisualStyleBackColor = false;
+ CustomRadioButtonSourceSDC.BackColor = Color.DimGray;
+ CustomRadioButtonSourceSDC.BorderColor = Color.Blue;
+ CustomRadioButtonSourceSDC.CheckColor = Color.Blue;
+ CustomRadioButtonSourceSDC.Checked = true;
+ CustomRadioButtonSourceSDC.ForeColor = Color.White;
+ CustomRadioButtonSourceSDC.Location = new Point(12, 10);
+ CustomRadioButtonSourceSDC.Name = "CustomRadioButtonSourceSDC";
+ CustomRadioButtonSourceSDC.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSourceSDC.Size = new Size(43, 17);
+ CustomRadioButtonSourceSDC.TabIndex = 0;
+ CustomRadioButtonSourceSDC.TabStop = true;
+ CustomRadioButtonSourceSDC.Text = "SDC";
+ CustomRadioButtonSourceSDC.UseVisualStyleBackColor = false;
//
// CustomRadioButtonSourceCustom
//
- this.CustomRadioButtonSourceCustom.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSourceCustom.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSourceCustom.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSourceCustom.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSourceCustom.Location = new System.Drawing.Point(61, 10);
- this.CustomRadioButtonSourceCustom.Name = "CustomRadioButtonSourceCustom";
- this.CustomRadioButtonSourceCustom.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSourceCustom.Size = new System.Drawing.Size(65, 17);
- this.CustomRadioButtonSourceCustom.TabIndex = 1;
- this.CustomRadioButtonSourceCustom.Text = "Custom:";
- this.CustomRadioButtonSourceCustom.UseVisualStyleBackColor = false;
+ CustomRadioButtonSourceCustom.BackColor = Color.DimGray;
+ CustomRadioButtonSourceCustom.BorderColor = Color.Blue;
+ CustomRadioButtonSourceCustom.CheckColor = Color.Blue;
+ CustomRadioButtonSourceCustom.ForeColor = Color.White;
+ CustomRadioButtonSourceCustom.Location = new Point(61, 10);
+ CustomRadioButtonSourceCustom.Name = "CustomRadioButtonSourceCustom";
+ CustomRadioButtonSourceCustom.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSourceCustom.Size = new Size(65, 17);
+ CustomRadioButtonSourceCustom.TabIndex = 1;
+ CustomRadioButtonSourceCustom.Text = "Custom:";
+ CustomRadioButtonSourceCustom.UseVisualStyleBackColor = false;
//
// CustomTextBoxSourceCustom
//
- this.CustomTextBoxSourceCustom.AcceptsReturn = false;
- this.CustomTextBoxSourceCustom.AcceptsTab = false;
- this.CustomTextBoxSourceCustom.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSourceCustom.Border = true;
- this.CustomTextBoxSourceCustom.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSourceCustom.BorderSize = 1;
- this.CustomTextBoxSourceCustom.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSourceCustom.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSourceCustom.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSourceCustom.HideSelection = true;
- this.CustomTextBoxSourceCustom.Location = new System.Drawing.Point(132, 8);
- this.CustomTextBoxSourceCustom.MaxLength = 32767;
- this.CustomTextBoxSourceCustom.Multiline = false;
- this.CustomTextBoxSourceCustom.Name = "CustomTextBoxSourceCustom";
- this.CustomTextBoxSourceCustom.ReadOnly = false;
- this.CustomTextBoxSourceCustom.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSourceCustom.ShortcutsEnabled = true;
- this.CustomTextBoxSourceCustom.Size = new System.Drawing.Size(200, 23);
- this.CustomTextBoxSourceCustom.TabIndex = 0;
- this.CustomTextBoxSourceCustom.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSourceCustom.Texts = "";
- this.CustomTextBoxSourceCustom.UnderlinedStyle = true;
- this.CustomTextBoxSourceCustom.UsePasswordChar = false;
- this.CustomTextBoxSourceCustom.WordWrap = true;
+ CustomTextBoxSourceCustom.AcceptsReturn = false;
+ CustomTextBoxSourceCustom.AcceptsTab = false;
+ CustomTextBoxSourceCustom.BackColor = Color.DimGray;
+ CustomTextBoxSourceCustom.Border = true;
+ CustomTextBoxSourceCustom.BorderColor = Color.Blue;
+ CustomTextBoxSourceCustom.BorderSize = 1;
+ CustomTextBoxSourceCustom.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSourceCustom.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSourceCustom.ForeColor = Color.White;
+ CustomTextBoxSourceCustom.HideSelection = true;
+ CustomTextBoxSourceCustom.Location = new Point(132, 8);
+ CustomTextBoxSourceCustom.MaxLength = 32767;
+ CustomTextBoxSourceCustom.Multiline = false;
+ CustomTextBoxSourceCustom.Name = "CustomTextBoxSourceCustom";
+ CustomTextBoxSourceCustom.ReadOnly = false;
+ CustomTextBoxSourceCustom.ScrollBars = ScrollBars.None;
+ CustomTextBoxSourceCustom.ShortcutsEnabled = true;
+ CustomTextBoxSourceCustom.Size = new Size(200, 23);
+ CustomTextBoxSourceCustom.TabIndex = 0;
+ CustomTextBoxSourceCustom.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSourceCustom.Texts = "";
+ CustomTextBoxSourceCustom.UnderlinedStyle = true;
+ CustomTextBoxSourceCustom.UsePasswordChar = false;
+ CustomTextBoxSourceCustom.WordWrap = true;
//
// CustomLabelDomain
//
- this.CustomLabelDomain.AutoSize = true;
- this.CustomLabelDomain.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelDomain.Border = false;
- this.CustomLabelDomain.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelDomain.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelDomain.ForeColor = System.Drawing.Color.White;
- this.CustomLabelDomain.Location = new System.Drawing.Point(74, 50);
- this.CustomLabelDomain.Name = "CustomLabelDomain";
- this.CustomLabelDomain.RoundedCorners = 0;
- this.CustomLabelDomain.Size = new System.Drawing.Size(54, 17);
- this.CustomLabelDomain.TabIndex = 3;
- this.CustomLabelDomain.Text = "Domain:";
+ CustomLabelDomain.AutoSize = true;
+ CustomLabelDomain.BackColor = Color.DimGray;
+ CustomLabelDomain.Border = false;
+ CustomLabelDomain.BorderColor = Color.Blue;
+ CustomLabelDomain.FlatStyle = FlatStyle.Flat;
+ CustomLabelDomain.ForeColor = Color.White;
+ CustomLabelDomain.Location = new Point(74, 50);
+ CustomLabelDomain.Name = "CustomLabelDomain";
+ CustomLabelDomain.RoundedCorners = 0;
+ CustomLabelDomain.Size = new Size(54, 17);
+ CustomLabelDomain.TabIndex = 3;
+ CustomLabelDomain.Text = "Domain:";
//
// CustomTextBoxDomain
//
- this.CustomTextBoxDomain.AcceptsReturn = false;
- this.CustomTextBoxDomain.AcceptsTab = false;
- this.CustomTextBoxDomain.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxDomain.Border = true;
- this.CustomTextBoxDomain.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxDomain.BorderSize = 1;
- this.CustomTextBoxDomain.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxDomain.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxDomain.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxDomain.HideSelection = true;
- this.CustomTextBoxDomain.Location = new System.Drawing.Point(132, 48);
- this.CustomTextBoxDomain.MaxLength = 32767;
- this.CustomTextBoxDomain.Multiline = false;
- this.CustomTextBoxDomain.Name = "CustomTextBoxDomain";
- this.CustomTextBoxDomain.ReadOnly = false;
- this.CustomTextBoxDomain.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxDomain.ShortcutsEnabled = true;
- this.CustomTextBoxDomain.Size = new System.Drawing.Size(200, 23);
- this.CustomTextBoxDomain.TabIndex = 0;
- this.CustomTextBoxDomain.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxDomain.Texts = "";
- this.CustomTextBoxDomain.UnderlinedStyle = true;
- this.CustomTextBoxDomain.UsePasswordChar = false;
- this.CustomTextBoxDomain.WordWrap = true;
+ CustomTextBoxDomain.AcceptsReturn = false;
+ CustomTextBoxDomain.AcceptsTab = false;
+ CustomTextBoxDomain.BackColor = Color.DimGray;
+ CustomTextBoxDomain.Border = true;
+ CustomTextBoxDomain.BorderColor = Color.Blue;
+ CustomTextBoxDomain.BorderSize = 1;
+ CustomTextBoxDomain.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxDomain.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxDomain.ForeColor = Color.White;
+ CustomTextBoxDomain.HideSelection = true;
+ CustomTextBoxDomain.Location = new Point(132, 48);
+ CustomTextBoxDomain.MaxLength = 32767;
+ CustomTextBoxDomain.Multiline = false;
+ CustomTextBoxDomain.Name = "CustomTextBoxDomain";
+ CustomTextBoxDomain.ReadOnly = false;
+ CustomTextBoxDomain.ScrollBars = ScrollBars.None;
+ CustomTextBoxDomain.ShortcutsEnabled = true;
+ CustomTextBoxDomain.Size = new Size(200, 23);
+ CustomTextBoxDomain.TabIndex = 0;
+ CustomTextBoxDomain.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxDomain.Texts = "";
+ CustomTextBoxDomain.UnderlinedStyle = true;
+ CustomTextBoxDomain.UsePasswordChar = false;
+ CustomTextBoxDomain.WordWrap = true;
//
// CustomButtonLookup
//
- this.CustomButtonLookup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomButtonLookup.AutoSize = true;
- this.CustomButtonLookup.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonLookup.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonLookup.Location = new System.Drawing.Point(370, 50);
- this.CustomButtonLookup.Name = "CustomButtonLookup";
- this.CustomButtonLookup.RoundedCorners = 5;
- this.CustomButtonLookup.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonLookup.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonLookup.TabIndex = 7;
- this.CustomButtonLookup.Text = "Lookup";
- this.CustomButtonLookup.UseVisualStyleBackColor = true;
- this.CustomButtonLookup.Click += new System.EventHandler(this.CustomButtonLookup_Click);
+ CustomButtonLookup.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ CustomButtonLookup.AutoSize = true;
+ CustomButtonLookup.BorderColor = Color.Blue;
+ CustomButtonLookup.FlatStyle = FlatStyle.Flat;
+ CustomButtonLookup.Location = new Point(370, 50);
+ CustomButtonLookup.Name = "CustomButtonLookup";
+ CustomButtonLookup.RoundedCorners = 5;
+ CustomButtonLookup.SelectionColor = Color.LightBlue;
+ CustomButtonLookup.Size = new Size(75, 27);
+ CustomButtonLookup.TabIndex = 7;
+ CustomButtonLookup.Text = "Lookup";
+ CustomButtonLookup.UseVisualStyleBackColor = true;
+ CustomButtonLookup.Click += CustomButtonLookup_Click;
//
// CustomTextBoxResult
//
- this.CustomTextBoxResult.AcceptsReturn = false;
- this.CustomTextBoxResult.AcceptsTab = false;
- this.CustomTextBoxResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomTextBoxResult.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxResult.Border = true;
- this.CustomTextBoxResult.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxResult.BorderSize = 1;
- this.CustomTextBoxResult.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxResult.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxResult.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxResult.HideSelection = true;
- this.CustomTextBoxResult.Location = new System.Drawing.Point(12, 187);
- this.CustomTextBoxResult.MaxLength = 32767;
- this.CustomTextBoxResult.MinimumSize = new System.Drawing.Size(0, 23);
- this.CustomTextBoxResult.Multiline = true;
- this.CustomTextBoxResult.Name = "CustomTextBoxResult";
- this.CustomTextBoxResult.ReadOnly = true;
- this.CustomTextBoxResult.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.CustomTextBoxResult.ShortcutsEnabled = true;
- this.CustomTextBoxResult.Size = new System.Drawing.Size(433, 262);
- this.CustomTextBoxResult.TabIndex = 0;
- this.CustomTextBoxResult.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxResult.Texts = "";
- this.CustomTextBoxResult.UnderlinedStyle = false;
- this.CustomTextBoxResult.UsePasswordChar = false;
- this.CustomTextBoxResult.WordWrap = true;
+ CustomTextBoxResult.AcceptsReturn = false;
+ CustomTextBoxResult.AcceptsTab = false;
+ CustomTextBoxResult.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ CustomTextBoxResult.BackColor = Color.DimGray;
+ CustomTextBoxResult.Border = true;
+ CustomTextBoxResult.BorderColor = Color.Blue;
+ CustomTextBoxResult.BorderSize = 1;
+ CustomTextBoxResult.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxResult.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxResult.ForeColor = Color.White;
+ CustomTextBoxResult.HideSelection = true;
+ CustomTextBoxResult.Location = new Point(12, 187);
+ CustomTextBoxResult.MaxLength = 32767;
+ CustomTextBoxResult.MinimumSize = new Size(0, 23);
+ CustomTextBoxResult.Multiline = true;
+ CustomTextBoxResult.Name = "CustomTextBoxResult";
+ CustomTextBoxResult.ReadOnly = true;
+ CustomTextBoxResult.ScrollBars = ScrollBars.Vertical;
+ CustomTextBoxResult.ShortcutsEnabled = true;
+ CustomTextBoxResult.Size = new Size(433, 262);
+ CustomTextBoxResult.TabIndex = 0;
+ CustomTextBoxResult.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxResult.Texts = "";
+ CustomTextBoxResult.UnderlinedStyle = false;
+ CustomTextBoxResult.UsePasswordChar = false;
+ CustomTextBoxResult.WordWrap = true;
//
// CustomCheckBoxHTTP3
//
- this.CustomCheckBoxHTTP3.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxHTTP3.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxHTTP3.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxHTTP3.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxHTTP3.Location = new System.Drawing.Point(12, 80);
- this.CustomCheckBoxHTTP3.Name = "CustomCheckBoxHTTP3";
- this.CustomCheckBoxHTTP3.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxHTTP3.Size = new System.Drawing.Size(107, 17);
- this.CustomCheckBoxHTTP3.TabIndex = 10;
- this.CustomCheckBoxHTTP3.Text = "HTTP/3 support";
- this.CustomCheckBoxHTTP3.UseVisualStyleBackColor = false;
+ CustomCheckBoxHTTP3.BackColor = Color.DimGray;
+ CustomCheckBoxHTTP3.BorderColor = Color.Blue;
+ CustomCheckBoxHTTP3.CheckColor = Color.Blue;
+ CustomCheckBoxHTTP3.ForeColor = Color.White;
+ CustomCheckBoxHTTP3.Location = new Point(12, 80);
+ CustomCheckBoxHTTP3.Name = "CustomCheckBoxHTTP3";
+ CustomCheckBoxHTTP3.SelectionColor = Color.LightBlue;
+ CustomCheckBoxHTTP3.Size = new Size(107, 17);
+ CustomCheckBoxHTTP3.TabIndex = 10;
+ CustomCheckBoxHTTP3.Text = "HTTP/3 support";
+ CustomCheckBoxHTTP3.UseVisualStyleBackColor = false;
//
// CustomCheckBoxVERIFY
//
- this.CustomCheckBoxVERIFY.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxVERIFY.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxVERIFY.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxVERIFY.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxVERIFY.Location = new System.Drawing.Point(132, 80);
- this.CustomCheckBoxVERIFY.Name = "CustomCheckBoxVERIFY";
- this.CustomCheckBoxVERIFY.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxVERIFY.Size = new System.Drawing.Size(189, 17);
- this.CustomCheckBoxVERIFY.TabIndex = 14;
- this.CustomCheckBoxVERIFY.Text = "Disable Certificates Verification";
- this.CustomCheckBoxVERIFY.UseVisualStyleBackColor = false;
+ CustomCheckBoxVERIFY.BackColor = Color.DimGray;
+ CustomCheckBoxVERIFY.BorderColor = Color.Blue;
+ CustomCheckBoxVERIFY.CheckColor = Color.Blue;
+ CustomCheckBoxVERIFY.ForeColor = Color.White;
+ CustomCheckBoxVERIFY.Location = new Point(132, 80);
+ CustomCheckBoxVERIFY.Name = "CustomCheckBoxVERIFY";
+ CustomCheckBoxVERIFY.SelectionColor = Color.LightBlue;
+ CustomCheckBoxVERIFY.Size = new Size(189, 17);
+ CustomCheckBoxVERIFY.TabIndex = 14;
+ CustomCheckBoxVERIFY.Text = "Disable Certificates Verification";
+ CustomCheckBoxVERIFY.UseVisualStyleBackColor = false;
//
// CustomLabelRRTYPE
//
- this.CustomLabelRRTYPE.AutoSize = true;
- this.CustomLabelRRTYPE.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelRRTYPE.Border = false;
- this.CustomLabelRRTYPE.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelRRTYPE.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelRRTYPE.ForeColor = System.Drawing.Color.White;
- this.CustomLabelRRTYPE.Location = new System.Drawing.Point(12, 130);
- this.CustomLabelRRTYPE.Name = "CustomLabelRRTYPE";
- this.CustomLabelRRTYPE.RoundedCorners = 0;
- this.CustomLabelRRTYPE.Size = new System.Drawing.Size(51, 17);
- this.CustomLabelRRTYPE.TabIndex = 15;
- this.CustomLabelRRTYPE.Text = "RRTYPE:";
+ CustomLabelRRTYPE.AutoSize = true;
+ CustomLabelRRTYPE.BackColor = Color.DimGray;
+ CustomLabelRRTYPE.Border = false;
+ CustomLabelRRTYPE.BorderColor = Color.Blue;
+ CustomLabelRRTYPE.FlatStyle = FlatStyle.Flat;
+ CustomLabelRRTYPE.ForeColor = Color.White;
+ CustomLabelRRTYPE.Location = new Point(12, 130);
+ CustomLabelRRTYPE.Name = "CustomLabelRRTYPE";
+ CustomLabelRRTYPE.RoundedCorners = 0;
+ CustomLabelRRTYPE.Size = new Size(51, 17);
+ CustomLabelRRTYPE.TabIndex = 15;
+ CustomLabelRRTYPE.Text = "RRTYPE:";
//
// CustomTextBoxRRTYPE
//
- this.CustomTextBoxRRTYPE.AcceptsReturn = false;
- this.CustomTextBoxRRTYPE.AcceptsTab = false;
- this.CustomTextBoxRRTYPE.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxRRTYPE.Border = true;
- this.CustomTextBoxRRTYPE.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxRRTYPE.BorderSize = 1;
- this.CustomTextBoxRRTYPE.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxRRTYPE.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxRRTYPE.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxRRTYPE.HideSelection = true;
- this.CustomTextBoxRRTYPE.Location = new System.Drawing.Point(69, 128);
- this.CustomTextBoxRRTYPE.MaxLength = 32767;
- this.CustomTextBoxRRTYPE.Multiline = false;
- this.CustomTextBoxRRTYPE.Name = "CustomTextBoxRRTYPE";
- this.CustomTextBoxRRTYPE.ReadOnly = false;
- this.CustomTextBoxRRTYPE.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxRRTYPE.ShortcutsEnabled = true;
- this.CustomTextBoxRRTYPE.Size = new System.Drawing.Size(50, 23);
- this.CustomTextBoxRRTYPE.TabIndex = 0;
- this.CustomTextBoxRRTYPE.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxRRTYPE.Texts = "A";
- this.CustomTextBoxRRTYPE.UnderlinedStyle = true;
- this.CustomTextBoxRRTYPE.UsePasswordChar = false;
- this.CustomTextBoxRRTYPE.WordWrap = true;
+ CustomTextBoxRRTYPE.AcceptsReturn = false;
+ CustomTextBoxRRTYPE.AcceptsTab = false;
+ CustomTextBoxRRTYPE.BackColor = Color.DimGray;
+ CustomTextBoxRRTYPE.Border = true;
+ CustomTextBoxRRTYPE.BorderColor = Color.Blue;
+ CustomTextBoxRRTYPE.BorderSize = 1;
+ CustomTextBoxRRTYPE.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxRRTYPE.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxRRTYPE.ForeColor = Color.White;
+ CustomTextBoxRRTYPE.HideSelection = true;
+ CustomTextBoxRRTYPE.Location = new Point(69, 128);
+ CustomTextBoxRRTYPE.MaxLength = 32767;
+ CustomTextBoxRRTYPE.Multiline = false;
+ CustomTextBoxRRTYPE.Name = "CustomTextBoxRRTYPE";
+ CustomTextBoxRRTYPE.ReadOnly = false;
+ CustomTextBoxRRTYPE.ScrollBars = ScrollBars.None;
+ CustomTextBoxRRTYPE.ShortcutsEnabled = true;
+ CustomTextBoxRRTYPE.Size = new Size(50, 23);
+ CustomTextBoxRRTYPE.TabIndex = 0;
+ CustomTextBoxRRTYPE.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxRRTYPE.Texts = "A";
+ CustomTextBoxRRTYPE.UnderlinedStyle = true;
+ CustomTextBoxRRTYPE.UsePasswordChar = false;
+ CustomTextBoxRRTYPE.WordWrap = true;
//
// CustomLabelCLASS
//
- this.CustomLabelCLASS.AutoSize = true;
- this.CustomLabelCLASS.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelCLASS.Border = false;
- this.CustomLabelCLASS.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelCLASS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelCLASS.ForeColor = System.Drawing.Color.White;
- this.CustomLabelCLASS.Location = new System.Drawing.Point(130, 130);
- this.CustomLabelCLASS.Name = "CustomLabelCLASS";
- this.CustomLabelCLASS.RoundedCorners = 0;
- this.CustomLabelCLASS.Size = new System.Drawing.Size(46, 17);
- this.CustomLabelCLASS.TabIndex = 17;
- this.CustomLabelCLASS.Text = "CLASS:";
+ CustomLabelCLASS.AutoSize = true;
+ CustomLabelCLASS.BackColor = Color.DimGray;
+ CustomLabelCLASS.Border = false;
+ CustomLabelCLASS.BorderColor = Color.Blue;
+ CustomLabelCLASS.FlatStyle = FlatStyle.Flat;
+ CustomLabelCLASS.ForeColor = Color.White;
+ CustomLabelCLASS.Location = new Point(130, 130);
+ CustomLabelCLASS.Name = "CustomLabelCLASS";
+ CustomLabelCLASS.RoundedCorners = 0;
+ CustomLabelCLASS.Size = new Size(46, 17);
+ CustomLabelCLASS.TabIndex = 17;
+ CustomLabelCLASS.Text = "CLASS:";
//
// CustomTextBoxCLASS
//
- this.CustomTextBoxCLASS.AcceptsReturn = false;
- this.CustomTextBoxCLASS.AcceptsTab = false;
- this.CustomTextBoxCLASS.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxCLASS.Border = true;
- this.CustomTextBoxCLASS.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxCLASS.BorderSize = 1;
- this.CustomTextBoxCLASS.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxCLASS.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxCLASS.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxCLASS.HideSelection = true;
- this.CustomTextBoxCLASS.Location = new System.Drawing.Point(182, 128);
- this.CustomTextBoxCLASS.MaxLength = 32767;
- this.CustomTextBoxCLASS.Multiline = false;
- this.CustomTextBoxCLASS.Name = "CustomTextBoxCLASS";
- this.CustomTextBoxCLASS.ReadOnly = false;
- this.CustomTextBoxCLASS.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxCLASS.ShortcutsEnabled = true;
- this.CustomTextBoxCLASS.Size = new System.Drawing.Size(50, 23);
- this.CustomTextBoxCLASS.TabIndex = 0;
- this.CustomTextBoxCLASS.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxCLASS.Texts = "IN";
- this.CustomTextBoxCLASS.UnderlinedStyle = true;
- this.CustomTextBoxCLASS.UsePasswordChar = false;
- this.CustomTextBoxCLASS.WordWrap = true;
+ CustomTextBoxCLASS.AcceptsReturn = false;
+ CustomTextBoxCLASS.AcceptsTab = false;
+ CustomTextBoxCLASS.BackColor = Color.DimGray;
+ CustomTextBoxCLASS.Border = true;
+ CustomTextBoxCLASS.BorderColor = Color.Blue;
+ CustomTextBoxCLASS.BorderSize = 1;
+ CustomTextBoxCLASS.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxCLASS.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxCLASS.ForeColor = Color.White;
+ CustomTextBoxCLASS.HideSelection = true;
+ CustomTextBoxCLASS.Location = new Point(182, 128);
+ CustomTextBoxCLASS.MaxLength = 32767;
+ CustomTextBoxCLASS.Multiline = false;
+ CustomTextBoxCLASS.Name = "CustomTextBoxCLASS";
+ CustomTextBoxCLASS.ReadOnly = false;
+ CustomTextBoxCLASS.ScrollBars = ScrollBars.None;
+ CustomTextBoxCLASS.ShortcutsEnabled = true;
+ CustomTextBoxCLASS.Size = new Size(50, 23);
+ CustomTextBoxCLASS.TabIndex = 0;
+ CustomTextBoxCLASS.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxCLASS.Texts = "IN";
+ CustomTextBoxCLASS.UnderlinedStyle = true;
+ CustomTextBoxCLASS.UsePasswordChar = false;
+ CustomTextBoxCLASS.WordWrap = true;
//
// CustomCheckBoxDNSSEC
//
- this.CustomCheckBoxDNSSEC.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDNSSEC.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDNSSEC.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDNSSEC.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDNSSEC.Location = new System.Drawing.Point(12, 100);
- this.CustomCheckBoxDNSSEC.Name = "CustomCheckBoxDNSSEC";
- this.CustomCheckBoxDNSSEC.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDNSSEC.Size = new System.Drawing.Size(65, 17);
- this.CustomCheckBoxDNSSEC.TabIndex = 19;
- this.CustomCheckBoxDNSSEC.Text = "DNSSEC";
- this.CustomCheckBoxDNSSEC.UseVisualStyleBackColor = false;
+ CustomCheckBoxDNSSEC.BackColor = Color.DimGray;
+ CustomCheckBoxDNSSEC.BorderColor = Color.Blue;
+ CustomCheckBoxDNSSEC.CheckColor = Color.Blue;
+ CustomCheckBoxDNSSEC.ForeColor = Color.White;
+ CustomCheckBoxDNSSEC.Location = new Point(12, 100);
+ CustomCheckBoxDNSSEC.Name = "CustomCheckBoxDNSSEC";
+ CustomCheckBoxDNSSEC.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDNSSEC.Size = new Size(65, 17);
+ CustomCheckBoxDNSSEC.TabIndex = 19;
+ CustomCheckBoxDNSSEC.Text = "DNSSEC";
+ CustomCheckBoxDNSSEC.UseVisualStyleBackColor = false;
//
// CustomLabelSUBNET
//
- this.CustomLabelSUBNET.AutoSize = true;
- this.CustomLabelSUBNET.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSUBNET.Border = false;
- this.CustomLabelSUBNET.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSUBNET.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSUBNET.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSUBNET.Location = new System.Drawing.Point(249, 130);
- this.CustomLabelSUBNET.Name = "CustomLabelSUBNET";
- this.CustomLabelSUBNET.RoundedCorners = 0;
- this.CustomLabelSUBNET.Size = new System.Drawing.Size(54, 17);
- this.CustomLabelSUBNET.TabIndex = 20;
- this.CustomLabelSUBNET.Text = "SUBNET:";
+ CustomLabelSUBNET.AutoSize = true;
+ CustomLabelSUBNET.BackColor = Color.DimGray;
+ CustomLabelSUBNET.Border = false;
+ CustomLabelSUBNET.BorderColor = Color.Blue;
+ CustomLabelSUBNET.FlatStyle = FlatStyle.Flat;
+ CustomLabelSUBNET.ForeColor = Color.White;
+ CustomLabelSUBNET.Location = new Point(249, 130);
+ CustomLabelSUBNET.Name = "CustomLabelSUBNET";
+ CustomLabelSUBNET.RoundedCorners = 0;
+ CustomLabelSUBNET.Size = new Size(54, 17);
+ CustomLabelSUBNET.TabIndex = 20;
+ CustomLabelSUBNET.Text = "SUBNET:";
//
// CustomTextBoxSUBNET
//
- this.CustomTextBoxSUBNET.AcceptsReturn = false;
- this.CustomTextBoxSUBNET.AcceptsTab = false;
- this.CustomTextBoxSUBNET.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSUBNET.Border = true;
- this.CustomTextBoxSUBNET.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSUBNET.BorderSize = 1;
- this.CustomTextBoxSUBNET.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSUBNET.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSUBNET.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSUBNET.HideSelection = true;
- this.CustomTextBoxSUBNET.Location = new System.Drawing.Point(309, 128);
- this.CustomTextBoxSUBNET.MaxLength = 32767;
- this.CustomTextBoxSUBNET.Multiline = false;
- this.CustomTextBoxSUBNET.Name = "CustomTextBoxSUBNET";
- this.CustomTextBoxSUBNET.ReadOnly = false;
- this.CustomTextBoxSUBNET.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSUBNET.ShortcutsEnabled = true;
- this.CustomTextBoxSUBNET.Size = new System.Drawing.Size(100, 23);
- this.CustomTextBoxSUBNET.TabIndex = 0;
- this.CustomTextBoxSUBNET.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSUBNET.Texts = "";
- this.CustomTextBoxSUBNET.UnderlinedStyle = true;
- this.CustomTextBoxSUBNET.UsePasswordChar = false;
- this.CustomTextBoxSUBNET.WordWrap = true;
+ CustomTextBoxSUBNET.AcceptsReturn = false;
+ CustomTextBoxSUBNET.AcceptsTab = false;
+ CustomTextBoxSUBNET.BackColor = Color.DimGray;
+ CustomTextBoxSUBNET.Border = true;
+ CustomTextBoxSUBNET.BorderColor = Color.Blue;
+ CustomTextBoxSUBNET.BorderSize = 1;
+ CustomTextBoxSUBNET.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSUBNET.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSUBNET.ForeColor = Color.White;
+ CustomTextBoxSUBNET.HideSelection = true;
+ CustomTextBoxSUBNET.Location = new Point(309, 128);
+ CustomTextBoxSUBNET.MaxLength = 32767;
+ CustomTextBoxSUBNET.Multiline = false;
+ CustomTextBoxSUBNET.Name = "CustomTextBoxSUBNET";
+ CustomTextBoxSUBNET.ReadOnly = false;
+ CustomTextBoxSUBNET.ScrollBars = ScrollBars.None;
+ CustomTextBoxSUBNET.ShortcutsEnabled = true;
+ CustomTextBoxSUBNET.Size = new Size(100, 23);
+ CustomTextBoxSUBNET.TabIndex = 0;
+ CustomTextBoxSUBNET.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSUBNET.Texts = "";
+ CustomTextBoxSUBNET.UnderlinedStyle = true;
+ CustomTextBoxSUBNET.UsePasswordChar = false;
+ CustomTextBoxSUBNET.WordWrap = true;
//
// CustomCheckBoxPAD
//
- this.CustomCheckBoxPAD.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxPAD.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxPAD.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxPAD.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxPAD.Location = new System.Drawing.Point(83, 100);
- this.CustomCheckBoxPAD.Name = "CustomCheckBoxPAD";
- this.CustomCheckBoxPAD.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxPAD.Size = new System.Drawing.Size(132, 17);
- this.CustomCheckBoxPAD.TabIndex = 22;
- this.CustomCheckBoxPAD.Text = "Add EDNS0 Padding";
- this.CustomCheckBoxPAD.UseVisualStyleBackColor = false;
+ CustomCheckBoxPAD.BackColor = Color.DimGray;
+ CustomCheckBoxPAD.BorderColor = Color.Blue;
+ CustomCheckBoxPAD.CheckColor = Color.Blue;
+ CustomCheckBoxPAD.ForeColor = Color.White;
+ CustomCheckBoxPAD.Location = new Point(83, 100);
+ CustomCheckBoxPAD.Name = "CustomCheckBoxPAD";
+ CustomCheckBoxPAD.SelectionColor = Color.LightBlue;
+ CustomCheckBoxPAD.Size = new Size(132, 17);
+ CustomCheckBoxPAD.TabIndex = 22;
+ CustomCheckBoxPAD.Text = "Add EDNS0 Padding";
+ CustomCheckBoxPAD.UseVisualStyleBackColor = false;
//
// CustomCheckBoxVERBOSE
//
- this.CustomCheckBoxVERBOSE.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxVERBOSE.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxVERBOSE.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxVERBOSE.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxVERBOSE.Location = new System.Drawing.Point(221, 100);
- this.CustomCheckBoxVERBOSE.Name = "CustomCheckBoxVERBOSE";
- this.CustomCheckBoxVERBOSE.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxVERBOSE.Size = new System.Drawing.Size(113, 17);
- this.CustomCheckBoxVERBOSE.TabIndex = 23;
- this.CustomCheckBoxVERBOSE.Text = "Verbose Logging";
- this.CustomCheckBoxVERBOSE.UseVisualStyleBackColor = false;
+ CustomCheckBoxVERBOSE.BackColor = Color.DimGray;
+ CustomCheckBoxVERBOSE.BorderColor = Color.Blue;
+ CustomCheckBoxVERBOSE.CheckColor = Color.Blue;
+ CustomCheckBoxVERBOSE.ForeColor = Color.White;
+ CustomCheckBoxVERBOSE.Location = new Point(221, 100);
+ CustomCheckBoxVERBOSE.Name = "CustomCheckBoxVERBOSE";
+ CustomCheckBoxVERBOSE.SelectionColor = Color.LightBlue;
+ CustomCheckBoxVERBOSE.Size = new Size(113, 17);
+ CustomCheckBoxVERBOSE.TabIndex = 23;
+ CustomCheckBoxVERBOSE.Text = "Verbose Logging";
+ CustomCheckBoxVERBOSE.UseVisualStyleBackColor = false;
//
// CustomLabelEDNSOPT
//
- this.CustomLabelEDNSOPT.AutoSize = true;
- this.CustomLabelEDNSOPT.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelEDNSOPT.Border = false;
- this.CustomLabelEDNSOPT.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelEDNSOPT.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelEDNSOPT.ForeColor = System.Drawing.Color.White;
- this.CustomLabelEDNSOPT.Location = new System.Drawing.Point(12, 160);
- this.CustomLabelEDNSOPT.Name = "CustomLabelEDNSOPT";
- this.CustomLabelEDNSOPT.RoundedCorners = 0;
- this.CustomLabelEDNSOPT.Size = new System.Drawing.Size(82, 17);
- this.CustomLabelEDNSOPT.TabIndex = 24;
- this.CustomLabelEDNSOPT.Text = "Specify EDNS:";
+ CustomLabelEDNSOPT.AutoSize = true;
+ CustomLabelEDNSOPT.BackColor = Color.DimGray;
+ CustomLabelEDNSOPT.Border = false;
+ CustomLabelEDNSOPT.BorderColor = Color.Blue;
+ CustomLabelEDNSOPT.FlatStyle = FlatStyle.Flat;
+ CustomLabelEDNSOPT.ForeColor = Color.White;
+ CustomLabelEDNSOPT.Location = new Point(12, 160);
+ CustomLabelEDNSOPT.Name = "CustomLabelEDNSOPT";
+ CustomLabelEDNSOPT.RoundedCorners = 0;
+ CustomLabelEDNSOPT.Size = new Size(82, 17);
+ CustomLabelEDNSOPT.TabIndex = 24;
+ CustomLabelEDNSOPT.Text = "Specify EDNS:";
//
// CustomTextBoxEDNSOPT
//
- this.CustomTextBoxEDNSOPT.AcceptsReturn = false;
- this.CustomTextBoxEDNSOPT.AcceptsTab = false;
- this.CustomTextBoxEDNSOPT.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxEDNSOPT.Border = true;
- this.CustomTextBoxEDNSOPT.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxEDNSOPT.BorderSize = 1;
- this.CustomTextBoxEDNSOPT.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxEDNSOPT.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxEDNSOPT.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxEDNSOPT.HideSelection = true;
- this.CustomTextBoxEDNSOPT.Location = new System.Drawing.Point(100, 158);
- this.CustomTextBoxEDNSOPT.MaxLength = 32767;
- this.CustomTextBoxEDNSOPT.Multiline = false;
- this.CustomTextBoxEDNSOPT.Name = "CustomTextBoxEDNSOPT";
- this.CustomTextBoxEDNSOPT.ReadOnly = false;
- this.CustomTextBoxEDNSOPT.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxEDNSOPT.ShortcutsEnabled = true;
- this.CustomTextBoxEDNSOPT.Size = new System.Drawing.Size(200, 23);
- this.CustomTextBoxEDNSOPT.TabIndex = 0;
- this.CustomTextBoxEDNSOPT.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxEDNSOPT.Texts = "";
- this.CustomTextBoxEDNSOPT.UnderlinedStyle = true;
- this.CustomTextBoxEDNSOPT.UsePasswordChar = false;
- this.CustomTextBoxEDNSOPT.WordWrap = true;
+ CustomTextBoxEDNSOPT.AcceptsReturn = false;
+ CustomTextBoxEDNSOPT.AcceptsTab = false;
+ CustomTextBoxEDNSOPT.BackColor = Color.DimGray;
+ CustomTextBoxEDNSOPT.Border = true;
+ CustomTextBoxEDNSOPT.BorderColor = Color.Blue;
+ CustomTextBoxEDNSOPT.BorderSize = 1;
+ CustomTextBoxEDNSOPT.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxEDNSOPT.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxEDNSOPT.ForeColor = Color.White;
+ CustomTextBoxEDNSOPT.HideSelection = true;
+ CustomTextBoxEDNSOPT.Location = new Point(100, 158);
+ CustomTextBoxEDNSOPT.MaxLength = 32767;
+ CustomTextBoxEDNSOPT.Multiline = false;
+ CustomTextBoxEDNSOPT.Name = "CustomTextBoxEDNSOPT";
+ CustomTextBoxEDNSOPT.ReadOnly = false;
+ CustomTextBoxEDNSOPT.ScrollBars = ScrollBars.None;
+ CustomTextBoxEDNSOPT.ShortcutsEnabled = true;
+ CustomTextBoxEDNSOPT.Size = new Size(200, 23);
+ CustomTextBoxEDNSOPT.TabIndex = 0;
+ CustomTextBoxEDNSOPT.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxEDNSOPT.Texts = "";
+ CustomTextBoxEDNSOPT.UnderlinedStyle = true;
+ CustomTextBoxEDNSOPT.UsePasswordChar = false;
+ CustomTextBoxEDNSOPT.WordWrap = true;
//
// CustomButtonDefault
//
- this.CustomButtonDefault.AutoSize = true;
- this.CustomButtonDefault.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDefault.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDefault.Location = new System.Drawing.Point(370, 12);
- this.CustomButtonDefault.Name = "CustomButtonDefault";
- this.CustomButtonDefault.RoundedCorners = 5;
- this.CustomButtonDefault.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDefault.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonDefault.TabIndex = 26;
- this.CustomButtonDefault.Text = "Default";
- this.CustomButtonDefault.UseVisualStyleBackColor = true;
- this.CustomButtonDefault.Click += new System.EventHandler(this.CustomButtonDefault_Click);
+ CustomButtonDefault.AutoSize = true;
+ CustomButtonDefault.BorderColor = Color.Blue;
+ CustomButtonDefault.FlatStyle = FlatStyle.Flat;
+ CustomButtonDefault.Location = new Point(370, 12);
+ CustomButtonDefault.Name = "CustomButtonDefault";
+ CustomButtonDefault.RoundedCorners = 5;
+ CustomButtonDefault.SelectionColor = Color.LightBlue;
+ CustomButtonDefault.Size = new Size(75, 27);
+ CustomButtonDefault.TabIndex = 26;
+ CustomButtonDefault.Text = "Default";
+ CustomButtonDefault.UseVisualStyleBackColor = true;
+ CustomButtonDefault.Click += CustomButtonDefault_Click;
//
// CustomCheckBoxJSON
//
- this.CustomCheckBoxJSON.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxJSON.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxJSON.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxJSON.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxJSON.Location = new System.Drawing.Point(340, 100);
- this.CustomCheckBoxJSON.Name = "CustomCheckBoxJSON";
- this.CustomCheckBoxJSON.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxJSON.Size = new System.Drawing.Size(44, 17);
- this.CustomCheckBoxJSON.TabIndex = 34;
- this.CustomCheckBoxJSON.Text = "Json";
- this.CustomCheckBoxJSON.UseVisualStyleBackColor = false;
+ CustomCheckBoxJSON.BackColor = Color.DimGray;
+ CustomCheckBoxJSON.BorderColor = Color.Blue;
+ CustomCheckBoxJSON.CheckColor = Color.Blue;
+ CustomCheckBoxJSON.ForeColor = Color.White;
+ CustomCheckBoxJSON.Location = new Point(340, 100);
+ CustomCheckBoxJSON.Name = "CustomCheckBoxJSON";
+ CustomCheckBoxJSON.SelectionColor = Color.LightBlue;
+ CustomCheckBoxJSON.Size = new Size(44, 17);
+ CustomCheckBoxJSON.TabIndex = 34;
+ CustomCheckBoxJSON.Text = "Json";
+ CustomCheckBoxJSON.UseVisualStyleBackColor = false;
//
// FormDnsLookup
//
- this.AcceptButton = this.CustomButtonLookup;
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.DimGray;
- this.ClientSize = new System.Drawing.Size(459, 461);
- this.Controls.Add(this.CustomCheckBoxJSON);
- this.Controls.Add(this.CustomButtonDefault);
- this.Controls.Add(this.CustomTextBoxEDNSOPT);
- this.Controls.Add(this.CustomLabelEDNSOPT);
- this.Controls.Add(this.CustomCheckBoxVERBOSE);
- this.Controls.Add(this.CustomCheckBoxPAD);
- this.Controls.Add(this.CustomTextBoxSUBNET);
- this.Controls.Add(this.CustomLabelSUBNET);
- this.Controls.Add(this.CustomCheckBoxDNSSEC);
- this.Controls.Add(this.CustomTextBoxCLASS);
- this.Controls.Add(this.CustomLabelCLASS);
- this.Controls.Add(this.CustomTextBoxRRTYPE);
- this.Controls.Add(this.CustomLabelRRTYPE);
- this.Controls.Add(this.CustomCheckBoxVERIFY);
- this.Controls.Add(this.CustomCheckBoxHTTP3);
- this.Controls.Add(this.CustomTextBoxResult);
- this.Controls.Add(this.CustomButtonLookup);
- this.Controls.Add(this.CustomTextBoxDomain);
- this.Controls.Add(this.CustomLabelDomain);
- this.Controls.Add(this.CustomTextBoxSourceCustom);
- this.Controls.Add(this.CustomRadioButtonSourceCustom);
- this.Controls.Add(this.CustomRadioButtonSourceSDC);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MaximizeBox = false;
- this.MaximumSize = new System.Drawing.Size(475, 500);
- this.MinimumSize = new System.Drawing.Size(475, 500);
- this.Name = "FormDnsLookup";
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.Text = "DNS Lookup";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormDnsLookup_FormClosing);
- this.ResumeLayout(false);
- this.PerformLayout();
-
+ AcceptButton = CustomButtonLookup;
+ AutoScaleMode = AutoScaleMode.None;
+ BackColor = Color.DimGray;
+ ClientSize = new Size(459, 461);
+ Controls.Add(CustomCheckBoxJSON);
+ Controls.Add(CustomButtonDefault);
+ Controls.Add(CustomTextBoxEDNSOPT);
+ Controls.Add(CustomLabelEDNSOPT);
+ Controls.Add(CustomCheckBoxVERBOSE);
+ Controls.Add(CustomCheckBoxPAD);
+ Controls.Add(CustomTextBoxSUBNET);
+ Controls.Add(CustomLabelSUBNET);
+ Controls.Add(CustomCheckBoxDNSSEC);
+ Controls.Add(CustomTextBoxCLASS);
+ Controls.Add(CustomLabelCLASS);
+ Controls.Add(CustomTextBoxRRTYPE);
+ Controls.Add(CustomLabelRRTYPE);
+ Controls.Add(CustomCheckBoxVERIFY);
+ Controls.Add(CustomCheckBoxHTTP3);
+ Controls.Add(CustomTextBoxResult);
+ Controls.Add(CustomButtonLookup);
+ Controls.Add(CustomTextBoxDomain);
+ Controls.Add(CustomLabelDomain);
+ Controls.Add(CustomTextBoxSourceCustom);
+ Controls.Add(CustomRadioButtonSourceCustom);
+ Controls.Add(CustomRadioButtonSourceSDC);
+ FormBorderStyle = FormBorderStyle.FixedSingle;
+ Icon = (Icon)resources.GetObject("$this.Icon");
+ MaximizeBox = false;
+ MaximumSize = new Size(475, 500);
+ MinimumSize = new Size(475, 500);
+ Name = "FormDnsLookup";
+ SizeGripStyle = SizeGripStyle.Hide;
+ Text = "DNS Lookup";
+ FormClosing += FormDnsLookup_FormClosing;
+ ResumeLayout(false);
+ PerformLayout();
}
#endregion
diff --git a/SecureDNSClient/Forms/FormDnsLookup.cs b/SecureDNSClient/Forms/FormDnsLookup.cs
index 686eb69..6da8e14 100644
--- a/SecureDNSClient/Forms/FormDnsLookup.cs
+++ b/SecureDNSClient/Forms/FormDnsLookup.cs
@@ -1,6 +1,7 @@
using CustomControls;
-using MsmhTools;
-using MsmhTools.Themes;
+using MsmhToolsClass;
+using MsmhToolsWinFormsClass;
+using MsmhToolsWinFormsClass.Themes;
using System.Diagnostics;
using System.Net;
@@ -16,7 +17,10 @@ public partial class FormDnsLookup : Form
public FormDnsLookup()
{
+ // Fix Screed DPI
+ ScreenDPI.FixDpiBeforeInitializeComponent(this);
InitializeComponent();
+ ScreenDPI.FixDpiAfterInitializeComponent(this);
// Load Theme
Theme.LoadTheme(this, Theme.Themes.Dark);
@@ -32,7 +36,7 @@ public FormDnsLookup()
CustomLabelEDNSOPT.SetToolTip("Info", ednsopt);
// Initialize and load Settings
- if (File.Exists(SettingsXmlPath) && Xml.IsValidXMLFile(SettingsXmlPath))
+ if (File.Exists(SettingsXmlPath) && XmlTool.IsValidXMLFile(SettingsXmlPath))
AppSettings = new(this, SettingsXmlPath);
else
AppSettings = new(this);
@@ -67,7 +71,7 @@ private async void CustomButtonLookup_Click(object sender, EventArgs e)
CustomTextBoxResult.Text = "Binary is missing.";
return;
}
-
+
string dns = $"{IPAddress.Loopback}:53";
if (CustomRadioButtonSourceCustom.Checked)
dns = CustomTextBoxSourceCustom.Text;
@@ -175,7 +179,7 @@ await Task.Run(() =>
stdout = process.StandardOutput.ReadToEnd().ReplaceLineEndings(Environment.NewLine);
errout = process.StandardError.ReadToEnd().ReplaceLineEndings(Environment.NewLine);
});
-
+
result = stdout + Environment.NewLine + errout;
string resultOut = string.Empty;
diff --git a/SecureDNSClient/Forms/FormDnsLookup.resx b/SecureDNSClient/Forms/FormDnsLookup.resx
index f852953..6e5de1e 100644
--- a/SecureDNSClient/Forms/FormDnsLookup.resx
+++ b/SecureDNSClient/Forms/FormDnsLookup.resx
@@ -1,4 +1,64 @@
-
+
+
+
diff --git a/SecureDNSClient/Forms/FormIpScanner.Designer.cs b/SecureDNSClient/Forms/FormIpScanner.Designer.cs
index 385c6f5..8919fa6 100644
--- a/SecureDNSClient/Forms/FormIpScanner.Designer.cs
+++ b/SecureDNSClient/Forms/FormIpScanner.Designer.cs
@@ -28,384 +28,341 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+ DataGridViewCellStyle dataGridViewCellStyle1 = new DataGridViewCellStyle();
+ DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormIpScanner));
- this.CustomRadioButtonSourceCloudflare = new CustomControls.CustomRadioButton();
- this.CustomLabelDelay = new CustomControls.CustomLabel();
- this.CustomNumericUpDownDelay = new CustomControls.CustomNumericUpDown();
- this.CustomButtonStartStop = new CustomControls.CustomButton();
- this.CustomDataGridViewResult = new CustomControls.CustomDataGridView();
- this.RealDelay = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.TCPDelay = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.PingDelay = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.CleanIP = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.CustomLabelChecking = new CustomControls.CustomLabel();
- this.CustomContextMenuStripMain = new CustomControls.CustomContextMenuStrip();
- this.CustomLabelCheckWebsite = new CustomControls.CustomLabel();
- this.CustomTextBoxCheckWebsite = new CustomControls.CustomTextBox();
- this.CustomLabelProxyPort = new CustomControls.CustomLabel();
- this.CustomNumericUpDownProxyPort = new CustomControls.CustomNumericUpDown();
- this.CustomCheckBoxRandomScan = new CustomControls.CustomCheckBox();
- this.CustomLabelCheckIpWithThisPort = new CustomControls.CustomLabel();
- this.CustomNumericUpDownCheckIpWithThisPort = new CustomControls.CustomNumericUpDown();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDelay)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomDataGridViewResult)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownProxyPort)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownCheckIpWithThisPort)).BeginInit();
- this.SuspendLayout();
+ CustomRadioButtonSourceCloudflare = new CustomControls.CustomRadioButton();
+ CustomLabelDelay = new CustomControls.CustomLabel();
+ CustomNumericUpDownDelay = new CustomControls.CustomNumericUpDown();
+ CustomButtonStartStop = new CustomControls.CustomButton();
+ CustomDataGridViewResult = new CustomControls.CustomDataGridView();
+ RealDelay = new DataGridViewTextBoxColumn();
+ TCPDelay = new DataGridViewTextBoxColumn();
+ PingDelay = new DataGridViewTextBoxColumn();
+ CleanIP = new DataGridViewTextBoxColumn();
+ CustomLabelChecking = new CustomControls.CustomLabel();
+ CustomContextMenuStripMain = new CustomControls.CustomContextMenuStrip();
+ CustomLabelCheckWebsite = new CustomControls.CustomLabel();
+ CustomTextBoxCheckWebsite = new CustomControls.CustomTextBox();
+ CustomLabelProxyPort = new CustomControls.CustomLabel();
+ CustomNumericUpDownProxyPort = new CustomControls.CustomNumericUpDown();
+ CustomCheckBoxRandomScan = new CustomControls.CustomCheckBox();
+ CustomLabelCheckIpWithThisPort = new CustomControls.CustomLabel();
+ CustomNumericUpDownCheckIpWithThisPort = new CustomControls.CustomNumericUpDown();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDelay).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomDataGridViewResult).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownProxyPort).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownCheckIpWithThisPort).BeginInit();
+ SuspendLayout();
//
// CustomRadioButtonSourceCloudflare
//
- this.CustomRadioButtonSourceCloudflare.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSourceCloudflare.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSourceCloudflare.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSourceCloudflare.Checked = true;
- this.CustomRadioButtonSourceCloudflare.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSourceCloudflare.Location = new System.Drawing.Point(12, 10);
- this.CustomRadioButtonSourceCloudflare.Name = "CustomRadioButtonSourceCloudflare";
- this.CustomRadioButtonSourceCloudflare.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSourceCloudflare.Size = new System.Drawing.Size(77, 17);
- this.CustomRadioButtonSourceCloudflare.TabIndex = 0;
- this.CustomRadioButtonSourceCloudflare.TabStop = true;
- this.CustomRadioButtonSourceCloudflare.Text = "Cloudflare";
- this.CustomRadioButtonSourceCloudflare.UseVisualStyleBackColor = false;
+ CustomRadioButtonSourceCloudflare.BackColor = Color.DimGray;
+ CustomRadioButtonSourceCloudflare.BorderColor = Color.Blue;
+ CustomRadioButtonSourceCloudflare.CheckColor = Color.Blue;
+ CustomRadioButtonSourceCloudflare.Checked = true;
+ CustomRadioButtonSourceCloudflare.ForeColor = Color.White;
+ CustomRadioButtonSourceCloudflare.Location = new Point(12, 10);
+ CustomRadioButtonSourceCloudflare.Name = "CustomRadioButtonSourceCloudflare";
+ CustomRadioButtonSourceCloudflare.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSourceCloudflare.Size = new Size(77, 17);
+ CustomRadioButtonSourceCloudflare.TabIndex = 0;
+ CustomRadioButtonSourceCloudflare.TabStop = true;
+ CustomRadioButtonSourceCloudflare.Text = "Cloudflare";
+ CustomRadioButtonSourceCloudflare.UseVisualStyleBackColor = false;
//
// CustomLabelDelay
//
- this.CustomLabelDelay.AutoSize = true;
- this.CustomLabelDelay.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelDelay.Border = false;
- this.CustomLabelDelay.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelDelay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelDelay.ForeColor = System.Drawing.Color.White;
- this.CustomLabelDelay.Location = new System.Drawing.Point(105, 10);
- this.CustomLabelDelay.Name = "CustomLabelDelay";
- this.CustomLabelDelay.RoundedCorners = 0;
- this.CustomLabelDelay.Size = new System.Drawing.Size(95, 17);
- this.CustomLabelDelay.TabIndex = 1;
- this.CustomLabelDelay.Text = "Real Delay (Sec):";
+ CustomLabelDelay.AutoSize = true;
+ CustomLabelDelay.BackColor = Color.DimGray;
+ CustomLabelDelay.Border = false;
+ CustomLabelDelay.BorderColor = Color.Blue;
+ CustomLabelDelay.FlatStyle = FlatStyle.Flat;
+ CustomLabelDelay.ForeColor = Color.White;
+ CustomLabelDelay.Location = new Point(105, 10);
+ CustomLabelDelay.Name = "CustomLabelDelay";
+ CustomLabelDelay.RoundedCorners = 0;
+ CustomLabelDelay.Size = new Size(95, 17);
+ CustomLabelDelay.TabIndex = 1;
+ CustomLabelDelay.Text = "Real Delay (Sec):";
//
// CustomNumericUpDownDelay
//
- this.CustomNumericUpDownDelay.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDelay.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDelay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDelay.Location = new System.Drawing.Point(206, 8);
- this.CustomNumericUpDownDelay.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDelay.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDelay.Name = "CustomNumericUpDownDelay";
- this.CustomNumericUpDownDelay.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownDelay.TabIndex = 2;
- this.CustomNumericUpDownDelay.Value = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDelay.BackColor = Color.DimGray;
+ CustomNumericUpDownDelay.BorderColor = Color.Blue;
+ CustomNumericUpDownDelay.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDelay.Location = new Point(206, 8);
+ CustomNumericUpDownDelay.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
+ CustomNumericUpDownDelay.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownDelay.Name = "CustomNumericUpDownDelay";
+ CustomNumericUpDownDelay.Size = new Size(45, 23);
+ CustomNumericUpDownDelay.TabIndex = 2;
+ CustomNumericUpDownDelay.Value = new decimal(new int[] { 2, 0, 0, 0 });
//
// CustomButtonStartStop
//
- this.CustomButtonStartStop.AutoSize = true;
- this.CustomButtonStartStop.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonStartStop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonStartStop.Location = new System.Drawing.Point(276, 8);
- this.CustomButtonStartStop.Name = "CustomButtonStartStop";
- this.CustomButtonStartStop.RoundedCorners = 5;
- this.CustomButtonStartStop.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonStartStop.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonStartStop.TabIndex = 3;
- this.CustomButtonStartStop.Text = "Start/Stop";
- this.CustomButtonStartStop.UseVisualStyleBackColor = true;
- this.CustomButtonStartStop.Click += new System.EventHandler(this.CustomButtonStartStop_Click);
+ CustomButtonStartStop.AutoSize = true;
+ CustomButtonStartStop.BorderColor = Color.Blue;
+ CustomButtonStartStop.FlatStyle = FlatStyle.Flat;
+ CustomButtonStartStop.Location = new Point(276, 8);
+ CustomButtonStartStop.Name = "CustomButtonStartStop";
+ CustomButtonStartStop.RoundedCorners = 5;
+ CustomButtonStartStop.SelectionColor = Color.LightBlue;
+ CustomButtonStartStop.Size = new Size(75, 27);
+ CustomButtonStartStop.TabIndex = 3;
+ CustomButtonStartStop.Text = "Start/Stop";
+ CustomButtonStartStop.UseVisualStyleBackColor = true;
+ CustomButtonStartStop.Click += CustomButtonStartStop_Click;
//
// CustomDataGridViewResult
//
- this.CustomDataGridViewResult.AllowUserToAddRows = false;
- this.CustomDataGridViewResult.AllowUserToDeleteRows = false;
- this.CustomDataGridViewResult.AllowUserToResizeRows = false;
- this.CustomDataGridViewResult.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomDataGridViewResult.BorderColor = System.Drawing.Color.Blue;
- this.CustomDataGridViewResult.CheckColor = System.Drawing.Color.Blue;
- this.CustomDataGridViewResult.ColumnHeadersBorder = true;
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(73)))), ((int)(((byte)(73)))));
- dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White;
- dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(73)))), ((int)(((byte)(73)))), ((int)(((byte)(73)))));
- dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.White;
- dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.CustomDataGridViewResult.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
- this.CustomDataGridViewResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.CustomDataGridViewResult.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.RealDelay,
- this.TCPDelay,
- this.PingDelay,
- this.CleanIP});
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle2.BackColor = System.Drawing.Color.DimGray;
- dataGridViewCellStyle2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(97)))), ((int)(((byte)(177)))), ((int)(((byte)(255)))));
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.White;
- dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.CustomDataGridViewResult.DefaultCellStyle = dataGridViewCellStyle2;
- this.CustomDataGridViewResult.GridColor = System.Drawing.Color.LightBlue;
- this.CustomDataGridViewResult.Location = new System.Drawing.Point(12, 170);
- this.CustomDataGridViewResult.MultiSelect = false;
- this.CustomDataGridViewResult.Name = "CustomDataGridViewResult";
- this.CustomDataGridViewResult.ReadOnly = true;
- this.CustomDataGridViewResult.RowHeadersVisible = false;
- this.CustomDataGridViewResult.RowTemplate.Height = 25;
- this.CustomDataGridViewResult.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.CustomDataGridViewResult.SelectionColor = System.Drawing.Color.DodgerBlue;
- this.CustomDataGridViewResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.CustomDataGridViewResult.SelectionModeFocus = false;
- this.CustomDataGridViewResult.ShowCellErrors = false;
- this.CustomDataGridViewResult.ShowEditingIcon = false;
- this.CustomDataGridViewResult.ShowRowErrors = false;
- this.CustomDataGridViewResult.Size = new System.Drawing.Size(360, 229);
- this.CustomDataGridViewResult.TabIndex = 7;
- this.CustomDataGridViewResult.MouseClick += new System.Windows.Forms.MouseEventHandler(this.CustomDataGridViewResult_MouseClick);
+ CustomDataGridViewResult.AllowUserToAddRows = false;
+ CustomDataGridViewResult.AllowUserToDeleteRows = false;
+ CustomDataGridViewResult.AllowUserToResizeRows = false;
+ CustomDataGridViewResult.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ CustomDataGridViewResult.BorderColor = Color.Blue;
+ CustomDataGridViewResult.CheckColor = Color.Blue;
+ CustomDataGridViewResult.ColumnHeadersBorder = true;
+ dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle1.BackColor = Color.FromArgb(73, 73, 73);
+ dataGridViewCellStyle1.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ dataGridViewCellStyle1.ForeColor = Color.White;
+ dataGridViewCellStyle1.SelectionBackColor = Color.FromArgb(73, 73, 73);
+ dataGridViewCellStyle1.SelectionForeColor = Color.White;
+ dataGridViewCellStyle1.WrapMode = DataGridViewTriState.True;
+ CustomDataGridViewResult.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
+ CustomDataGridViewResult.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ CustomDataGridViewResult.Columns.AddRange(new DataGridViewColumn[] { RealDelay, TCPDelay, PingDelay, CleanIP });
+ dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle2.BackColor = Color.DimGray;
+ dataGridViewCellStyle2.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ dataGridViewCellStyle2.ForeColor = Color.White;
+ dataGridViewCellStyle2.SelectionBackColor = Color.FromArgb(97, 177, 255);
+ dataGridViewCellStyle2.SelectionForeColor = Color.White;
+ dataGridViewCellStyle2.WrapMode = DataGridViewTriState.False;
+ CustomDataGridViewResult.DefaultCellStyle = dataGridViewCellStyle2;
+ CustomDataGridViewResult.GridColor = Color.LightBlue;
+ CustomDataGridViewResult.Location = new Point(12, 170);
+ CustomDataGridViewResult.MultiSelect = false;
+ CustomDataGridViewResult.Name = "CustomDataGridViewResult";
+ CustomDataGridViewResult.ReadOnly = true;
+ CustomDataGridViewResult.RowHeadersVisible = false;
+ CustomDataGridViewResult.RowTemplate.Height = 25;
+ CustomDataGridViewResult.ScrollBars = ScrollBars.Vertical;
+ CustomDataGridViewResult.SelectionColor = Color.DodgerBlue;
+ CustomDataGridViewResult.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
+ CustomDataGridViewResult.SelectionModeFocus = false;
+ CustomDataGridViewResult.ShowCellErrors = false;
+ CustomDataGridViewResult.ShowEditingIcon = false;
+ CustomDataGridViewResult.ShowRowErrors = false;
+ CustomDataGridViewResult.Size = new Size(360, 229);
+ CustomDataGridViewResult.TabIndex = 7;
+ CustomDataGridViewResult.MouseClick += CustomDataGridViewResult_MouseClick;
//
// RealDelay
//
- this.RealDelay.HeaderText = "Real Delay";
- this.RealDelay.MinimumWidth = 60;
- this.RealDelay.Name = "RealDelay";
- this.RealDelay.ReadOnly = true;
- this.RealDelay.Resizable = System.Windows.Forms.DataGridViewTriState.False;
- this.RealDelay.Width = 60;
+ RealDelay.HeaderText = "Real Delay";
+ RealDelay.MinimumWidth = 60;
+ RealDelay.Name = "RealDelay";
+ RealDelay.ReadOnly = true;
+ RealDelay.Resizable = DataGridViewTriState.False;
+ RealDelay.Width = 60;
//
// TCPDelay
//
- this.TCPDelay.HeaderText = "TCP Delay";
- this.TCPDelay.MinimumWidth = 60;
- this.TCPDelay.Name = "TCPDelay";
- this.TCPDelay.ReadOnly = true;
- this.TCPDelay.Resizable = System.Windows.Forms.DataGridViewTriState.False;
- this.TCPDelay.Width = 60;
+ TCPDelay.HeaderText = "TCP Delay";
+ TCPDelay.MinimumWidth = 60;
+ TCPDelay.Name = "TCPDelay";
+ TCPDelay.ReadOnly = true;
+ TCPDelay.Resizable = DataGridViewTriState.False;
+ TCPDelay.Width = 60;
//
// PingDelay
//
- this.PingDelay.HeaderText = "Ping Delay";
- this.PingDelay.MinimumWidth = 60;
- this.PingDelay.Name = "PingDelay";
- this.PingDelay.ReadOnly = true;
- this.PingDelay.Resizable = System.Windows.Forms.DataGridViewTriState.False;
- this.PingDelay.Width = 60;
+ PingDelay.HeaderText = "Ping Delay";
+ PingDelay.MinimumWidth = 60;
+ PingDelay.Name = "PingDelay";
+ PingDelay.ReadOnly = true;
+ PingDelay.Resizable = DataGridViewTriState.False;
+ PingDelay.Width = 60;
//
// CleanIP
//
- this.CleanIP.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.CleanIP.HeaderText = "Clean IP";
- this.CleanIP.Name = "CleanIP";
- this.CleanIP.ReadOnly = true;
+ CleanIP.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
+ CleanIP.HeaderText = "Clean IP";
+ CleanIP.Name = "CleanIP";
+ CleanIP.ReadOnly = true;
//
// CustomLabelChecking
//
- this.CustomLabelChecking.AutoSize = true;
- this.CustomLabelChecking.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelChecking.Border = false;
- this.CustomLabelChecking.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelChecking.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelChecking.ForeColor = System.Drawing.Color.White;
- this.CustomLabelChecking.Location = new System.Drawing.Point(12, 150);
- this.CustomLabelChecking.Name = "CustomLabelChecking";
- this.CustomLabelChecking.RoundedCorners = 0;
- this.CustomLabelChecking.Size = new System.Drawing.Size(146, 17);
- this.CustomLabelChecking.TabIndex = 8;
- this.CustomLabelChecking.Text = "Checking: 255.255.255.255";
+ CustomLabelChecking.AutoSize = true;
+ CustomLabelChecking.BackColor = Color.DimGray;
+ CustomLabelChecking.Border = false;
+ CustomLabelChecking.BorderColor = Color.Blue;
+ CustomLabelChecking.FlatStyle = FlatStyle.Flat;
+ CustomLabelChecking.ForeColor = Color.White;
+ CustomLabelChecking.Location = new Point(12, 150);
+ CustomLabelChecking.Name = "CustomLabelChecking";
+ CustomLabelChecking.RoundedCorners = 0;
+ CustomLabelChecking.Size = new Size(146, 17);
+ CustomLabelChecking.TabIndex = 8;
+ CustomLabelChecking.Text = "Checking: 255.255.255.255";
//
// CustomContextMenuStripMain
//
- this.CustomContextMenuStripMain.BackColor = System.Drawing.Color.DimGray;
- this.CustomContextMenuStripMain.BorderColor = System.Drawing.Color.Blue;
- this.CustomContextMenuStripMain.ForeColor = System.Drawing.Color.White;
- this.CustomContextMenuStripMain.Name = "CustomContextMenuStripMain";
- this.CustomContextMenuStripMain.SameColorForSubItems = true;
- this.CustomContextMenuStripMain.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomContextMenuStripMain.Size = new System.Drawing.Size(61, 4);
+ CustomContextMenuStripMain.BackColor = Color.DimGray;
+ CustomContextMenuStripMain.BorderColor = Color.Blue;
+ CustomContextMenuStripMain.ForeColor = Color.White;
+ CustomContextMenuStripMain.Name = "CustomContextMenuStripMain";
+ CustomContextMenuStripMain.SameColorForSubItems = true;
+ CustomContextMenuStripMain.SelectionColor = Color.LightBlue;
+ CustomContextMenuStripMain.Size = new Size(61, 4);
//
// CustomLabelCheckWebsite
//
- this.CustomLabelCheckWebsite.AutoSize = true;
- this.CustomLabelCheckWebsite.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelCheckWebsite.Border = false;
- this.CustomLabelCheckWebsite.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelCheckWebsite.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelCheckWebsite.ForeColor = System.Drawing.Color.White;
- this.CustomLabelCheckWebsite.Location = new System.Drawing.Point(12, 45);
- this.CustomLabelCheckWebsite.Name = "CustomLabelCheckWebsite";
- this.CustomLabelCheckWebsite.RoundedCorners = 0;
- this.CustomLabelCheckWebsite.Size = new System.Drawing.Size(90, 17);
- this.CustomLabelCheckWebsite.TabIndex = 9;
- this.CustomLabelCheckWebsite.Text = "Check Website:";
+ CustomLabelCheckWebsite.AutoSize = true;
+ CustomLabelCheckWebsite.BackColor = Color.DimGray;
+ CustomLabelCheckWebsite.Border = false;
+ CustomLabelCheckWebsite.BorderColor = Color.Blue;
+ CustomLabelCheckWebsite.FlatStyle = FlatStyle.Flat;
+ CustomLabelCheckWebsite.ForeColor = Color.White;
+ CustomLabelCheckWebsite.Location = new Point(12, 45);
+ CustomLabelCheckWebsite.Name = "CustomLabelCheckWebsite";
+ CustomLabelCheckWebsite.RoundedCorners = 0;
+ CustomLabelCheckWebsite.Size = new Size(90, 17);
+ CustomLabelCheckWebsite.TabIndex = 9;
+ CustomLabelCheckWebsite.Text = "Check Website:";
//
// CustomTextBoxCheckWebsite
//
- this.CustomTextBoxCheckWebsite.AcceptsReturn = false;
- this.CustomTextBoxCheckWebsite.AcceptsTab = false;
- this.CustomTextBoxCheckWebsite.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxCheckWebsite.Border = true;
- this.CustomTextBoxCheckWebsite.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxCheckWebsite.BorderSize = 1;
- this.CustomTextBoxCheckWebsite.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxCheckWebsite.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxCheckWebsite.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxCheckWebsite.HideSelection = true;
- this.CustomTextBoxCheckWebsite.Location = new System.Drawing.Point(108, 43);
- this.CustomTextBoxCheckWebsite.MaxLength = 32767;
- this.CustomTextBoxCheckWebsite.Multiline = false;
- this.CustomTextBoxCheckWebsite.Name = "CustomTextBoxCheckWebsite";
- this.CustomTextBoxCheckWebsite.ReadOnly = false;
- this.CustomTextBoxCheckWebsite.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxCheckWebsite.ShortcutsEnabled = true;
- this.CustomTextBoxCheckWebsite.Size = new System.Drawing.Size(200, 23);
- this.CustomTextBoxCheckWebsite.TabIndex = 0;
- this.CustomTextBoxCheckWebsite.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxCheckWebsite.Texts = "https://www.cloudflare.com";
- this.CustomTextBoxCheckWebsite.UnderlinedStyle = true;
- this.CustomTextBoxCheckWebsite.UsePasswordChar = false;
- this.CustomTextBoxCheckWebsite.WordWrap = true;
+ CustomTextBoxCheckWebsite.AcceptsReturn = false;
+ CustomTextBoxCheckWebsite.AcceptsTab = false;
+ CustomTextBoxCheckWebsite.BackColor = Color.DimGray;
+ CustomTextBoxCheckWebsite.Border = true;
+ CustomTextBoxCheckWebsite.BorderColor = Color.Blue;
+ CustomTextBoxCheckWebsite.BorderSize = 1;
+ CustomTextBoxCheckWebsite.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxCheckWebsite.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxCheckWebsite.ForeColor = Color.White;
+ CustomTextBoxCheckWebsite.HideSelection = true;
+ CustomTextBoxCheckWebsite.Location = new Point(108, 43);
+ CustomTextBoxCheckWebsite.MaxLength = 32767;
+ CustomTextBoxCheckWebsite.Multiline = false;
+ CustomTextBoxCheckWebsite.Name = "CustomTextBoxCheckWebsite";
+ CustomTextBoxCheckWebsite.ReadOnly = false;
+ CustomTextBoxCheckWebsite.ScrollBars = ScrollBars.None;
+ CustomTextBoxCheckWebsite.ShortcutsEnabled = true;
+ CustomTextBoxCheckWebsite.Size = new Size(200, 23);
+ CustomTextBoxCheckWebsite.TabIndex = 0;
+ CustomTextBoxCheckWebsite.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxCheckWebsite.Texts = "https://www.cloudflare.com";
+ CustomTextBoxCheckWebsite.UnderlinedStyle = true;
+ CustomTextBoxCheckWebsite.UsePasswordChar = false;
+ CustomTextBoxCheckWebsite.WordWrap = true;
//
// CustomLabelProxyPort
//
- this.CustomLabelProxyPort.AutoSize = true;
- this.CustomLabelProxyPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelProxyPort.Border = false;
- this.CustomLabelProxyPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelProxyPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelProxyPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelProxyPort.Location = new System.Drawing.Point(12, 115);
- this.CustomLabelProxyPort.Name = "CustomLabelProxyPort";
- this.CustomLabelProxyPort.RoundedCorners = 0;
- this.CustomLabelProxyPort.Size = new System.Drawing.Size(67, 17);
- this.CustomLabelProxyPort.TabIndex = 11;
- this.CustomLabelProxyPort.Text = "Proxy Port:";
+ CustomLabelProxyPort.AutoSize = true;
+ CustomLabelProxyPort.BackColor = Color.DimGray;
+ CustomLabelProxyPort.Border = false;
+ CustomLabelProxyPort.BorderColor = Color.Blue;
+ CustomLabelProxyPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelProxyPort.ForeColor = Color.White;
+ CustomLabelProxyPort.Location = new Point(12, 115);
+ CustomLabelProxyPort.Name = "CustomLabelProxyPort";
+ CustomLabelProxyPort.RoundedCorners = 0;
+ CustomLabelProxyPort.Size = new Size(67, 17);
+ CustomLabelProxyPort.TabIndex = 11;
+ CustomLabelProxyPort.Text = "Proxy Port:";
//
// CustomNumericUpDownProxyPort
//
- this.CustomNumericUpDownProxyPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownProxyPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownProxyPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownProxyPort.Location = new System.Drawing.Point(85, 113);
- this.CustomNumericUpDownProxyPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownProxyPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownProxyPort.Name = "CustomNumericUpDownProxyPort";
- this.CustomNumericUpDownProxyPort.Size = new System.Drawing.Size(55, 23);
- this.CustomNumericUpDownProxyPort.TabIndex = 12;
- this.CustomNumericUpDownProxyPort.Value = new decimal(new int[] {
- 8090,
- 0,
- 0,
- 0});
+ CustomNumericUpDownProxyPort.BackColor = Color.DimGray;
+ CustomNumericUpDownProxyPort.BorderColor = Color.Blue;
+ CustomNumericUpDownProxyPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownProxyPort.Location = new Point(85, 113);
+ CustomNumericUpDownProxyPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownProxyPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownProxyPort.Name = "CustomNumericUpDownProxyPort";
+ CustomNumericUpDownProxyPort.Size = new Size(55, 23);
+ CustomNumericUpDownProxyPort.TabIndex = 12;
+ CustomNumericUpDownProxyPort.Value = new decimal(new int[] { 8090, 0, 0, 0 });
//
// CustomCheckBoxRandomScan
//
- this.CustomCheckBoxRandomScan.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxRandomScan.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxRandomScan.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxRandomScan.Checked = true;
- this.CustomCheckBoxRandomScan.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxRandomScan.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxRandomScan.Location = new System.Drawing.Point(167, 115);
- this.CustomCheckBoxRandomScan.Name = "CustomCheckBoxRandomScan";
- this.CustomCheckBoxRandomScan.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxRandomScan.Size = new System.Drawing.Size(131, 17);
- this.CustomCheckBoxRandomScan.TabIndex = 13;
- this.CustomCheckBoxRandomScan.Text = "Check IPs Randomly";
- this.CustomCheckBoxRandomScan.UseVisualStyleBackColor = false;
+ CustomCheckBoxRandomScan.BackColor = Color.DimGray;
+ CustomCheckBoxRandomScan.BorderColor = Color.Blue;
+ CustomCheckBoxRandomScan.CheckColor = Color.Blue;
+ CustomCheckBoxRandomScan.Checked = true;
+ CustomCheckBoxRandomScan.CheckState = CheckState.Checked;
+ CustomCheckBoxRandomScan.ForeColor = Color.White;
+ CustomCheckBoxRandomScan.Location = new Point(167, 115);
+ CustomCheckBoxRandomScan.Name = "CustomCheckBoxRandomScan";
+ CustomCheckBoxRandomScan.SelectionColor = Color.LightBlue;
+ CustomCheckBoxRandomScan.Size = new Size(131, 17);
+ CustomCheckBoxRandomScan.TabIndex = 13;
+ CustomCheckBoxRandomScan.Text = "Check IPs Randomly";
+ CustomCheckBoxRandomScan.UseVisualStyleBackColor = false;
//
// CustomLabelCheckIpWithThisPort
//
- this.CustomLabelCheckIpWithThisPort.AutoSize = true;
- this.CustomLabelCheckIpWithThisPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelCheckIpWithThisPort.Border = false;
- this.CustomLabelCheckIpWithThisPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelCheckIpWithThisPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelCheckIpWithThisPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelCheckIpWithThisPort.Location = new System.Drawing.Point(12, 80);
- this.CustomLabelCheckIpWithThisPort.Name = "CustomLabelCheckIpWithThisPort";
- this.CustomLabelCheckIpWithThisPort.RoundedCorners = 0;
- this.CustomLabelCheckIpWithThisPort.Size = new System.Drawing.Size(136, 17);
- this.CustomLabelCheckIpWithThisPort.TabIndex = 15;
- this.CustomLabelCheckIpWithThisPort.Text = "Check IPs with this Port:";
+ CustomLabelCheckIpWithThisPort.AutoSize = true;
+ CustomLabelCheckIpWithThisPort.BackColor = Color.DimGray;
+ CustomLabelCheckIpWithThisPort.Border = false;
+ CustomLabelCheckIpWithThisPort.BorderColor = Color.Blue;
+ CustomLabelCheckIpWithThisPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelCheckIpWithThisPort.ForeColor = Color.White;
+ CustomLabelCheckIpWithThisPort.Location = new Point(12, 80);
+ CustomLabelCheckIpWithThisPort.Name = "CustomLabelCheckIpWithThisPort";
+ CustomLabelCheckIpWithThisPort.RoundedCorners = 0;
+ CustomLabelCheckIpWithThisPort.Size = new Size(136, 17);
+ CustomLabelCheckIpWithThisPort.TabIndex = 15;
+ CustomLabelCheckIpWithThisPort.Text = "Check IPs with this Port:";
//
// CustomNumericUpDownCheckIpWithThisPort
//
- this.CustomNumericUpDownCheckIpWithThisPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownCheckIpWithThisPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownCheckIpWithThisPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownCheckIpWithThisPort.Location = new System.Drawing.Point(154, 78);
- this.CustomNumericUpDownCheckIpWithThisPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownCheckIpWithThisPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownCheckIpWithThisPort.Name = "CustomNumericUpDownCheckIpWithThisPort";
- this.CustomNumericUpDownCheckIpWithThisPort.Size = new System.Drawing.Size(55, 23);
- this.CustomNumericUpDownCheckIpWithThisPort.TabIndex = 16;
- this.CustomNumericUpDownCheckIpWithThisPort.Value = new decimal(new int[] {
- 443,
- 0,
- 0,
- 0});
+ CustomNumericUpDownCheckIpWithThisPort.BackColor = Color.DimGray;
+ CustomNumericUpDownCheckIpWithThisPort.BorderColor = Color.Blue;
+ CustomNumericUpDownCheckIpWithThisPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownCheckIpWithThisPort.Location = new Point(154, 78);
+ CustomNumericUpDownCheckIpWithThisPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownCheckIpWithThisPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownCheckIpWithThisPort.Name = "CustomNumericUpDownCheckIpWithThisPort";
+ CustomNumericUpDownCheckIpWithThisPort.Size = new Size(55, 23);
+ CustomNumericUpDownCheckIpWithThisPort.TabIndex = 16;
+ CustomNumericUpDownCheckIpWithThisPort.Value = new decimal(new int[] { 443, 0, 0, 0 });
//
// FormIpScanner
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.DimGray;
- this.ClientSize = new System.Drawing.Size(384, 411);
- this.Controls.Add(this.CustomNumericUpDownCheckIpWithThisPort);
- this.Controls.Add(this.CustomLabelCheckIpWithThisPort);
- this.Controls.Add(this.CustomCheckBoxRandomScan);
- this.Controls.Add(this.CustomNumericUpDownProxyPort);
- this.Controls.Add(this.CustomLabelProxyPort);
- this.Controls.Add(this.CustomTextBoxCheckWebsite);
- this.Controls.Add(this.CustomLabelCheckWebsite);
- this.Controls.Add(this.CustomLabelChecking);
- this.Controls.Add(this.CustomDataGridViewResult);
- this.Controls.Add(this.CustomButtonStartStop);
- this.Controls.Add(this.CustomNumericUpDownDelay);
- this.Controls.Add(this.CustomLabelDelay);
- this.Controls.Add(this.CustomRadioButtonSourceCloudflare);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MaximizeBox = false;
- this.Name = "FormIpScanner";
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.Text = "Clean IP Scanner";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormIpScanner_FormClosing);
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDelay)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomDataGridViewResult)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownProxyPort)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownCheckIpWithThisPort)).EndInit();
- this.ResumeLayout(false);
- this.PerformLayout();
-
+ AutoScaleMode = AutoScaleMode.None;
+ BackColor = Color.DimGray;
+ ClientSize = new Size(384, 411);
+ Controls.Add(CustomNumericUpDownCheckIpWithThisPort);
+ Controls.Add(CustomLabelCheckIpWithThisPort);
+ Controls.Add(CustomCheckBoxRandomScan);
+ Controls.Add(CustomNumericUpDownProxyPort);
+ Controls.Add(CustomLabelProxyPort);
+ Controls.Add(CustomTextBoxCheckWebsite);
+ Controls.Add(CustomLabelCheckWebsite);
+ Controls.Add(CustomLabelChecking);
+ Controls.Add(CustomDataGridViewResult);
+ Controls.Add(CustomButtonStartStop);
+ Controls.Add(CustomNumericUpDownDelay);
+ Controls.Add(CustomLabelDelay);
+ Controls.Add(CustomRadioButtonSourceCloudflare);
+ FormBorderStyle = FormBorderStyle.FixedSingle;
+ Icon = (Icon)resources.GetObject("$this.Icon");
+ MaximizeBox = false;
+ Name = "FormIpScanner";
+ SizeGripStyle = SizeGripStyle.Hide;
+ Text = "Clean IP Scanner";
+ FormClosing += FormIpScanner_FormClosing;
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDelay).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomDataGridViewResult).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownProxyPort).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownCheckIpWithThisPort).EndInit();
+ ResumeLayout(false);
+ PerformLayout();
}
#endregion
diff --git a/SecureDNSClient/Forms/FormIpScanner.cs b/SecureDNSClient/Forms/FormIpScanner.cs
index a353957..bc88df2 100644
--- a/SecureDNSClient/Forms/FormIpScanner.cs
+++ b/SecureDNSClient/Forms/FormIpScanner.cs
@@ -1,6 +1,7 @@
using CustomControls;
-using MsmhTools;
-using MsmhTools.Themes;
+using MsmhToolsClass;
+using MsmhToolsWinFormsClass;
+using MsmhToolsWinFormsClass.Themes;
using System.ComponentModel;
namespace SecureDNSClient
@@ -15,14 +16,18 @@ public partial class FormIpScanner : Form
private readonly ToolStripMenuItem ToolStripMenuItemCopy = new();
public FormIpScanner()
{
+ // Fix Screed DPI
+ ScreenDPI.FixDpiBeforeInitializeComponent(this);
InitializeComponent();
+ ScreenDPI.FixDpiAfterInitializeComponent(this);
// Load Theme
Theme.LoadTheme(this, Theme.Themes.Dark);
-
+
CustomLabelChecking.Text = "Checking: ";
ToolStripMenuItemCopy.Text = "Copy IP";
+ ToolStripMenuItemCopy.Click -= ToolStripMenuItemCopy_Click;
ToolStripMenuItemCopy.Click += ToolStripMenuItemCopy_Click;
CustomContextMenuStripMain.Items.Add(ToolStripMenuItemCopy);
@@ -32,7 +37,7 @@ public FormIpScanner()
CustomTextBoxCheckWebsite.SetToolTip("Info", msgCheckWebsite);
// Initialize and load Settings
- if (File.Exists(SettingsXmlPath) && Xml.IsValidXMLFile(SettingsXmlPath))
+ if (File.Exists(SettingsXmlPath) && XmlTool.IsValidXMLFile(SettingsXmlPath))
AppSettings = new(this, SettingsXmlPath);
else
AppSettings = new(this);
@@ -90,7 +95,7 @@ void stop()
this.InvokeIt(() => CustomLabelChecking.Text = "Checking: ");
}
}
-
+
}
private void Scanner_OnWorkingIpReceived(object? sender, EventArgs e)
@@ -101,7 +106,7 @@ private void Scanner_OnWorkingIpReceived(object? sender, EventArgs e)
{
int rowId = CustomDataGridViewResult.Rows.Add();
DataGridViewRow row = CustomDataGridViewResult.Rows[rowId];
-
+
CustomDataGridViewResult.BeginEdit(false);
row.Height = 20;
row.Cells[0].Value = result.RealDelay;
@@ -113,7 +118,7 @@ private void Scanner_OnWorkingIpReceived(object? sender, EventArgs e)
CustomDataGridViewResult.EndEdit();
});
-
+
}
}
@@ -138,7 +143,7 @@ private void CustomDataGridViewResult_MouseClick(object sender, MouseEventArgs e
CustomContextMenuStripMain.Show(CustomDataGridViewResult, e.X, e.Y);
}
-
+
}
}
diff --git a/SecureDNSClient/Forms/FormIpScanner.resx b/SecureDNSClient/Forms/FormIpScanner.resx
index fcab6a6..d3a7dd3 100644
--- a/SecureDNSClient/Forms/FormIpScanner.resx
+++ b/SecureDNSClient/Forms/FormIpScanner.resx
@@ -1,4 +1,64 @@
-
+
+
+
diff --git a/SecureDNSClient/Forms/FormMain.Designer.cs b/SecureDNSClient/Forms/FormMain.Designer.cs
index 0805ef9..90bc39e 100644
--- a/SecureDNSClient/Forms/FormMain.Designer.cs
+++ b/SecureDNSClient/Forms/FormMain.Designer.cs
@@ -28,4869 +28,4631 @@ protected override void Dispose(bool disposing)
///
private void InitializeComponent()
{
- this.components = new System.ComponentModel.Container();
+ components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
- this.CustomRichTextBoxLog = new CustomControls.CustomRichTextBox();
- this.CustomButtonCheck = new CustomControls.CustomButton();
- this.CustomGroupBoxLog = new CustomControls.CustomGroupBox();
- this.CustomCheckBoxInsecure = new CustomControls.CustomCheckBox();
- this.CustomLabelCustomServersInfo = new CustomControls.CustomLabel();
- this.CustomButtonEditCustomServers = new CustomControls.CustomButton();
- this.CustomRadioButtonCustom = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonBuiltIn = new CustomControls.CustomRadioButton();
- this.CustomLabelSSLFragmentSize = new CustomControls.CustomLabel();
- this.CustomNumericUpDownSSLFragmentSize = new CustomControls.CustomNumericUpDown();
- this.CustomTextBoxHTTPProxy = new CustomControls.CustomTextBox();
- this.CustomRadioButtonDPIModeExtreme = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonDPIModeHigh = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonDPIModeMedium = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonDPIModeLight = new CustomControls.CustomRadioButton();
- this.CustomLabelDPIModes = new CustomControls.CustomLabel();
- this.CustomButtonConnect = new CustomControls.CustomButton();
- this.CustomTabControlMain = new CustomControls.CustomTabControl();
- this.TabPageSecureDNS = new System.Windows.Forms.TabPage();
- this.CustomTabControlSecureDNS = new CustomControls.CustomTabControl();
- this.TabPageCheck = new System.Windows.Forms.TabPage();
- this.CustomProgressBarCheck = new CustomControls.CustomProgressBar();
- this.LinkLabelCheckUpdate = new System.Windows.Forms.LinkLabel();
- this.CustomButtonCheckUpdate = new CustomControls.CustomButton();
- this.CustomCheckBoxCheckInParallel = new CustomControls.CustomCheckBox();
- this.CustomButtonConnectAll = new CustomControls.CustomButton();
- this.TabPageConnect = new System.Windows.Forms.TabPage();
- this.CustomButtonWriteSavedServersDelay = new CustomControls.CustomButton();
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonConnectCheckedServers = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonConnectDNSCrypt = new CustomControls.CustomRadioButton();
- this.TabPageSetDNS = new System.Windows.Forms.TabPage();
- this.CustomButtonSetDNS = new CustomControls.CustomButton();
- this.CustomLabelSelectNIC = new CustomControls.CustomLabel();
- this.CustomLabelSetDNSInfo = new CustomControls.CustomLabel();
- this.CustomComboBoxNICs = new CustomControls.CustomComboBox();
- this.TabPageShare = new System.Windows.Forms.TabPage();
- this.CustomButtonPDpiPresetDefault = new CustomControls.CustomButton();
- this.CustomLabelPDpiPresets = new CustomControls.CustomLabel();
- this.CustomNumericUpDownPDpiBeforeSniChunks = new CustomControls.CustomNumericUpDown();
- this.CustomLabelPDpiBeforeSniChunks = new CustomControls.CustomLabel();
- this.CustomLabelPDpiSniChunkMode = new CustomControls.CustomLabel();
- this.CustomComboBoxPDpiSniChunkMode = new CustomControls.CustomComboBox();
- this.CustomNumericUpDownPDpiAntiPatternOffset = new CustomControls.CustomNumericUpDown();
- this.CustomLabelPDpiAntiPatternOffset = new CustomControls.CustomLabel();
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails = new CustomControls.CustomCheckBox();
- this.CustomButtonPDpiApplyChanges = new CustomControls.CustomButton();
- this.CustomNumericUpDownPDpiFragDelay = new CustomControls.CustomNumericUpDown();
- this.CustomLabelPDpiFragDelay = new CustomControls.CustomLabel();
- this.CustomButtonSetProxy = new CustomControls.CustomButton();
- this.CustomNumericUpDownPDpiSniChunks = new CustomControls.CustomNumericUpDown();
- this.CustomLabelPDpiSniChunks = new CustomControls.CustomLabel();
- this.CustomLabelShareSeparator1 = new CustomControls.CustomLabel();
- this.CustomCheckBoxHTTPProxyEventShowRequest = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxPDpiEnableDpiBypass = new CustomControls.CustomCheckBox();
- this.CustomButtonShare = new CustomControls.CustomButton();
- this.CustomLabelShareInfo = new CustomControls.CustomLabel();
- this.TabPageGoodbyeDPI = new System.Windows.Forms.TabPage();
- this.CustomTabControlDPIBasicAdvanced = new CustomControls.CustomTabControl();
- this.TabPageDPIBasic = new System.Windows.Forms.TabPage();
- this.CustomLabelInfoDPIModes = new CustomControls.CustomLabel();
- this.CustomRadioButtonDPIMode6 = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonDPIMode5 = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonDPIMode4 = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonDPIMode3 = new CustomControls.CustomRadioButton();
- this.CustomLabelDPIModesGoodbyeDPI = new CustomControls.CustomLabel();
- this.CustomRadioButtonDPIMode2 = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonDPIMode1 = new CustomControls.CustomRadioButton();
- this.CustomButtonDPIBasicDeactivate = new CustomControls.CustomButton();
- this.CustomButtonDPIBasicActivate = new CustomControls.CustomButton();
- this.TabPageDPIAdvanced = new System.Windows.Forms.TabPage();
- this.CustomTextBoxDPIAdvAutoTTL = new CustomControls.CustomTextBox();
- this.CustomNumericUpDownDPIAdvMaxPayload = new CustomControls.CustomNumericUpDown();
- this.CustomNumericUpDownDPIAdvMinTTL = new CustomControls.CustomNumericUpDown();
- this.CustomNumericUpDownDPIAdvSetTTL = new CustomControls.CustomNumericUpDown();
- this.CustomNumericUpDownDPIAdvPort = new CustomControls.CustomNumericUpDown();
- this.CustomButtonDPIAdvDeactivate = new CustomControls.CustomButton();
- this.CustomButtonDPIAdvActivate = new CustomControls.CustomButton();
- this.CustomButtonDPIAdvBlacklist = new CustomControls.CustomButton();
- this.CustomCheckBoxDPIAdvBlacklist = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvMaxPayload = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvReverseFrag = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvNativeFrag = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvWrongSeq = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvWrongChksum = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvMinTTL = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvAutoTTL = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvSetTTL = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvAllowNoSNI = new CustomControls.CustomCheckBox();
- this.CustomTextBoxDPIAdvIpId = new CustomControls.CustomTextBox();
- this.CustomCheckBoxDPIAdvIpId = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvPort = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvW = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvA = new CustomControls.CustomCheckBox();
- this.CustomNumericUpDownDPIAdvE = new CustomControls.CustomNumericUpDown();
- this.CustomCheckBoxDPIAdvE = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvN = new CustomControls.CustomCheckBox();
- this.CustomNumericUpDownDPIAdvK = new CustomControls.CustomNumericUpDown();
- this.CustomCheckBoxDPIAdvK = new CustomControls.CustomCheckBox();
- this.CustomNumericUpDownDPIAdvF = new CustomControls.CustomNumericUpDown();
- this.CustomCheckBoxDPIAdvF = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvM = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvS = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvR = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxDPIAdvP = new CustomControls.CustomCheckBox();
- this.TabPageTools = new System.Windows.Forms.TabPage();
- this.CustomButtonToolsStampGenerator = new CustomControls.CustomButton();
- this.CustomButtonToolsStampReader = new CustomControls.CustomButton();
- this.CustomButtonToolsDnsLookup = new CustomControls.CustomButton();
- this.CustomButtonToolsIpScanner = new CustomControls.CustomButton();
- this.TabPageSettings = new System.Windows.Forms.TabPage();
- this.CustomTabControlSettings = new CustomControls.CustomTabControl();
- this.TabPageSettingsWorkingMode = new System.Windows.Forms.TabPage();
- this.CustomNumericUpDownSettingWorkingModeSetDohPort = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingWorkingModeSetDohPort = new CustomControls.CustomLabel();
- this.CustomButtonSettingUninstallCertificate = new CustomControls.CustomButton();
- this.CustomLabelSettingInfoWorkingMode2 = new CustomControls.CustomLabel();
- this.CustomRadioButtonSettingWorkingModeDNSandDoH = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonSettingWorkingModeDNS = new CustomControls.CustomRadioButton();
- this.CustomLabelSettingInfoWorkingMode1 = new CustomControls.CustomLabel();
- this.TabPageSettingsCheck = new System.Windows.Forms.TabPage();
- this.CustomGroupBoxSettingCheckDnsProtocol = new CustomControls.CustomGroupBox();
- this.CustomCheckBoxSettingProtocolPlainDNS = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingProtocolDoQ = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingProtocolDNSCryptRelay = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingProtocolDNSCrypt = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingProtocolTLS = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingProtocolDoH = new CustomControls.CustomCheckBox();
- this.CustomGroupBoxSettingCheckSDNS = new CustomControls.CustomGroupBox();
- this.CustomCheckBoxSettingSdnsNoFilter = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingSdnsNoLog = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingSdnsDNSSec = new CustomControls.CustomCheckBox();
- this.CustomTextBoxSettingCheckDPIHost = new CustomControls.CustomTextBox();
- this.CustomLabelSettingCheckDPIInfo = new CustomControls.CustomLabel();
- this.CustomLabelSettingCheckTimeout = new CustomControls.CustomLabel();
- this.CustomNumericUpDownSettingCheckTimeout = new CustomControls.CustomNumericUpDown();
- this.TabPageSettingsConnect = new System.Windows.Forms.TabPage();
- this.CustomCheckBoxSettingEnableCache = new CustomControls.CustomCheckBox();
- this.CustomNumericUpDownSettingCamouflageDnsPort = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingCamouflageDnsPort = new CustomControls.CustomLabel();
- this.CustomNumericUpDownSettingMaxServers = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingMaxServers = new CustomControls.CustomLabel();
- this.TabPageSettingsSetUnsetDNS = new System.Windows.Forms.TabPage();
- this.CustomTextBoxSettingUnsetDns2 = new CustomControls.CustomTextBox();
- this.CustomTextBoxSettingUnsetDns1 = new CustomControls.CustomTextBox();
- this.CustomLabelSettingUnsetDns2 = new CustomControls.CustomLabel();
- this.CustomLabelSettingUnsetDns1 = new CustomControls.CustomLabel();
- this.CustomRadioButtonSettingUnsetDnsToStatic = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonSettingUnsetDnsToDhcp = new CustomControls.CustomRadioButton();
- this.TabPageSettingsShare = new System.Windows.Forms.TabPage();
- this.CustomTabControlSettingHttpProxy = new CustomControls.CustomTabControl();
- this.TabPageSettingHttpProxyBasic = new System.Windows.Forms.TabPage();
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingHTTPProxyKillRequestTimeout = new CustomControls.CustomLabel();
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs = new CustomControls.CustomCheckBox();
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort = new CustomControls.CustomNumericUpDown();
- this.CustomTextBoxSettingHTTPProxyUpstreamHost = new CustomControls.CustomTextBox();
- this.CustomLabelSettingHTTPProxyUpstreamPort = new CustomControls.CustomLabel();
- this.CustomLabelSettingHTTPProxyUpstreamHost = new CustomControls.CustomLabel();
- this.CustomComboBoxSettingHttpProxyUpstreamMode = new CustomControls.CustomComboBox();
- this.CustomCheckBoxSettingHTTPProxyUpstream = new CustomControls.CustomCheckBox();
- this.CustomLabelSettingHTTPProxyPort = new CustomControls.CustomLabel();
- this.CustomCheckBoxSettingProxyBlockPort80 = new CustomControls.CustomCheckBox();
- this.CustomLabelSettingHTTPProxyHandleRequests = new CustomControls.CustomLabel();
- this.CustomNumericUpDownSettingHTTPProxyPort = new CustomControls.CustomNumericUpDown();
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests = new CustomControls.CustomNumericUpDown();
- this.TabPageSettingHttpProxyAdvanced = new System.Windows.Forms.TabPage();
- this.CustomButtonSettingHTTPProxyDontBypass = new CustomControls.CustomButton();
- this.CustomLabelSettingHTTPProxyDontBypass = new CustomControls.CustomLabel();
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass = new CustomControls.CustomCheckBox();
- this.customLabel1 = new CustomControls.CustomLabel();
- this.CustomButtonSettingHTTPProxyBlackWhiteList = new CustomControls.CustomButton();
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy = new CustomControls.CustomCheckBox();
- this.CustomLabelSettingHTTPProxyBlackWhiteList = new CustomControls.CustomLabel();
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP = new CustomControls.CustomCheckBox();
- this.CustomLabelSettingShareSeparator2 = new CustomControls.CustomLabel();
- this.CustomTextBoxSettingHTTPProxyCfCleanIP = new CustomControls.CustomTextBox();
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS = new CustomControls.CustomCheckBox();
- this.CustomLabelSettingShareSeparator1 = new CustomControls.CustomLabel();
- this.CustomLabelSettingHTTPProxyFakeDNS = new CustomControls.CustomLabel();
- this.CustomButtonSettingHTTPProxyFakeDNS = new CustomControls.CustomButton();
- this.TabPageSettingsFakeProxy = new System.Windows.Forms.TabPage();
- this.CustomTextBoxSettingFakeProxyDohCleanIP = new CustomControls.CustomTextBox();
- this.CustomTextBoxSettingFakeProxyDohAddress = new CustomControls.CustomTextBox();
- this.CustomLabelSettingFakeProxyDohCleanIP = new CustomControls.CustomLabel();
- this.CustomLabelSettingFakeProxyDohAddress = new CustomControls.CustomLabel();
- this.CustomLabelSettingFakeProxyInfo = new CustomControls.CustomLabel();
- this.CustomNumericUpDownSettingFakeProxyPort = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingFakeProxyPort = new CustomControls.CustomLabel();
- this.TabPageSettingsCPU = new System.Windows.Forms.TabPage();
- this.CustomNumericUpDownSettingCpuKillProxyRequests = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingCpuKillProxyRequests = new CustomControls.CustomLabel();
- this.CustomRadioButtonSettingCPULow = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonSettingCPUBelowNormal = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonSettingCPUNormal = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonSettingCPUAboveNormal = new CustomControls.CustomRadioButton();
- this.CustomRadioButtonSettingCPUHigh = new CustomControls.CustomRadioButton();
- this.CustomLabelSettingInfoCPU = new CustomControls.CustomLabel();
- this.TabPageSettingsOthers = new System.Windows.Forms.TabPage();
- this.CustomNumericUpDownSettingFallbackDnsPort = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingFallbackDnsPort = new CustomControls.CustomLabel();
- this.CustomTextBoxSettingFallbackDnsIP = new CustomControls.CustomTextBox();
- this.CustomLabelSettingFallbackDnsIP = new CustomControls.CustomLabel();
- this.CustomNumericUpDownSettingBootstrapDnsPort = new CustomControls.CustomNumericUpDown();
- this.CustomLabelSettingBootstrapDnsPort = new CustomControls.CustomLabel();
- this.CustomButtonSettingRestoreDefault = new CustomControls.CustomButton();
- this.CustomCheckBoxSettingDisableAudioAlert = new CustomControls.CustomCheckBox();
- this.CustomLabelSettingBootstrapDnsIP = new CustomControls.CustomLabel();
- this.CustomCheckBoxSettingDontAskCertificate = new CustomControls.CustomCheckBox();
- this.CustomTextBoxSettingBootstrapDnsIP = new CustomControls.CustomTextBox();
- this.TabPageAbout = new System.Windows.Forms.TabPage();
- this.CustomLabelAboutVersion = new CustomControls.CustomLabel();
- this.PictureBoxFarvahar = new System.Windows.Forms.PictureBox();
- this.CustomLabelAboutCopyright = new CustomControls.CustomLabel();
- this.LinkLabelStAlidxdydz = new System.Windows.Forms.LinkLabel();
- this.CustomLabelAboutSpecialThanks = new CustomControls.CustomLabel();
- this.LinkLabelGoodbyeDPI = new System.Windows.Forms.LinkLabel();
- this.LinkLabelDNSCrypt = new System.Windows.Forms.LinkLabel();
- this.LinkLabelDNSProxy = new System.Windows.Forms.LinkLabel();
- this.LinkLabelDNSLookup = new System.Windows.Forms.LinkLabel();
- this.CustomLabelAboutUsing = new CustomControls.CustomLabel();
- this.CustomLabelAboutThis2 = new CustomControls.CustomLabel();
- this.CustomLabelAboutThis = new CustomControls.CustomLabel();
- this.PictureBoxAbout = new System.Windows.Forms.PictureBox();
- this.CustomButtonToggleLogView = new CustomControls.CustomButton();
- this.NotifyIconMain = new System.Windows.Forms.NotifyIcon(this.components);
- this.CustomContextMenuStripIcon = new CustomControls.CustomContextMenuStrip();
- this.CustomGroupBoxStatus = new CustomControls.CustomGroupBox();
- this.CustomRichTextBoxStatusCpuUsage = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusGoodbyeDPI = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusProxyRequests = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusLocalDoHLatency = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusLocalDoH = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusLocalDnsLatency = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusLocalDNS = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusIsProxySet = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusIsSharing = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusIsDNSSet = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusProxyDpiBypass = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusIsConnected = new CustomControls.CustomRichTextBox();
- this.CustomRichTextBoxStatusWorkingServers = new CustomControls.CustomRichTextBox();
- this.SplitContainerMain = new System.Windows.Forms.SplitContainer();
- this.SplitContainerTop = new System.Windows.Forms.SplitContainer();
- this.CustomGroupBoxLog.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSSLFragmentSize)).BeginInit();
- this.CustomTabControlMain.SuspendLayout();
- this.TabPageSecureDNS.SuspendLayout();
- this.CustomTabControlSecureDNS.SuspendLayout();
- this.TabPageCheck.SuspendLayout();
- this.TabPageConnect.SuspendLayout();
- this.TabPageSetDNS.SuspendLayout();
- this.TabPageShare.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiBeforeSniChunks)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiAntiPatternOffset)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiFragDelay)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiSniChunks)).BeginInit();
- this.TabPageGoodbyeDPI.SuspendLayout();
- this.CustomTabControlDPIBasicAdvanced.SuspendLayout();
- this.TabPageDPIBasic.SuspendLayout();
- this.TabPageDPIAdvanced.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvMaxPayload)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvMinTTL)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvSetTTL)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvPort)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvE)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvK)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvF)).BeginInit();
- this.TabPageTools.SuspendLayout();
- this.TabPageSettings.SuspendLayout();
- this.CustomTabControlSettings.SuspendLayout();
- this.TabPageSettingsWorkingMode.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingWorkingModeSetDohPort)).BeginInit();
- this.TabPageSettingsCheck.SuspendLayout();
- this.CustomGroupBoxSettingCheckDnsProtocol.SuspendLayout();
- this.CustomGroupBoxSettingCheckSDNS.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingCheckTimeout)).BeginInit();
- this.TabPageSettingsConnect.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingCamouflageDnsPort)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingMaxServers)).BeginInit();
- this.TabPageSettingsSetUnsetDNS.SuspendLayout();
- this.TabPageSettingsShare.SuspendLayout();
- this.CustomTabControlSettingHttpProxy.SuspendLayout();
- this.TabPageSettingHttpProxyBasic.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyUpstreamPort)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyPort)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyHandleRequests)).BeginInit();
- this.TabPageSettingHttpProxyAdvanced.SuspendLayout();
- this.TabPageSettingsFakeProxy.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingFakeProxyPort)).BeginInit();
- this.TabPageSettingsCPU.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingCpuKillProxyRequests)).BeginInit();
- this.TabPageSettingsOthers.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingFallbackDnsPort)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingBootstrapDnsPort)).BeginInit();
- this.TabPageAbout.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.PictureBoxFarvahar)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.PictureBoxAbout)).BeginInit();
- this.CustomGroupBoxStatus.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.SplitContainerMain)).BeginInit();
- this.SplitContainerMain.Panel1.SuspendLayout();
- this.SplitContainerMain.Panel2.SuspendLayout();
- this.SplitContainerMain.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.SplitContainerTop)).BeginInit();
- this.SplitContainerTop.Panel1.SuspendLayout();
- this.SplitContainerTop.Panel2.SuspendLayout();
- this.SplitContainerTop.SuspendLayout();
- this.SuspendLayout();
+ CustomRichTextBoxLog = new CustomControls.CustomRichTextBox();
+ CustomButtonCheck = new CustomControls.CustomButton();
+ CustomGroupBoxLog = new CustomControls.CustomGroupBox();
+ CustomCheckBoxInsecure = new CustomControls.CustomCheckBox();
+ CustomLabelCustomServersInfo = new CustomControls.CustomLabel();
+ CustomButtonEditCustomServers = new CustomControls.CustomButton();
+ CustomRadioButtonCustom = new CustomControls.CustomRadioButton();
+ CustomRadioButtonBuiltIn = new CustomControls.CustomRadioButton();
+ CustomLabelSSLFragmentSize = new CustomControls.CustomLabel();
+ CustomNumericUpDownSSLFragmentSize = new CustomControls.CustomNumericUpDown();
+ CustomTextBoxHTTPProxy = new CustomControls.CustomTextBox();
+ CustomRadioButtonDPIModeExtreme = new CustomControls.CustomRadioButton();
+ CustomRadioButtonDPIModeHigh = new CustomControls.CustomRadioButton();
+ CustomRadioButtonDPIModeMedium = new CustomControls.CustomRadioButton();
+ CustomRadioButtonDPIModeLight = new CustomControls.CustomRadioButton();
+ CustomLabelDPIModes = new CustomControls.CustomLabel();
+ CustomButtonConnect = new CustomControls.CustomButton();
+ CustomTabControlMain = new CustomControls.CustomTabControl();
+ TabPageSecureDNS = new TabPage();
+ CustomTabControlSecureDNS = new CustomControls.CustomTabControl();
+ TabPageCheck = new TabPage();
+ CustomButtonQuickConnect = new CustomControls.CustomButton();
+ CustomProgressBarCheck = new CustomControls.CustomProgressBar();
+ LinkLabelCheckUpdate = new LinkLabel();
+ CustomButtonCheckUpdate = new CustomControls.CustomButton();
+ CustomCheckBoxCheckInParallel = new CustomControls.CustomCheckBox();
+ TabPageConnect = new TabPage();
+ CustomButtonWriteSavedServersDelay = new CustomControls.CustomButton();
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI = new CustomControls.CustomRadioButton();
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI = new CustomControls.CustomRadioButton();
+ CustomRadioButtonConnectCheckedServers = new CustomControls.CustomRadioButton();
+ CustomRadioButtonConnectDNSCrypt = new CustomControls.CustomRadioButton();
+ TabPageSetDNS = new TabPage();
+ CustomButtonSetDNS = new CustomControls.CustomButton();
+ CustomLabelSelectNIC = new CustomControls.CustomLabel();
+ CustomLabelSetDNSInfo = new CustomControls.CustomLabel();
+ CustomComboBoxNICs = new CustomControls.CustomComboBox();
+ TabPageShare = new TabPage();
+ CustomButtonPDpiPresetDefault = new CustomControls.CustomButton();
+ CustomLabelPDpiPresets = new CustomControls.CustomLabel();
+ CustomNumericUpDownPDpiBeforeSniChunks = new CustomControls.CustomNumericUpDown();
+ CustomLabelPDpiBeforeSniChunks = new CustomControls.CustomLabel();
+ CustomLabelPDpiSniChunkMode = new CustomControls.CustomLabel();
+ CustomComboBoxPDpiSniChunkMode = new CustomControls.CustomComboBox();
+ CustomNumericUpDownPDpiAntiPatternOffset = new CustomControls.CustomNumericUpDown();
+ CustomLabelPDpiAntiPatternOffset = new CustomControls.CustomLabel();
+ CustomCheckBoxHTTPProxyEventShowChunkDetails = new CustomControls.CustomCheckBox();
+ CustomButtonPDpiApplyChanges = new CustomControls.CustomButton();
+ CustomNumericUpDownPDpiFragDelay = new CustomControls.CustomNumericUpDown();
+ CustomLabelPDpiFragDelay = new CustomControls.CustomLabel();
+ CustomButtonSetProxy = new CustomControls.CustomButton();
+ CustomNumericUpDownPDpiSniChunks = new CustomControls.CustomNumericUpDown();
+ CustomLabelPDpiSniChunks = new CustomControls.CustomLabel();
+ CustomLabelShareSeparator1 = new CustomControls.CustomLabel();
+ CustomCheckBoxHTTPProxyEventShowRequest = new CustomControls.CustomCheckBox();
+ CustomCheckBoxPDpiEnableDpiBypass = new CustomControls.CustomCheckBox();
+ CustomButtonShare = new CustomControls.CustomButton();
+ CustomLabelShareInfo = new CustomControls.CustomLabel();
+ TabPageGoodbyeDPI = new TabPage();
+ CustomTabControlDPIBasicAdvanced = new CustomControls.CustomTabControl();
+ TabPageDPIBasic = new TabPage();
+ CustomLabelInfoDPIModes = new CustomControls.CustomLabel();
+ CustomRadioButtonDPIMode6 = new CustomControls.CustomRadioButton();
+ CustomRadioButtonDPIMode5 = new CustomControls.CustomRadioButton();
+ CustomRadioButtonDPIMode4 = new CustomControls.CustomRadioButton();
+ CustomRadioButtonDPIMode3 = new CustomControls.CustomRadioButton();
+ CustomLabelDPIModesGoodbyeDPI = new CustomControls.CustomLabel();
+ CustomRadioButtonDPIMode2 = new CustomControls.CustomRadioButton();
+ CustomRadioButtonDPIMode1 = new CustomControls.CustomRadioButton();
+ CustomButtonDPIBasicDeactivate = new CustomControls.CustomButton();
+ CustomButtonDPIBasicActivate = new CustomControls.CustomButton();
+ TabPageDPIAdvanced = new TabPage();
+ CustomTextBoxDPIAdvAutoTTL = new CustomControls.CustomTextBox();
+ CustomNumericUpDownDPIAdvMaxPayload = new CustomControls.CustomNumericUpDown();
+ CustomNumericUpDownDPIAdvMinTTL = new CustomControls.CustomNumericUpDown();
+ CustomNumericUpDownDPIAdvSetTTL = new CustomControls.CustomNumericUpDown();
+ CustomNumericUpDownDPIAdvPort = new CustomControls.CustomNumericUpDown();
+ CustomButtonDPIAdvDeactivate = new CustomControls.CustomButton();
+ CustomButtonDPIAdvActivate = new CustomControls.CustomButton();
+ CustomButtonDPIAdvBlacklist = new CustomControls.CustomButton();
+ CustomCheckBoxDPIAdvBlacklist = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvMaxPayload = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvReverseFrag = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvNativeFrag = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvWrongSeq = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvWrongChksum = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvMinTTL = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvAutoTTL = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvSetTTL = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvAllowNoSNI = new CustomControls.CustomCheckBox();
+ CustomTextBoxDPIAdvIpId = new CustomControls.CustomTextBox();
+ CustomCheckBoxDPIAdvIpId = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvPort = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvW = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvA = new CustomControls.CustomCheckBox();
+ CustomNumericUpDownDPIAdvE = new CustomControls.CustomNumericUpDown();
+ CustomCheckBoxDPIAdvE = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvN = new CustomControls.CustomCheckBox();
+ CustomNumericUpDownDPIAdvK = new CustomControls.CustomNumericUpDown();
+ CustomCheckBoxDPIAdvK = new CustomControls.CustomCheckBox();
+ CustomNumericUpDownDPIAdvF = new CustomControls.CustomNumericUpDown();
+ CustomCheckBoxDPIAdvF = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvM = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvS = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvR = new CustomControls.CustomCheckBox();
+ CustomCheckBoxDPIAdvP = new CustomControls.CustomCheckBox();
+ TabPageTools = new TabPage();
+ CustomButtonToolsDnsScanner = new CustomControls.CustomButton();
+ CustomButtonToolsStampGenerator = new CustomControls.CustomButton();
+ CustomButtonToolsStampReader = new CustomControls.CustomButton();
+ CustomButtonToolsDnsLookup = new CustomControls.CustomButton();
+ CustomButtonToolsIpScanner = new CustomControls.CustomButton();
+ TabPageSettings = new TabPage();
+ CustomTabControlSettings = new CustomControls.CustomTabControl();
+ TabPageSettingsWorkingMode = new TabPage();
+ CustomNumericUpDownSettingWorkingModeSetDohPort = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingWorkingModeSetDohPort = new CustomControls.CustomLabel();
+ CustomButtonSettingUninstallCertificate = new CustomControls.CustomButton();
+ CustomLabelSettingInfoWorkingMode2 = new CustomControls.CustomLabel();
+ CustomRadioButtonSettingWorkingModeDNSandDoH = new CustomControls.CustomRadioButton();
+ CustomRadioButtonSettingWorkingModeDNS = new CustomControls.CustomRadioButton();
+ CustomLabelSettingInfoWorkingMode1 = new CustomControls.CustomLabel();
+ TabPageSettingsCheck = new TabPage();
+ CustomGroupBoxSettingCheckDnsProtocol = new CustomControls.CustomGroupBox();
+ CustomCheckBoxSettingProtocolPlainDNS = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingProtocolDoQ = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingProtocolDNSCryptRelay = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingProtocolDNSCrypt = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingProtocolTLS = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingProtocolDoH = new CustomControls.CustomCheckBox();
+ CustomGroupBoxSettingCheckSDNS = new CustomControls.CustomGroupBox();
+ CustomCheckBoxSettingSdnsNoFilter = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingSdnsNoLog = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingSdnsDNSSec = new CustomControls.CustomCheckBox();
+ CustomTextBoxSettingCheckDPIHost = new CustomControls.CustomTextBox();
+ CustomLabelSettingCheckDPIInfo = new CustomControls.CustomLabel();
+ CustomLabelSettingCheckTimeout = new CustomControls.CustomLabel();
+ CustomNumericUpDownSettingCheckTimeout = new CustomControls.CustomNumericUpDown();
+ TabPageSettingsConnect = new TabPage();
+ CustomCheckBoxSettingEnableCache = new CustomControls.CustomCheckBox();
+ CustomNumericUpDownSettingCamouflageDnsPort = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingCamouflageDnsPort = new CustomControls.CustomLabel();
+ CustomNumericUpDownSettingMaxServers = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingMaxServers = new CustomControls.CustomLabel();
+ TabPageSettingsSetUnsetDNS = new TabPage();
+ CustomTextBoxSettingUnsetDns2 = new CustomControls.CustomTextBox();
+ CustomTextBoxSettingUnsetDns1 = new CustomControls.CustomTextBox();
+ CustomLabelSettingUnsetDns2 = new CustomControls.CustomLabel();
+ CustomLabelSettingUnsetDns1 = new CustomControls.CustomLabel();
+ CustomRadioButtonSettingUnsetDnsToStatic = new CustomControls.CustomRadioButton();
+ CustomRadioButtonSettingUnsetDnsToDhcp = new CustomControls.CustomRadioButton();
+ TabPageSettingsShare = new TabPage();
+ CustomTabControlSettingHttpProxy = new CustomControls.CustomTabControl();
+ TabPageSettingHttpProxyBasic = new TabPage();
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingHTTPProxyKillRequestTimeout = new CustomControls.CustomLabel();
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs = new CustomControls.CustomCheckBox();
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort = new CustomControls.CustomNumericUpDown();
+ CustomTextBoxSettingHTTPProxyUpstreamHost = new CustomControls.CustomTextBox();
+ CustomLabelSettingHTTPProxyUpstreamPort = new CustomControls.CustomLabel();
+ CustomLabelSettingHTTPProxyUpstreamHost = new CustomControls.CustomLabel();
+ CustomComboBoxSettingHttpProxyUpstreamMode = new CustomControls.CustomComboBox();
+ CustomCheckBoxSettingHTTPProxyUpstream = new CustomControls.CustomCheckBox();
+ CustomLabelSettingHTTPProxyPort = new CustomControls.CustomLabel();
+ CustomCheckBoxSettingProxyBlockPort80 = new CustomControls.CustomCheckBox();
+ CustomLabelSettingHTTPProxyHandleRequests = new CustomControls.CustomLabel();
+ CustomNumericUpDownSettingHTTPProxyPort = new CustomControls.CustomNumericUpDown();
+ CustomNumericUpDownSettingHTTPProxyHandleRequests = new CustomControls.CustomNumericUpDown();
+ TabPageSettingHttpProxyAdvanced = new TabPage();
+ CustomButtonSettingHTTPProxyDontBypass = new CustomControls.CustomButton();
+ CustomLabelSettingHTTPProxyDontBypass = new CustomControls.CustomLabel();
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass = new CustomControls.CustomCheckBox();
+ customLabel1 = new CustomControls.CustomLabel();
+ CustomButtonSettingHTTPProxyBlackWhiteList = new CustomControls.CustomButton();
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy = new CustomControls.CustomCheckBox();
+ CustomLabelSettingHTTPProxyBlackWhiteList = new CustomControls.CustomLabel();
+ CustomCheckBoxSettingHTTPProxyCfCleanIP = new CustomControls.CustomCheckBox();
+ CustomLabelSettingShareSeparator2 = new CustomControls.CustomLabel();
+ CustomTextBoxSettingHTTPProxyCfCleanIP = new CustomControls.CustomTextBox();
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList = new CustomControls.CustomCheckBox();
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS = new CustomControls.CustomCheckBox();
+ CustomLabelSettingShareSeparator1 = new CustomControls.CustomLabel();
+ CustomLabelSettingHTTPProxyFakeDNS = new CustomControls.CustomLabel();
+ CustomButtonSettingHTTPProxyFakeDNS = new CustomControls.CustomButton();
+ TabPageSettingsFakeProxy = new TabPage();
+ CustomTextBoxSettingFakeProxyDohCleanIP = new CustomControls.CustomTextBox();
+ CustomTextBoxSettingFakeProxyDohAddress = new CustomControls.CustomTextBox();
+ CustomLabelSettingFakeProxyDohCleanIP = new CustomControls.CustomLabel();
+ CustomLabelSettingFakeProxyDohAddress = new CustomControls.CustomLabel();
+ CustomLabelSettingFakeProxyInfo = new CustomControls.CustomLabel();
+ CustomNumericUpDownSettingFakeProxyPort = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingFakeProxyPort = new CustomControls.CustomLabel();
+ TabPageSettingsCPU = new TabPage();
+ CustomNumericUpDownSettingCpuKillProxyRequests = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingCpuKillProxyRequests = new CustomControls.CustomLabel();
+ CustomRadioButtonSettingCPULow = new CustomControls.CustomRadioButton();
+ CustomRadioButtonSettingCPUBelowNormal = new CustomControls.CustomRadioButton();
+ CustomRadioButtonSettingCPUNormal = new CustomControls.CustomRadioButton();
+ CustomRadioButtonSettingCPUAboveNormal = new CustomControls.CustomRadioButton();
+ CustomRadioButtonSettingCPUHigh = new CustomControls.CustomRadioButton();
+ CustomLabelSettingInfoCPU = new CustomControls.CustomLabel();
+ TabPageSettingsOthers = new TabPage();
+ CustomButtonImportUserData = new CustomControls.CustomButton();
+ CustomButtonExportUserData = new CustomControls.CustomButton();
+ CustomCheckBoxSettingWriteLogWindowToFile = new CustomControls.CustomCheckBox();
+ CustomNumericUpDownSettingFallbackDnsPort = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingFallbackDnsPort = new CustomControls.CustomLabel();
+ CustomTextBoxSettingFallbackDnsIP = new CustomControls.CustomTextBox();
+ CustomLabelSettingFallbackDnsIP = new CustomControls.CustomLabel();
+ CustomNumericUpDownSettingBootstrapDnsPort = new CustomControls.CustomNumericUpDown();
+ CustomLabelSettingBootstrapDnsPort = new CustomControls.CustomLabel();
+ CustomButtonSettingRestoreDefault = new CustomControls.CustomButton();
+ CustomCheckBoxSettingDisableAudioAlert = new CustomControls.CustomCheckBox();
+ CustomLabelSettingBootstrapDnsIP = new CustomControls.CustomLabel();
+ CustomCheckBoxSettingDontAskCertificate = new CustomControls.CustomCheckBox();
+ CustomTextBoxSettingBootstrapDnsIP = new CustomControls.CustomTextBox();
+ TabPageAbout = new TabPage();
+ CustomLabelAboutVersion = new CustomControls.CustomLabel();
+ PictureBoxFarvahar = new PictureBox();
+ CustomLabelAboutCopyright = new CustomControls.CustomLabel();
+ LinkLabelStAlidxdydz = new LinkLabel();
+ CustomLabelAboutSpecialThanks = new CustomControls.CustomLabel();
+ LinkLabelGoodbyeDPI = new LinkLabel();
+ LinkLabelDNSCrypt = new LinkLabel();
+ LinkLabelDNSProxy = new LinkLabel();
+ LinkLabelDNSLookup = new LinkLabel();
+ CustomLabelAboutUsing = new CustomControls.CustomLabel();
+ CustomLabelAboutThis2 = new CustomControls.CustomLabel();
+ CustomLabelAboutThis = new CustomControls.CustomLabel();
+ PictureBoxAbout = new PictureBox();
+ CustomButtonToggleLogView = new CustomControls.CustomButton();
+ NotifyIconMain = new NotifyIcon(components);
+ CustomContextMenuStripIcon = new CustomControls.CustomContextMenuStrip();
+ CustomGroupBoxStatus = new CustomControls.CustomGroupBox();
+ CustomButtonProcessMonitor = new CustomControls.CustomButton();
+ CustomRichTextBoxStatusCpuUsage = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusGoodbyeDPI = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusProxyRequests = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusLocalDoHLatency = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusLocalDoH = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusLocalDnsLatency = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusLocalDNS = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusIsProxySet = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusIsSharing = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusIsDNSSet = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusProxyDpiBypass = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusIsConnected = new CustomControls.CustomRichTextBox();
+ CustomRichTextBoxStatusWorkingServers = new CustomControls.CustomRichTextBox();
+ SplitContainerMain = new SplitContainer();
+ SplitContainerTop = new SplitContainer();
+ CustomGroupBoxLog.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSSLFragmentSize).BeginInit();
+ CustomTabControlMain.SuspendLayout();
+ TabPageSecureDNS.SuspendLayout();
+ CustomTabControlSecureDNS.SuspendLayout();
+ TabPageCheck.SuspendLayout();
+ TabPageConnect.SuspendLayout();
+ TabPageSetDNS.SuspendLayout();
+ TabPageShare.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiBeforeSniChunks).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiAntiPatternOffset).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiFragDelay).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiSniChunks).BeginInit();
+ TabPageGoodbyeDPI.SuspendLayout();
+ CustomTabControlDPIBasicAdvanced.SuspendLayout();
+ TabPageDPIBasic.SuspendLayout();
+ TabPageDPIAdvanced.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvMaxPayload).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvMinTTL).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvSetTTL).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvPort).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvE).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvK).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvF).BeginInit();
+ TabPageTools.SuspendLayout();
+ TabPageSettings.SuspendLayout();
+ CustomTabControlSettings.SuspendLayout();
+ TabPageSettingsWorkingMode.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingWorkingModeSetDohPort).BeginInit();
+ TabPageSettingsCheck.SuspendLayout();
+ CustomGroupBoxSettingCheckDnsProtocol.SuspendLayout();
+ CustomGroupBoxSettingCheckSDNS.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingCheckTimeout).BeginInit();
+ TabPageSettingsConnect.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingCamouflageDnsPort).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingMaxServers).BeginInit();
+ TabPageSettingsSetUnsetDNS.SuspendLayout();
+ TabPageSettingsShare.SuspendLayout();
+ CustomTabControlSettingHttpProxy.SuspendLayout();
+ TabPageSettingHttpProxyBasic.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyKillRequestTimeout).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyUpstreamPort).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyPort).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyHandleRequests).BeginInit();
+ TabPageSettingHttpProxyAdvanced.SuspendLayout();
+ TabPageSettingsFakeProxy.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingFakeProxyPort).BeginInit();
+ TabPageSettingsCPU.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingCpuKillProxyRequests).BeginInit();
+ TabPageSettingsOthers.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingFallbackDnsPort).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingBootstrapDnsPort).BeginInit();
+ TabPageAbout.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)PictureBoxFarvahar).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)PictureBoxAbout).BeginInit();
+ CustomGroupBoxStatus.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)SplitContainerMain).BeginInit();
+ SplitContainerMain.Panel1.SuspendLayout();
+ SplitContainerMain.Panel2.SuspendLayout();
+ SplitContainerMain.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)SplitContainerTop).BeginInit();
+ SplitContainerTop.Panel1.SuspendLayout();
+ SplitContainerTop.Panel2.SuspendLayout();
+ SplitContainerTop.SuspendLayout();
+ SuspendLayout();
//
// CustomRichTextBoxLog
//
- this.CustomRichTextBoxLog.AcceptsTab = false;
- this.CustomRichTextBoxLog.AutoWordSelection = false;
- this.CustomRichTextBoxLog.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxLog.Border = false;
- this.CustomRichTextBoxLog.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxLog.BorderSize = 1;
- this.CustomRichTextBoxLog.BulletIndent = 0;
- this.CustomRichTextBoxLog.Cursor = System.Windows.Forms.Cursors.IBeam;
- this.CustomRichTextBoxLog.DetectUrls = false;
- this.CustomRichTextBoxLog.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomRichTextBoxLog.EnableAutoDragDrop = false;
- this.CustomRichTextBoxLog.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxLog.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxLog.HideSelection = false;
- this.CustomRichTextBoxLog.Location = new System.Drawing.Point(3, 19);
- this.CustomRichTextBoxLog.Margin = new System.Windows.Forms.Padding(1);
- this.CustomRichTextBoxLog.MaxLength = 2147483647;
- this.CustomRichTextBoxLog.MinimumSize = new System.Drawing.Size(0, 23);
- this.CustomRichTextBoxLog.Multiline = true;
- this.CustomRichTextBoxLog.Name = "CustomRichTextBoxLog";
- this.CustomRichTextBoxLog.ReadOnly = true;
- this.CustomRichTextBoxLog.RightMargin = 0;
- this.CustomRichTextBoxLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
- this.CustomRichTextBoxLog.ScrollToBottom = true;
- this.CustomRichTextBoxLog.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxLog.SelectionLength = 0;
- this.CustomRichTextBoxLog.SelectionStart = 0;
- this.CustomRichTextBoxLog.ShortcutsEnabled = true;
- this.CustomRichTextBoxLog.Size = new System.Drawing.Size(878, 155);
- this.CustomRichTextBoxLog.TabIndex = 0;
- this.CustomRichTextBoxLog.Texts = "";
- this.CustomRichTextBoxLog.UnderlinedStyle = false;
- this.CustomRichTextBoxLog.WordWrap = true;
- this.CustomRichTextBoxLog.ZoomFactor = 1F;
+ CustomRichTextBoxLog.AcceptsTab = false;
+ CustomRichTextBoxLog.AutoWordSelection = false;
+ CustomRichTextBoxLog.BackColor = Color.DimGray;
+ CustomRichTextBoxLog.Border = false;
+ CustomRichTextBoxLog.BorderColor = Color.Blue;
+ CustomRichTextBoxLog.BorderSize = 1;
+ CustomRichTextBoxLog.BulletIndent = 0;
+ CustomRichTextBoxLog.Cursor = Cursors.IBeam;
+ CustomRichTextBoxLog.DetectUrls = false;
+ CustomRichTextBoxLog.Dock = DockStyle.Fill;
+ CustomRichTextBoxLog.EnableAutoDragDrop = false;
+ CustomRichTextBoxLog.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxLog.ForeColor = Color.White;
+ CustomRichTextBoxLog.HideSelection = false;
+ CustomRichTextBoxLog.Location = new Point(3, 19);
+ CustomRichTextBoxLog.Margin = new Padding(1);
+ CustomRichTextBoxLog.MaxLength = int.MaxValue;
+ CustomRichTextBoxLog.MinimumSize = new Size(0, 23);
+ CustomRichTextBoxLog.Multiline = true;
+ CustomRichTextBoxLog.Name = "CustomRichTextBoxLog";
+ CustomRichTextBoxLog.ReadOnly = true;
+ CustomRichTextBoxLog.RightMargin = 0;
+ CustomRichTextBoxLog.ScrollBars = ScrollBars.Both;
+ CustomRichTextBoxLog.ScrollToBottom = true;
+ CustomRichTextBoxLog.SelectionColor = Color.White;
+ CustomRichTextBoxLog.SelectionLength = 0;
+ CustomRichTextBoxLog.SelectionStart = 0;
+ CustomRichTextBoxLog.ShortcutsEnabled = true;
+ CustomRichTextBoxLog.Size = new Size(878, 155);
+ CustomRichTextBoxLog.TabIndex = 0;
+ CustomRichTextBoxLog.Texts = "";
+ CustomRichTextBoxLog.UnderlinedStyle = false;
+ CustomRichTextBoxLog.WordWrap = true;
+ CustomRichTextBoxLog.ZoomFactor = 1F;
//
// CustomButtonCheck
//
- this.CustomButtonCheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonCheck.AutoSize = true;
- this.CustomButtonCheck.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonCheck.Location = new System.Drawing.Point(160, 303);
- this.CustomButtonCheck.Name = "CustomButtonCheck";
- this.CustomButtonCheck.RoundedCorners = 5;
- this.CustomButtonCheck.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonCheck.Size = new System.Drawing.Size(93, 27);
- this.CustomButtonCheck.TabIndex = 2;
- this.CustomButtonCheck.Text = "Check/Cancel";
- this.CustomButtonCheck.UseVisualStyleBackColor = true;
- this.CustomButtonCheck.Click += new System.EventHandler(this.CustomButtonCheck_Click);
+ CustomButtonCheck.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonCheck.BorderColor = Color.Blue;
+ CustomButtonCheck.FlatStyle = FlatStyle.Flat;
+ CustomButtonCheck.Location = new Point(113, 303);
+ CustomButtonCheck.Name = "CustomButtonCheck";
+ CustomButtonCheck.RoundedCorners = 5;
+ CustomButtonCheck.SelectionColor = Color.LightBlue;
+ CustomButtonCheck.Size = new Size(76, 27);
+ CustomButtonCheck.TabIndex = 2;
+ CustomButtonCheck.Text = "Stopping...";
+ CustomButtonCheck.UseVisualStyleBackColor = true;
+ CustomButtonCheck.Click += CustomButtonCheck_Click;
//
// CustomGroupBoxLog
//
- this.CustomGroupBoxLog.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.CustomGroupBoxLog.BorderColor = System.Drawing.Color.Blue;
- this.CustomGroupBoxLog.Controls.Add(this.CustomRichTextBoxLog);
- this.CustomGroupBoxLog.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomGroupBoxLog.Location = new System.Drawing.Point(0, 0);
- this.CustomGroupBoxLog.Margin = new System.Windows.Forms.Padding(1);
- this.CustomGroupBoxLog.Name = "CustomGroupBoxLog";
- this.CustomGroupBoxLog.Size = new System.Drawing.Size(884, 177);
- this.CustomGroupBoxLog.TabIndex = 3;
- this.CustomGroupBoxLog.TabStop = false;
- this.CustomGroupBoxLog.Text = "Log";
+ CustomGroupBoxLog.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ CustomGroupBoxLog.BorderColor = Color.Blue;
+ CustomGroupBoxLog.Controls.Add(CustomRichTextBoxLog);
+ CustomGroupBoxLog.Dock = DockStyle.Fill;
+ CustomGroupBoxLog.Location = new Point(0, 0);
+ CustomGroupBoxLog.Margin = new Padding(1);
+ CustomGroupBoxLog.Name = "CustomGroupBoxLog";
+ CustomGroupBoxLog.Size = new Size(884, 177);
+ CustomGroupBoxLog.TabIndex = 3;
+ CustomGroupBoxLog.TabStop = false;
+ CustomGroupBoxLog.Text = "Log";
//
// CustomCheckBoxInsecure
//
- this.CustomCheckBoxInsecure.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxInsecure.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxInsecure.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxInsecure.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxInsecure.Location = new System.Drawing.Point(25, 220);
- this.CustomCheckBoxInsecure.Name = "CustomCheckBoxInsecure";
- this.CustomCheckBoxInsecure.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxInsecure.Size = new System.Drawing.Size(211, 17);
- this.CustomCheckBoxInsecure.TabIndex = 7;
- this.CustomCheckBoxInsecure.Text = "Allow insecure (not recommended)";
- this.CustomCheckBoxInsecure.UseVisualStyleBackColor = false;
- this.CustomCheckBoxInsecure.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomCheckBoxInsecure.BackColor = Color.DimGray;
+ CustomCheckBoxInsecure.BorderColor = Color.Blue;
+ CustomCheckBoxInsecure.CheckColor = Color.Blue;
+ CustomCheckBoxInsecure.ForeColor = Color.White;
+ CustomCheckBoxInsecure.Location = new Point(25, 220);
+ CustomCheckBoxInsecure.Name = "CustomCheckBoxInsecure";
+ CustomCheckBoxInsecure.SelectionColor = Color.LightBlue;
+ CustomCheckBoxInsecure.Size = new Size(211, 17);
+ CustomCheckBoxInsecure.TabIndex = 7;
+ CustomCheckBoxInsecure.Text = "Allow insecure (not recommended)";
+ CustomCheckBoxInsecure.UseVisualStyleBackColor = false;
+ CustomCheckBoxInsecure.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomLabelCustomServersInfo
//
- this.CustomLabelCustomServersInfo.AutoSize = true;
- this.CustomLabelCustomServersInfo.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelCustomServersInfo.Border = false;
- this.CustomLabelCustomServersInfo.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelCustomServersInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelCustomServersInfo.ForeColor = System.Drawing.Color.White;
- this.CustomLabelCustomServersInfo.Location = new System.Drawing.Point(41, 75);
- this.CustomLabelCustomServersInfo.Name = "CustomLabelCustomServersInfo";
- this.CustomLabelCustomServersInfo.RoundedCorners = 0;
- this.CustomLabelCustomServersInfo.Size = new System.Drawing.Size(216, 90);
- this.CustomLabelCustomServersInfo.TabIndex = 6;
- this.CustomLabelCustomServersInfo.Text = "Supported: DoH, DoT, DoQ, DNSCrypt.\r\nEach line one server. e.g:\r\n https://cloudf" +
- "lare-dns.com/dns-query\r\n tls://dns.google\r\n quic://dns.adguard.com\r\n sdns://";
+ CustomLabelCustomServersInfo.AutoSize = true;
+ CustomLabelCustomServersInfo.BackColor = Color.DimGray;
+ CustomLabelCustomServersInfo.Border = false;
+ CustomLabelCustomServersInfo.BorderColor = Color.Blue;
+ CustomLabelCustomServersInfo.FlatStyle = FlatStyle.Flat;
+ CustomLabelCustomServersInfo.ForeColor = Color.White;
+ CustomLabelCustomServersInfo.Location = new Point(41, 75);
+ CustomLabelCustomServersInfo.Name = "CustomLabelCustomServersInfo";
+ CustomLabelCustomServersInfo.RoundedCorners = 0;
+ CustomLabelCustomServersInfo.Size = new Size(218, 92);
+ CustomLabelCustomServersInfo.TabIndex = 6;
+ CustomLabelCustomServersInfo.Text = "Supported: DoH, DoT, DoQ, DNSCrypt.\r\nEach line one server. e.g:\r\n https://cloudflare-dns.com/dns-query\r\n tls://dns.google\r\n quic://dns.adguard.com\r\n sdns://";
//
// CustomButtonEditCustomServers
//
- this.CustomButtonEditCustomServers.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonEditCustomServers.AutoSize = true;
- this.CustomButtonEditCustomServers.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonEditCustomServers.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonEditCustomServers.Location = new System.Drawing.Point(25, 303);
- this.CustomButtonEditCustomServers.Name = "CustomButtonEditCustomServers";
- this.CustomButtonEditCustomServers.RoundedCorners = 5;
- this.CustomButtonEditCustomServers.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonEditCustomServers.Size = new System.Drawing.Size(121, 27);
- this.CustomButtonEditCustomServers.TabIndex = 5;
- this.CustomButtonEditCustomServers.Text = "Custom Servers";
- this.CustomButtonEditCustomServers.UseVisualStyleBackColor = true;
- this.CustomButtonEditCustomServers.Click += new System.EventHandler(this.CustomButtonEditCustomServers_Click);
+ CustomButtonEditCustomServers.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonEditCustomServers.BorderColor = Color.Blue;
+ CustomButtonEditCustomServers.FlatStyle = FlatStyle.Flat;
+ CustomButtonEditCustomServers.Location = new Point(6, 303);
+ CustomButtonEditCustomServers.Name = "CustomButtonEditCustomServers";
+ CustomButtonEditCustomServers.RoundedCorners = 5;
+ CustomButtonEditCustomServers.SelectionColor = Color.LightBlue;
+ CustomButtonEditCustomServers.Size = new Size(101, 27);
+ CustomButtonEditCustomServers.TabIndex = 5;
+ CustomButtonEditCustomServers.Text = "Custom Servers";
+ CustomButtonEditCustomServers.UseVisualStyleBackColor = true;
+ CustomButtonEditCustomServers.Click += CustomButtonEditCustomServers_Click;
//
// CustomRadioButtonCustom
//
- this.CustomRadioButtonCustom.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonCustom.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonCustom.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonCustom.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonCustom.Location = new System.Drawing.Point(25, 50);
- this.CustomRadioButtonCustom.Name = "CustomRadioButtonCustom";
- this.CustomRadioButtonCustom.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonCustom.Size = new System.Drawing.Size(125, 17);
- this.CustomRadioButtonCustom.TabIndex = 4;
- this.CustomRadioButtonCustom.TabStop = true;
- this.CustomRadioButtonCustom.Text = "Use custom servers";
- this.CustomRadioButtonCustom.UseVisualStyleBackColor = false;
- this.CustomRadioButtonCustom.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonCustom.BackColor = Color.DimGray;
+ CustomRadioButtonCustom.BorderColor = Color.Blue;
+ CustomRadioButtonCustom.CheckColor = Color.Blue;
+ CustomRadioButtonCustom.ForeColor = Color.White;
+ CustomRadioButtonCustom.Location = new Point(25, 50);
+ CustomRadioButtonCustom.Name = "CustomRadioButtonCustom";
+ CustomRadioButtonCustom.SelectionColor = Color.LightBlue;
+ CustomRadioButtonCustom.Size = new Size(125, 17);
+ CustomRadioButtonCustom.TabIndex = 4;
+ CustomRadioButtonCustom.TabStop = true;
+ CustomRadioButtonCustom.Text = "Use custom servers";
+ CustomRadioButtonCustom.UseVisualStyleBackColor = false;
+ CustomRadioButtonCustom.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomRadioButtonBuiltIn
//
- this.CustomRadioButtonBuiltIn.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonBuiltIn.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonBuiltIn.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonBuiltIn.Checked = true;
- this.CustomRadioButtonBuiltIn.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonBuiltIn.Location = new System.Drawing.Point(25, 20);
- this.CustomRadioButtonBuiltIn.Name = "CustomRadioButtonBuiltIn";
- this.CustomRadioButtonBuiltIn.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonBuiltIn.Size = new System.Drawing.Size(125, 17);
- this.CustomRadioButtonBuiltIn.TabIndex = 3;
- this.CustomRadioButtonBuiltIn.TabStop = true;
- this.CustomRadioButtonBuiltIn.Text = "Use built-in servers";
- this.CustomRadioButtonBuiltIn.UseVisualStyleBackColor = false;
- this.CustomRadioButtonBuiltIn.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonBuiltIn.BackColor = Color.DimGray;
+ CustomRadioButtonBuiltIn.BorderColor = Color.Blue;
+ CustomRadioButtonBuiltIn.CheckColor = Color.Blue;
+ CustomRadioButtonBuiltIn.Checked = true;
+ CustomRadioButtonBuiltIn.ForeColor = Color.White;
+ CustomRadioButtonBuiltIn.Location = new Point(25, 20);
+ CustomRadioButtonBuiltIn.Name = "CustomRadioButtonBuiltIn";
+ CustomRadioButtonBuiltIn.SelectionColor = Color.LightBlue;
+ CustomRadioButtonBuiltIn.Size = new Size(125, 17);
+ CustomRadioButtonBuiltIn.TabIndex = 3;
+ CustomRadioButtonBuiltIn.TabStop = true;
+ CustomRadioButtonBuiltIn.Text = "Use built-in servers";
+ CustomRadioButtonBuiltIn.UseVisualStyleBackColor = false;
+ CustomRadioButtonBuiltIn.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomLabelSSLFragmentSize
//
- this.CustomLabelSSLFragmentSize.AutoSize = true;
- this.CustomLabelSSLFragmentSize.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSSLFragmentSize.Border = false;
- this.CustomLabelSSLFragmentSize.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSSLFragmentSize.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSSLFragmentSize.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSSLFragmentSize.Location = new System.Drawing.Point(296, 95);
- this.CustomLabelSSLFragmentSize.Name = "CustomLabelSSLFragmentSize";
- this.CustomLabelSSLFragmentSize.RoundedCorners = 0;
- this.CustomLabelSSLFragmentSize.Size = new System.Drawing.Size(102, 15);
- this.CustomLabelSSLFragmentSize.TabIndex = 10;
- this.CustomLabelSSLFragmentSize.Text = "SSL fragment size:";
+ CustomLabelSSLFragmentSize.AutoSize = true;
+ CustomLabelSSLFragmentSize.BackColor = Color.DimGray;
+ CustomLabelSSLFragmentSize.Border = false;
+ CustomLabelSSLFragmentSize.BorderColor = Color.Blue;
+ CustomLabelSSLFragmentSize.FlatStyle = FlatStyle.Flat;
+ CustomLabelSSLFragmentSize.ForeColor = Color.White;
+ CustomLabelSSLFragmentSize.Location = new Point(296, 95);
+ CustomLabelSSLFragmentSize.Name = "CustomLabelSSLFragmentSize";
+ CustomLabelSSLFragmentSize.RoundedCorners = 0;
+ CustomLabelSSLFragmentSize.Size = new Size(102, 15);
+ CustomLabelSSLFragmentSize.TabIndex = 10;
+ CustomLabelSSLFragmentSize.Text = "SSL fragment size:";
//
// CustomNumericUpDownSSLFragmentSize
//
- this.CustomNumericUpDownSSLFragmentSize.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSSLFragmentSize.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSSLFragmentSize.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSSLFragmentSize.Location = new System.Drawing.Point(404, 93);
- this.CustomNumericUpDownSSLFragmentSize.Margin = new System.Windows.Forms.Padding(1);
- this.CustomNumericUpDownSSLFragmentSize.Maximum = new decimal(new int[] {
- 70000,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSSLFragmentSize.Name = "CustomNumericUpDownSSLFragmentSize";
- this.CustomNumericUpDownSSLFragmentSize.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownSSLFragmentSize.TabIndex = 9;
- this.CustomNumericUpDownSSLFragmentSize.Value = new decimal(new int[] {
- 40,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSSLFragmentSize.BackColor = Color.DimGray;
+ CustomNumericUpDownSSLFragmentSize.BorderColor = Color.Blue;
+ CustomNumericUpDownSSLFragmentSize.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSSLFragmentSize.Location = new Point(404, 93);
+ CustomNumericUpDownSSLFragmentSize.Margin = new Padding(1);
+ CustomNumericUpDownSSLFragmentSize.Maximum = new decimal(new int[] { 70000, 0, 0, 0 });
+ CustomNumericUpDownSSLFragmentSize.Name = "CustomNumericUpDownSSLFragmentSize";
+ CustomNumericUpDownSSLFragmentSize.Size = new Size(53, 23);
+ CustomNumericUpDownSSLFragmentSize.TabIndex = 9;
+ CustomNumericUpDownSSLFragmentSize.Value = new decimal(new int[] { 40, 0, 0, 0 });
//
// CustomTextBoxHTTPProxy
//
- this.CustomTextBoxHTTPProxy.AcceptsReturn = false;
- this.CustomTextBoxHTTPProxy.AcceptsTab = false;
- this.CustomTextBoxHTTPProxy.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxHTTPProxy.Border = true;
- this.CustomTextBoxHTTPProxy.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxHTTPProxy.BorderSize = 1;
- this.CustomTextBoxHTTPProxy.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxHTTPProxy.Enabled = false;
- this.CustomTextBoxHTTPProxy.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxHTTPProxy.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxHTTPProxy.HideSelection = true;
- this.CustomTextBoxHTTPProxy.Location = new System.Drawing.Point(312, 168);
- this.CustomTextBoxHTTPProxy.Margin = new System.Windows.Forms.Padding(1);
- this.CustomTextBoxHTTPProxy.MaxLength = 32767;
- this.CustomTextBoxHTTPProxy.Multiline = false;
- this.CustomTextBoxHTTPProxy.Name = "CustomTextBoxHTTPProxy";
- this.CustomTextBoxHTTPProxy.ReadOnly = false;
- this.CustomTextBoxHTTPProxy.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxHTTPProxy.ShortcutsEnabled = true;
- this.CustomTextBoxHTTPProxy.Size = new System.Drawing.Size(205, 23);
- this.CustomTextBoxHTTPProxy.TabIndex = 0;
- this.CustomTextBoxHTTPProxy.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxHTTPProxy.Texts = "";
- this.CustomTextBoxHTTPProxy.UnderlinedStyle = true;
- this.CustomTextBoxHTTPProxy.UsePasswordChar = false;
- this.CustomTextBoxHTTPProxy.WordWrap = true;
+ CustomTextBoxHTTPProxy.AcceptsReturn = false;
+ CustomTextBoxHTTPProxy.AcceptsTab = false;
+ CustomTextBoxHTTPProxy.BackColor = Color.DimGray;
+ CustomTextBoxHTTPProxy.Border = true;
+ CustomTextBoxHTTPProxy.BorderColor = Color.Blue;
+ CustomTextBoxHTTPProxy.BorderSize = 1;
+ CustomTextBoxHTTPProxy.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxHTTPProxy.Enabled = false;
+ CustomTextBoxHTTPProxy.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxHTTPProxy.ForeColor = Color.White;
+ CustomTextBoxHTTPProxy.HideSelection = true;
+ CustomTextBoxHTTPProxy.Location = new Point(312, 168);
+ CustomTextBoxHTTPProxy.Margin = new Padding(1);
+ CustomTextBoxHTTPProxy.MaxLength = 32767;
+ CustomTextBoxHTTPProxy.Multiline = false;
+ CustomTextBoxHTTPProxy.Name = "CustomTextBoxHTTPProxy";
+ CustomTextBoxHTTPProxy.ReadOnly = false;
+ CustomTextBoxHTTPProxy.ScrollBars = ScrollBars.None;
+ CustomTextBoxHTTPProxy.ShortcutsEnabled = true;
+ CustomTextBoxHTTPProxy.Size = new Size(205, 23);
+ CustomTextBoxHTTPProxy.TabIndex = 0;
+ CustomTextBoxHTTPProxy.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxHTTPProxy.Texts = "";
+ CustomTextBoxHTTPProxy.UnderlinedStyle = true;
+ CustomTextBoxHTTPProxy.UsePasswordChar = false;
+ CustomTextBoxHTTPProxy.WordWrap = true;
//
// CustomRadioButtonDPIModeExtreme
//
- this.CustomRadioButtonDPIModeExtreme.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIModeExtreme.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeExtreme.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeExtreme.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIModeExtreme.Location = new System.Drawing.Point(196, 95);
- this.CustomRadioButtonDPIModeExtreme.Margin = new System.Windows.Forms.Padding(1);
- this.CustomRadioButtonDPIModeExtreme.Name = "CustomRadioButtonDPIModeExtreme";
- this.CustomRadioButtonDPIModeExtreme.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIModeExtreme.Size = new System.Drawing.Size(64, 17);
- this.CustomRadioButtonDPIModeExtreme.TabIndex = 7;
- this.CustomRadioButtonDPIModeExtreme.Text = "Extreme";
- this.CustomRadioButtonDPIModeExtreme.UseVisualStyleBackColor = false;
- this.CustomRadioButtonDPIModeExtreme.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonDPIModeExtreme.BackColor = Color.DimGray;
+ CustomRadioButtonDPIModeExtreme.BorderColor = Color.Blue;
+ CustomRadioButtonDPIModeExtreme.CheckColor = Color.Blue;
+ CustomRadioButtonDPIModeExtreme.ForeColor = Color.White;
+ CustomRadioButtonDPIModeExtreme.Location = new Point(196, 95);
+ CustomRadioButtonDPIModeExtreme.Margin = new Padding(1);
+ CustomRadioButtonDPIModeExtreme.Name = "CustomRadioButtonDPIModeExtreme";
+ CustomRadioButtonDPIModeExtreme.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIModeExtreme.Size = new Size(64, 17);
+ CustomRadioButtonDPIModeExtreme.TabIndex = 7;
+ CustomRadioButtonDPIModeExtreme.Text = "Extreme";
+ CustomRadioButtonDPIModeExtreme.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIModeExtreme.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomRadioButtonDPIModeHigh
//
- this.CustomRadioButtonDPIModeHigh.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIModeHigh.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeHigh.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeHigh.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIModeHigh.Location = new System.Drawing.Point(147, 95);
- this.CustomRadioButtonDPIModeHigh.Margin = new System.Windows.Forms.Padding(1);
- this.CustomRadioButtonDPIModeHigh.Name = "CustomRadioButtonDPIModeHigh";
- this.CustomRadioButtonDPIModeHigh.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIModeHigh.Size = new System.Drawing.Size(47, 17);
- this.CustomRadioButtonDPIModeHigh.TabIndex = 6;
- this.CustomRadioButtonDPIModeHigh.Text = "High";
- this.CustomRadioButtonDPIModeHigh.UseVisualStyleBackColor = false;
- this.CustomRadioButtonDPIModeHigh.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonDPIModeHigh.BackColor = Color.DimGray;
+ CustomRadioButtonDPIModeHigh.BorderColor = Color.Blue;
+ CustomRadioButtonDPIModeHigh.CheckColor = Color.Blue;
+ CustomRadioButtonDPIModeHigh.ForeColor = Color.White;
+ CustomRadioButtonDPIModeHigh.Location = new Point(147, 95);
+ CustomRadioButtonDPIModeHigh.Margin = new Padding(1);
+ CustomRadioButtonDPIModeHigh.Name = "CustomRadioButtonDPIModeHigh";
+ CustomRadioButtonDPIModeHigh.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIModeHigh.Size = new Size(47, 17);
+ CustomRadioButtonDPIModeHigh.TabIndex = 6;
+ CustomRadioButtonDPIModeHigh.Text = "High";
+ CustomRadioButtonDPIModeHigh.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIModeHigh.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomRadioButtonDPIModeMedium
//
- this.CustomRadioButtonDPIModeMedium.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIModeMedium.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeMedium.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeMedium.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIModeMedium.Location = new System.Drawing.Point(79, 95);
- this.CustomRadioButtonDPIModeMedium.Margin = new System.Windows.Forms.Padding(1);
- this.CustomRadioButtonDPIModeMedium.Name = "CustomRadioButtonDPIModeMedium";
- this.CustomRadioButtonDPIModeMedium.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIModeMedium.Size = new System.Drawing.Size(66, 17);
- this.CustomRadioButtonDPIModeMedium.TabIndex = 5;
- this.CustomRadioButtonDPIModeMedium.Text = "Medium";
- this.CustomRadioButtonDPIModeMedium.UseVisualStyleBackColor = false;
- this.CustomRadioButtonDPIModeMedium.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonDPIModeMedium.BackColor = Color.DimGray;
+ CustomRadioButtonDPIModeMedium.BorderColor = Color.Blue;
+ CustomRadioButtonDPIModeMedium.CheckColor = Color.Blue;
+ CustomRadioButtonDPIModeMedium.ForeColor = Color.White;
+ CustomRadioButtonDPIModeMedium.Location = new Point(79, 95);
+ CustomRadioButtonDPIModeMedium.Margin = new Padding(1);
+ CustomRadioButtonDPIModeMedium.Name = "CustomRadioButtonDPIModeMedium";
+ CustomRadioButtonDPIModeMedium.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIModeMedium.Size = new Size(66, 17);
+ CustomRadioButtonDPIModeMedium.TabIndex = 5;
+ CustomRadioButtonDPIModeMedium.Text = "Medium";
+ CustomRadioButtonDPIModeMedium.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIModeMedium.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomRadioButtonDPIModeLight
//
- this.CustomRadioButtonDPIModeLight.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIModeLight.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeLight.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIModeLight.Checked = true;
- this.CustomRadioButtonDPIModeLight.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIModeLight.Location = new System.Drawing.Point(25, 95);
- this.CustomRadioButtonDPIModeLight.Margin = new System.Windows.Forms.Padding(1);
- this.CustomRadioButtonDPIModeLight.Name = "CustomRadioButtonDPIModeLight";
- this.CustomRadioButtonDPIModeLight.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIModeLight.Size = new System.Drawing.Size(48, 17);
- this.CustomRadioButtonDPIModeLight.TabIndex = 4;
- this.CustomRadioButtonDPIModeLight.TabStop = true;
- this.CustomRadioButtonDPIModeLight.Text = "Light";
- this.CustomRadioButtonDPIModeLight.UseVisualStyleBackColor = false;
- this.CustomRadioButtonDPIModeLight.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonDPIModeLight.BackColor = Color.DimGray;
+ CustomRadioButtonDPIModeLight.BorderColor = Color.Blue;
+ CustomRadioButtonDPIModeLight.CheckColor = Color.Blue;
+ CustomRadioButtonDPIModeLight.Checked = true;
+ CustomRadioButtonDPIModeLight.ForeColor = Color.White;
+ CustomRadioButtonDPIModeLight.Location = new Point(25, 95);
+ CustomRadioButtonDPIModeLight.Margin = new Padding(1);
+ CustomRadioButtonDPIModeLight.Name = "CustomRadioButtonDPIModeLight";
+ CustomRadioButtonDPIModeLight.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIModeLight.Size = new Size(48, 17);
+ CustomRadioButtonDPIModeLight.TabIndex = 4;
+ CustomRadioButtonDPIModeLight.TabStop = true;
+ CustomRadioButtonDPIModeLight.Text = "Light";
+ CustomRadioButtonDPIModeLight.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIModeLight.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomLabelDPIModes
//
- this.CustomLabelDPIModes.AutoSize = true;
- this.CustomLabelDPIModes.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelDPIModes.Border = false;
- this.CustomLabelDPIModes.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelDPIModes.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelDPIModes.ForeColor = System.Drawing.Color.White;
- this.CustomLabelDPIModes.Location = new System.Drawing.Point(25, 70);
- this.CustomLabelDPIModes.Name = "CustomLabelDPIModes";
- this.CustomLabelDPIModes.RoundedCorners = 0;
- this.CustomLabelDPIModes.Size = new System.Drawing.Size(75, 15);
- this.CustomLabelDPIModes.TabIndex = 3;
- this.CustomLabelDPIModes.Text = "Select mode:";
+ CustomLabelDPIModes.AutoSize = true;
+ CustomLabelDPIModes.BackColor = Color.DimGray;
+ CustomLabelDPIModes.Border = false;
+ CustomLabelDPIModes.BorderColor = Color.Blue;
+ CustomLabelDPIModes.FlatStyle = FlatStyle.Flat;
+ CustomLabelDPIModes.ForeColor = Color.White;
+ CustomLabelDPIModes.Location = new Point(25, 70);
+ CustomLabelDPIModes.Name = "CustomLabelDPIModes";
+ CustomLabelDPIModes.RoundedCorners = 0;
+ CustomLabelDPIModes.Size = new Size(75, 15);
+ CustomLabelDPIModes.TabIndex = 3;
+ CustomLabelDPIModes.Text = "Select mode:";
//
// CustomButtonConnect
//
- this.CustomButtonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonConnect.AutoSize = true;
- this.CustomButtonConnect.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonConnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonConnect.Location = new System.Drawing.Point(40, 303);
- this.CustomButtonConnect.Name = "CustomButtonConnect";
- this.CustomButtonConnect.RoundedCorners = 5;
- this.CustomButtonConnect.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonConnect.Size = new System.Drawing.Size(128, 27);
- this.CustomButtonConnect.TabIndex = 1;
- this.CustomButtonConnect.Text = "Connect/Disconnect";
- this.CustomButtonConnect.UseVisualStyleBackColor = true;
- this.CustomButtonConnect.Click += new System.EventHandler(this.CustomButtonConnect_Click);
+ CustomButtonConnect.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonConnect.BorderColor = Color.Blue;
+ CustomButtonConnect.FlatStyle = FlatStyle.Flat;
+ CustomButtonConnect.Location = new Point(40, 303);
+ CustomButtonConnect.Name = "CustomButtonConnect";
+ CustomButtonConnect.RoundedCorners = 5;
+ CustomButtonConnect.SelectionColor = Color.LightBlue;
+ CustomButtonConnect.Size = new Size(104, 27);
+ CustomButtonConnect.TabIndex = 1;
+ CustomButtonConnect.Text = "Disconnecting...";
+ CustomButtonConnect.UseVisualStyleBackColor = true;
+ CustomButtonConnect.Click += CustomButtonConnect_Click;
//
// CustomTabControlMain
//
- this.CustomTabControlMain.BorderColor = System.Drawing.Color.Blue;
- this.CustomTabControlMain.Controls.Add(this.TabPageSecureDNS);
- this.CustomTabControlMain.Controls.Add(this.TabPageTools);
- this.CustomTabControlMain.Controls.Add(this.TabPageSettings);
- this.CustomTabControlMain.Controls.Add(this.TabPageAbout);
- this.CustomTabControlMain.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomTabControlMain.HideTabHeader = false;
- this.CustomTabControlMain.ItemSize = new System.Drawing.Size(90, 21);
- this.CustomTabControlMain.Location = new System.Drawing.Point(0, 0);
- this.CustomTabControlMain.Margin = new System.Windows.Forms.Padding(0);
- this.CustomTabControlMain.Name = "CustomTabControlMain";
- this.CustomTabControlMain.SelectedIndex = 0;
- this.CustomTabControlMain.Size = new System.Drawing.Size(700, 400);
- this.CustomTabControlMain.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
- this.CustomTabControlMain.TabIndex = 6;
- this.CustomTabControlMain.Tag = 3;
+ CustomTabControlMain.BorderColor = Color.Blue;
+ CustomTabControlMain.Controls.Add(TabPageSecureDNS);
+ CustomTabControlMain.Controls.Add(TabPageTools);
+ CustomTabControlMain.Controls.Add(TabPageSettings);
+ CustomTabControlMain.Controls.Add(TabPageAbout);
+ CustomTabControlMain.Dock = DockStyle.Fill;
+ CustomTabControlMain.HideTabHeader = false;
+ CustomTabControlMain.ItemSize = new Size(90, 21);
+ CustomTabControlMain.Location = new Point(0, 0);
+ CustomTabControlMain.Margin = new Padding(0);
+ CustomTabControlMain.Name = "CustomTabControlMain";
+ CustomTabControlMain.SelectedIndex = 0;
+ CustomTabControlMain.Size = new Size(700, 400);
+ CustomTabControlMain.SizeMode = TabSizeMode.Fixed;
+ CustomTabControlMain.TabIndex = 6;
+ CustomTabControlMain.Tag = 0;
//
// TabPageSecureDNS
//
- this.TabPageSecureDNS.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSecureDNS.Controls.Add(this.CustomTabControlSecureDNS);
- this.TabPageSecureDNS.Location = new System.Drawing.Point(4, 25);
- this.TabPageSecureDNS.Name = "TabPageSecureDNS";
- this.TabPageSecureDNS.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSecureDNS.Size = new System.Drawing.Size(692, 371);
- this.TabPageSecureDNS.TabIndex = 0;
- this.TabPageSecureDNS.Tag = 0;
- this.TabPageSecureDNS.Text = "Secure DNS";
+ TabPageSecureDNS.BackColor = Color.Transparent;
+ TabPageSecureDNS.Controls.Add(CustomTabControlSecureDNS);
+ TabPageSecureDNS.Location = new Point(4, 25);
+ TabPageSecureDNS.Name = "TabPageSecureDNS";
+ TabPageSecureDNS.Padding = new Padding(3);
+ TabPageSecureDNS.Size = new Size(692, 371);
+ TabPageSecureDNS.TabIndex = 0;
+ TabPageSecureDNS.Tag = 0;
+ TabPageSecureDNS.Text = "Secure DNS";
//
// CustomTabControlSecureDNS
//
- this.CustomTabControlSecureDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomTabControlSecureDNS.Controls.Add(this.TabPageCheck);
- this.CustomTabControlSecureDNS.Controls.Add(this.TabPageConnect);
- this.CustomTabControlSecureDNS.Controls.Add(this.TabPageSetDNS);
- this.CustomTabControlSecureDNS.Controls.Add(this.TabPageShare);
- this.CustomTabControlSecureDNS.Controls.Add(this.TabPageGoodbyeDPI);
- this.CustomTabControlSecureDNS.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomTabControlSecureDNS.HideTabHeader = false;
- this.CustomTabControlSecureDNS.ItemSize = new System.Drawing.Size(120, 21);
- this.CustomTabControlSecureDNS.Location = new System.Drawing.Point(3, 3);
- this.CustomTabControlSecureDNS.Name = "CustomTabControlSecureDNS";
- this.CustomTabControlSecureDNS.SelectedIndex = 0;
- this.CustomTabControlSecureDNS.Size = new System.Drawing.Size(686, 365);
- this.CustomTabControlSecureDNS.TabIndex = 0;
- this.CustomTabControlSecureDNS.Tag = 0;
+ CustomTabControlSecureDNS.BorderColor = Color.Blue;
+ CustomTabControlSecureDNS.Controls.Add(TabPageCheck);
+ CustomTabControlSecureDNS.Controls.Add(TabPageConnect);
+ CustomTabControlSecureDNS.Controls.Add(TabPageSetDNS);
+ CustomTabControlSecureDNS.Controls.Add(TabPageShare);
+ CustomTabControlSecureDNS.Controls.Add(TabPageGoodbyeDPI);
+ CustomTabControlSecureDNS.Dock = DockStyle.Fill;
+ CustomTabControlSecureDNS.HideTabHeader = false;
+ CustomTabControlSecureDNS.ItemSize = new Size(120, 21);
+ CustomTabControlSecureDNS.Location = new Point(3, 3);
+ CustomTabControlSecureDNS.Name = "CustomTabControlSecureDNS";
+ CustomTabControlSecureDNS.SelectedIndex = 0;
+ CustomTabControlSecureDNS.Size = new Size(686, 365);
+ CustomTabControlSecureDNS.TabIndex = 0;
+ CustomTabControlSecureDNS.Tag = 0;
//
// TabPageCheck
//
- this.TabPageCheck.BackColor = System.Drawing.Color.Transparent;
- this.TabPageCheck.Controls.Add(this.CustomProgressBarCheck);
- this.TabPageCheck.Controls.Add(this.LinkLabelCheckUpdate);
- this.TabPageCheck.Controls.Add(this.CustomButtonCheckUpdate);
- this.TabPageCheck.Controls.Add(this.CustomCheckBoxCheckInParallel);
- this.TabPageCheck.Controls.Add(this.CustomButtonConnectAll);
- this.TabPageCheck.Controls.Add(this.CustomButtonCheck);
- this.TabPageCheck.Controls.Add(this.CustomButtonEditCustomServers);
- this.TabPageCheck.Controls.Add(this.CustomCheckBoxInsecure);
- this.TabPageCheck.Controls.Add(this.CustomRadioButtonBuiltIn);
- this.TabPageCheck.Controls.Add(this.CustomLabelCustomServersInfo);
- this.TabPageCheck.Controls.Add(this.CustomRadioButtonCustom);
- this.TabPageCheck.Location = new System.Drawing.Point(4, 25);
- this.TabPageCheck.Name = "TabPageCheck";
- this.TabPageCheck.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageCheck.Size = new System.Drawing.Size(678, 336);
- this.TabPageCheck.TabIndex = 0;
- this.TabPageCheck.Tag = 0;
- this.TabPageCheck.Text = "1. Check";
+ TabPageCheck.BackColor = Color.Transparent;
+ TabPageCheck.Controls.Add(CustomButtonQuickConnect);
+ TabPageCheck.Controls.Add(CustomProgressBarCheck);
+ TabPageCheck.Controls.Add(LinkLabelCheckUpdate);
+ TabPageCheck.Controls.Add(CustomButtonCheckUpdate);
+ TabPageCheck.Controls.Add(CustomCheckBoxCheckInParallel);
+ TabPageCheck.Controls.Add(CustomButtonCheck);
+ TabPageCheck.Controls.Add(CustomButtonEditCustomServers);
+ TabPageCheck.Controls.Add(CustomCheckBoxInsecure);
+ TabPageCheck.Controls.Add(CustomRadioButtonBuiltIn);
+ TabPageCheck.Controls.Add(CustomLabelCustomServersInfo);
+ TabPageCheck.Controls.Add(CustomRadioButtonCustom);
+ TabPageCheck.Location = new Point(4, 25);
+ TabPageCheck.Name = "TabPageCheck";
+ TabPageCheck.Padding = new Padding(3);
+ TabPageCheck.Size = new Size(678, 336);
+ TabPageCheck.TabIndex = 0;
+ TabPageCheck.Tag = 0;
+ TabPageCheck.Text = "1. Check";
+ //
+ // CustomButtonQuickConnect
+ //
+ CustomButtonQuickConnect.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonQuickConnect.BorderColor = Color.Blue;
+ CustomButtonQuickConnect.FlatStyle = FlatStyle.Flat;
+ CustomButtonQuickConnect.Location = new Point(195, 303);
+ CustomButtonQuickConnect.Name = "CustomButtonQuickConnect";
+ CustomButtonQuickConnect.RoundedCorners = 5;
+ CustomButtonQuickConnect.SelectionColor = Color.LightBlue;
+ CustomButtonQuickConnect.Size = new Size(98, 27);
+ CustomButtonQuickConnect.TabIndex = 17;
+ CustomButtonQuickConnect.Text = "Quick Connect";
+ CustomButtonQuickConnect.UseVisualStyleBackColor = true;
+ CustomButtonQuickConnect.Click += CustomButtonQuickConnect_Click;
//
// CustomProgressBarCheck
//
- this.CustomProgressBarCheck.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomProgressBarCheck.BackColor = System.Drawing.Color.DimGray;
- this.CustomProgressBarCheck.BorderColor = System.Drawing.Color.Blue;
- this.CustomProgressBarCheck.ChunksColor = System.Drawing.Color.LightBlue;
- this.CustomProgressBarCheck.CustomText = "";
- this.CustomProgressBarCheck.ForeColor = System.Drawing.Color.White;
- this.CustomProgressBarCheck.Location = new System.Drawing.Point(266, 303);
- this.CustomProgressBarCheck.Name = "CustomProgressBarCheck";
- this.CustomProgressBarCheck.RoundedCorners = 5;
- this.CustomProgressBarCheck.Size = new System.Drawing.Size(300, 27);
- this.CustomProgressBarCheck.StopTimer = false;
- this.CustomProgressBarCheck.TabIndex = 16;
+ CustomProgressBarCheck.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ CustomProgressBarCheck.BackColor = Color.DimGray;
+ CustomProgressBarCheck.BorderColor = Color.Blue;
+ CustomProgressBarCheck.ChunksColor = Color.LightBlue;
+ CustomProgressBarCheck.CustomText = "";
+ CustomProgressBarCheck.ForeColor = Color.White;
+ CustomProgressBarCheck.Location = new Point(299, 303);
+ CustomProgressBarCheck.Name = "CustomProgressBarCheck";
+ CustomProgressBarCheck.RoundedCorners = 5;
+ CustomProgressBarCheck.Size = new Size(274, 27);
+ CustomProgressBarCheck.StopTimer = false;
+ CustomProgressBarCheck.TabIndex = 16;
//
// LinkLabelCheckUpdate
//
- this.LinkLabelCheckUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.LinkLabelCheckUpdate.AutoSize = true;
- this.LinkLabelCheckUpdate.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
- this.LinkLabelCheckUpdate.Location = new System.Drawing.Point(500, 280);
- this.LinkLabelCheckUpdate.Name = "LinkLabelCheckUpdate";
- this.LinkLabelCheckUpdate.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
- this.LinkLabelCheckUpdate.Size = new System.Drawing.Size(173, 15);
- this.LinkLabelCheckUpdate.TabIndex = 15;
- this.LinkLabelCheckUpdate.TabStop = true;
- this.LinkLabelCheckUpdate.Text = "There is a new version v00.00.00";
+ LinkLabelCheckUpdate.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ LinkLabelCheckUpdate.AutoSize = true;
+ LinkLabelCheckUpdate.LinkBehavior = LinkBehavior.NeverUnderline;
+ LinkLabelCheckUpdate.Location = new Point(502, 280);
+ LinkLabelCheckUpdate.Name = "LinkLabelCheckUpdate";
+ LinkLabelCheckUpdate.RightToLeft = RightToLeft.Yes;
+ LinkLabelCheckUpdate.Size = new Size(173, 15);
+ LinkLabelCheckUpdate.TabIndex = 15;
+ LinkLabelCheckUpdate.TabStop = true;
+ LinkLabelCheckUpdate.Text = "There is a new version v00.00.00";
//
// CustomButtonCheckUpdate
//
- this.CustomButtonCheckUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomButtonCheckUpdate.AutoSize = true;
- this.CustomButtonCheckUpdate.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonCheckUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonCheckUpdate.Location = new System.Drawing.Point(579, 303);
- this.CustomButtonCheckUpdate.Name = "CustomButtonCheckUpdate";
- this.CustomButtonCheckUpdate.RoundedCorners = 5;
- this.CustomButtonCheckUpdate.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonCheckUpdate.Size = new System.Drawing.Size(93, 27);
- this.CustomButtonCheckUpdate.TabIndex = 13;
- this.CustomButtonCheckUpdate.Text = "Check Update";
- this.CustomButtonCheckUpdate.UseVisualStyleBackColor = true;
- this.CustomButtonCheckUpdate.Click += new System.EventHandler(this.CustomButtonCheckUpdate_Click);
+ CustomButtonCheckUpdate.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ CustomButtonCheckUpdate.BorderColor = Color.Blue;
+ CustomButtonCheckUpdate.FlatStyle = FlatStyle.Flat;
+ CustomButtonCheckUpdate.Location = new Point(579, 303);
+ CustomButtonCheckUpdate.Name = "CustomButtonCheckUpdate";
+ CustomButtonCheckUpdate.RoundedCorners = 5;
+ CustomButtonCheckUpdate.SelectionColor = Color.LightBlue;
+ CustomButtonCheckUpdate.Size = new Size(93, 27);
+ CustomButtonCheckUpdate.TabIndex = 13;
+ CustomButtonCheckUpdate.Text = "Check Update";
+ CustomButtonCheckUpdate.UseVisualStyleBackColor = true;
+ CustomButtonCheckUpdate.Click += CustomButtonCheckUpdate_Click;
//
// CustomCheckBoxCheckInParallel
//
- this.CustomCheckBoxCheckInParallel.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxCheckInParallel.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxCheckInParallel.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxCheckInParallel.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxCheckInParallel.Location = new System.Drawing.Point(25, 190);
- this.CustomCheckBoxCheckInParallel.Name = "CustomCheckBoxCheckInParallel";
- this.CustomCheckBoxCheckInParallel.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxCheckInParallel.Size = new System.Drawing.Size(110, 17);
- this.CustomCheckBoxCheckInParallel.TabIndex = 12;
- this.CustomCheckBoxCheckInParallel.Text = "Check in parallel";
- this.CustomCheckBoxCheckInParallel.UseVisualStyleBackColor = false;
- //
- // CustomButtonConnectAll
- //
- this.CustomButtonConnectAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomButtonConnectAll.AutoSize = true;
- this.CustomButtonConnectAll.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonConnectAll.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonConnectAll.Location = new System.Drawing.Point(514, 212);
- this.CustomButtonConnectAll.Name = "CustomButtonConnectAll";
- this.CustomButtonConnectAll.RoundedCorners = 5;
- this.CustomButtonConnectAll.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonConnectAll.Size = new System.Drawing.Size(158, 27);
- this.CustomButtonConnectAll.TabIndex = 9;
- this.CustomButtonConnectAll.Text = "Connect all/Disconnect all";
- this.CustomButtonConnectAll.UseVisualStyleBackColor = true;
- this.CustomButtonConnectAll.Visible = false;
- this.CustomButtonConnectAll.Click += new System.EventHandler(this.CustomButtonConnectAll_Click);
+ CustomCheckBoxCheckInParallel.BackColor = Color.DimGray;
+ CustomCheckBoxCheckInParallel.BorderColor = Color.Blue;
+ CustomCheckBoxCheckInParallel.CheckColor = Color.Blue;
+ CustomCheckBoxCheckInParallel.ForeColor = Color.White;
+ CustomCheckBoxCheckInParallel.Location = new Point(25, 190);
+ CustomCheckBoxCheckInParallel.Name = "CustomCheckBoxCheckInParallel";
+ CustomCheckBoxCheckInParallel.SelectionColor = Color.LightBlue;
+ CustomCheckBoxCheckInParallel.Size = new Size(110, 17);
+ CustomCheckBoxCheckInParallel.TabIndex = 12;
+ CustomCheckBoxCheckInParallel.Text = "Check in parallel";
+ CustomCheckBoxCheckInParallel.UseVisualStyleBackColor = false;
//
// TabPageConnect
//
- this.TabPageConnect.BackColor = System.Drawing.Color.Transparent;
- this.TabPageConnect.Controls.Add(this.CustomButtonWriteSavedServersDelay);
- this.TabPageConnect.Controls.Add(this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI);
- this.TabPageConnect.Controls.Add(this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI);
- this.TabPageConnect.Controls.Add(this.CustomRadioButtonConnectCheckedServers);
- this.TabPageConnect.Controls.Add(this.CustomRadioButtonConnectDNSCrypt);
- this.TabPageConnect.Controls.Add(this.CustomTextBoxHTTPProxy);
- this.TabPageConnect.Controls.Add(this.CustomButtonConnect);
- this.TabPageConnect.Location = new System.Drawing.Point(4, 25);
- this.TabPageConnect.Name = "TabPageConnect";
- this.TabPageConnect.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageConnect.Size = new System.Drawing.Size(678, 336);
- this.TabPageConnect.TabIndex = 1;
- this.TabPageConnect.Tag = 1;
- this.TabPageConnect.Text = "2. Connect";
+ TabPageConnect.BackColor = Color.Transparent;
+ TabPageConnect.Controls.Add(CustomButtonWriteSavedServersDelay);
+ TabPageConnect.Controls.Add(CustomRadioButtonConnectFakeProxyDohViaProxyDPI);
+ TabPageConnect.Controls.Add(CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI);
+ TabPageConnect.Controls.Add(CustomRadioButtonConnectCheckedServers);
+ TabPageConnect.Controls.Add(CustomRadioButtonConnectDNSCrypt);
+ TabPageConnect.Controls.Add(CustomTextBoxHTTPProxy);
+ TabPageConnect.Controls.Add(CustomButtonConnect);
+ TabPageConnect.Location = new Point(4, 25);
+ TabPageConnect.Name = "TabPageConnect";
+ TabPageConnect.Padding = new Padding(3);
+ TabPageConnect.Size = new Size(678, 336);
+ TabPageConnect.TabIndex = 1;
+ TabPageConnect.Tag = 1;
+ TabPageConnect.Text = "2. Connect";
//
// CustomButtonWriteSavedServersDelay
//
- this.CustomButtonWriteSavedServersDelay.AutoSize = true;
- this.CustomButtonWriteSavedServersDelay.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonWriteSavedServersDelay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonWriteSavedServersDelay.Location = new System.Drawing.Point(200, 29);
- this.CustomButtonWriteSavedServersDelay.Name = "CustomButtonWriteSavedServersDelay";
- this.CustomButtonWriteSavedServersDelay.RoundedCorners = 5;
- this.CustomButtonWriteSavedServersDelay.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonWriteSavedServersDelay.Size = new System.Drawing.Size(140, 27);
- this.CustomButtonWriteSavedServersDelay.TabIndex = 19;
- this.CustomButtonWriteSavedServersDelay.Text = "Get saved servers delay";
- this.CustomButtonWriteSavedServersDelay.UseVisualStyleBackColor = true;
- this.CustomButtonWriteSavedServersDelay.Click += new System.EventHandler(this.CustomButtonWriteSavedServersDelay_Click);
+ CustomButtonWriteSavedServersDelay.BorderColor = Color.Blue;
+ CustomButtonWriteSavedServersDelay.FlatStyle = FlatStyle.Flat;
+ CustomButtonWriteSavedServersDelay.Location = new Point(200, 29);
+ CustomButtonWriteSavedServersDelay.Name = "CustomButtonWriteSavedServersDelay";
+ CustomButtonWriteSavedServersDelay.RoundedCorners = 5;
+ CustomButtonWriteSavedServersDelay.SelectionColor = Color.LightBlue;
+ CustomButtonWriteSavedServersDelay.Size = new Size(140, 27);
+ CustomButtonWriteSavedServersDelay.TabIndex = 19;
+ CustomButtonWriteSavedServersDelay.Text = "Get saved servers delay";
+ CustomButtonWriteSavedServersDelay.UseVisualStyleBackColor = true;
+ CustomButtonWriteSavedServersDelay.Click += CustomButtonWriteSavedServersDelay_Click;
//
// CustomRadioButtonConnectFakeProxyDohViaProxyDPI
//
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Location = new System.Drawing.Point(25, 80);
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Name = "CustomRadioButtonConnectFakeProxyDohViaProxyDPI";
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Size = new System.Drawing.Size(421, 17);
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.TabIndex = 17;
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.TabStop = true;
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Text = "Connect to Fake Proxy DoH using ProxyDPI (Gets settings from Share tab)";
- this.CustomRadioButtonConnectFakeProxyDohViaProxyDPI.UseVisualStyleBackColor = false;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.BackColor = Color.DimGray;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.BorderColor = Color.Blue;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.CheckColor = Color.Blue;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.ForeColor = Color.White;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Location = new Point(25, 80);
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Name = "CustomRadioButtonConnectFakeProxyDohViaProxyDPI";
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.SelectionColor = Color.LightBlue;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Size = new Size(421, 17);
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.TabIndex = 17;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.TabStop = true;
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.Text = "Connect to Fake Proxy DoH using ProxyDPI (Gets settings from Share tab)";
+ CustomRadioButtonConnectFakeProxyDohViaProxyDPI.UseVisualStyleBackColor = false;
//
// CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI
//
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Location = new System.Drawing.Point(25, 125);
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Name = "CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI";
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Size = new System.Drawing.Size(395, 17);
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.TabIndex = 15;
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Text = "Connect to Fake Proxy DoH using GoodbyeDPI (Light & User Choice)";
- this.CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.UseVisualStyleBackColor = false;
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.BackColor = Color.DimGray;
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.BorderColor = Color.Blue;
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.CheckColor = Color.Blue;
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.ForeColor = Color.White;
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Location = new Point(25, 125);
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Name = "CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI";
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.SelectionColor = Color.LightBlue;
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Size = new Size(395, 17);
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.TabIndex = 15;
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.Text = "Connect to Fake Proxy DoH using GoodbyeDPI (Light & User Choice)";
+ CustomRadioButtonConnectFakeProxyDohViaGoodbyeDPI.UseVisualStyleBackColor = false;
//
// CustomRadioButtonConnectCheckedServers
//
- this.CustomRadioButtonConnectCheckedServers.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonConnectCheckedServers.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectCheckedServers.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectCheckedServers.Checked = true;
- this.CustomRadioButtonConnectCheckedServers.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonConnectCheckedServers.Location = new System.Drawing.Point(25, 35);
- this.CustomRadioButtonConnectCheckedServers.Name = "CustomRadioButtonConnectCheckedServers";
- this.CustomRadioButtonConnectCheckedServers.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonConnectCheckedServers.Size = new System.Drawing.Size(169, 17);
- this.CustomRadioButtonConnectCheckedServers.TabIndex = 14;
- this.CustomRadioButtonConnectCheckedServers.TabStop = true;
- this.CustomRadioButtonConnectCheckedServers.Text = "Connect to working servers";
- this.CustomRadioButtonConnectCheckedServers.UseVisualStyleBackColor = false;
+ CustomRadioButtonConnectCheckedServers.BackColor = Color.DimGray;
+ CustomRadioButtonConnectCheckedServers.BorderColor = Color.Blue;
+ CustomRadioButtonConnectCheckedServers.CheckColor = Color.Blue;
+ CustomRadioButtonConnectCheckedServers.Checked = true;
+ CustomRadioButtonConnectCheckedServers.ForeColor = Color.White;
+ CustomRadioButtonConnectCheckedServers.Location = new Point(25, 35);
+ CustomRadioButtonConnectCheckedServers.Name = "CustomRadioButtonConnectCheckedServers";
+ CustomRadioButtonConnectCheckedServers.SelectionColor = Color.LightBlue;
+ CustomRadioButtonConnectCheckedServers.Size = new Size(169, 17);
+ CustomRadioButtonConnectCheckedServers.TabIndex = 14;
+ CustomRadioButtonConnectCheckedServers.TabStop = true;
+ CustomRadioButtonConnectCheckedServers.Text = "Connect to working servers";
+ CustomRadioButtonConnectCheckedServers.UseVisualStyleBackColor = false;
//
// CustomRadioButtonConnectDNSCrypt
//
- this.CustomRadioButtonConnectDNSCrypt.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonConnectDNSCrypt.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectDNSCrypt.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonConnectDNSCrypt.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonConnectDNSCrypt.Location = new System.Drawing.Point(25, 170);
- this.CustomRadioButtonConnectDNSCrypt.Name = "CustomRadioButtonConnectDNSCrypt";
- this.CustomRadioButtonConnectDNSCrypt.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonConnectDNSCrypt.Size = new System.Drawing.Size(283, 17);
- this.CustomRadioButtonConnectDNSCrypt.TabIndex = 13;
- this.CustomRadioButtonConnectDNSCrypt.Text = "Connect to popular servers using HTTP(S) proxy:";
- this.CustomRadioButtonConnectDNSCrypt.UseVisualStyleBackColor = false;
- this.CustomRadioButtonConnectDNSCrypt.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonConnectDNSCrypt.BackColor = Color.DimGray;
+ CustomRadioButtonConnectDNSCrypt.BorderColor = Color.Blue;
+ CustomRadioButtonConnectDNSCrypt.CheckColor = Color.Blue;
+ CustomRadioButtonConnectDNSCrypt.ForeColor = Color.White;
+ CustomRadioButtonConnectDNSCrypt.Location = new Point(25, 170);
+ CustomRadioButtonConnectDNSCrypt.Name = "CustomRadioButtonConnectDNSCrypt";
+ CustomRadioButtonConnectDNSCrypt.SelectionColor = Color.LightBlue;
+ CustomRadioButtonConnectDNSCrypt.Size = new Size(283, 17);
+ CustomRadioButtonConnectDNSCrypt.TabIndex = 13;
+ CustomRadioButtonConnectDNSCrypt.Text = "Connect to popular servers using HTTP(S) proxy:";
+ CustomRadioButtonConnectDNSCrypt.UseVisualStyleBackColor = false;
+ CustomRadioButtonConnectDNSCrypt.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// TabPageSetDNS
//
- this.TabPageSetDNS.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSetDNS.Controls.Add(this.CustomButtonSetDNS);
- this.TabPageSetDNS.Controls.Add(this.CustomLabelSelectNIC);
- this.TabPageSetDNS.Controls.Add(this.CustomLabelSetDNSInfo);
- this.TabPageSetDNS.Controls.Add(this.CustomComboBoxNICs);
- this.TabPageSetDNS.Location = new System.Drawing.Point(4, 25);
- this.TabPageSetDNS.Name = "TabPageSetDNS";
- this.TabPageSetDNS.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSetDNS.Size = new System.Drawing.Size(678, 336);
- this.TabPageSetDNS.TabIndex = 3;
- this.TabPageSetDNS.Tag = 2;
- this.TabPageSetDNS.Text = "3. Set DNS";
+ TabPageSetDNS.BackColor = Color.Transparent;
+ TabPageSetDNS.Controls.Add(CustomButtonSetDNS);
+ TabPageSetDNS.Controls.Add(CustomLabelSelectNIC);
+ TabPageSetDNS.Controls.Add(CustomLabelSetDNSInfo);
+ TabPageSetDNS.Controls.Add(CustomComboBoxNICs);
+ TabPageSetDNS.Location = new Point(4, 25);
+ TabPageSetDNS.Name = "TabPageSetDNS";
+ TabPageSetDNS.Padding = new Padding(3);
+ TabPageSetDNS.Size = new Size(678, 336);
+ TabPageSetDNS.TabIndex = 3;
+ TabPageSetDNS.Tag = 2;
+ TabPageSetDNS.Text = "3. Set DNS";
//
// CustomButtonSetDNS
//
- this.CustomButtonSetDNS.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonSetDNS.AutoSize = true;
- this.CustomButtonSetDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonSetDNS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonSetDNS.Location = new System.Drawing.Point(40, 303);
- this.CustomButtonSetDNS.Name = "CustomButtonSetDNS";
- this.CustomButtonSetDNS.RoundedCorners = 5;
- this.CustomButtonSetDNS.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonSetDNS.Size = new System.Drawing.Size(71, 27);
- this.CustomButtonSetDNS.TabIndex = 3;
- this.CustomButtonSetDNS.Text = "Set/Unset";
- this.CustomButtonSetDNS.UseVisualStyleBackColor = true;
- this.CustomButtonSetDNS.Click += new System.EventHandler(this.CustomButtonSetDNS_Click);
+ CustomButtonSetDNS.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonSetDNS.BorderColor = Color.Blue;
+ CustomButtonSetDNS.FlatStyle = FlatStyle.Flat;
+ CustomButtonSetDNS.Location = new Point(40, 303);
+ CustomButtonSetDNS.Name = "CustomButtonSetDNS";
+ CustomButtonSetDNS.RoundedCorners = 5;
+ CustomButtonSetDNS.SelectionColor = Color.LightBlue;
+ CustomButtonSetDNS.Size = new Size(75, 27);
+ CustomButtonSetDNS.TabIndex = 3;
+ CustomButtonSetDNS.Text = "Unset DNS";
+ CustomButtonSetDNS.UseVisualStyleBackColor = true;
+ CustomButtonSetDNS.Click += CustomButtonSetDNS_Click;
//
// CustomLabelSelectNIC
//
- this.CustomLabelSelectNIC.AutoSize = true;
- this.CustomLabelSelectNIC.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSelectNIC.Border = false;
- this.CustomLabelSelectNIC.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSelectNIC.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSelectNIC.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSelectNIC.Location = new System.Drawing.Point(25, 25);
- this.CustomLabelSelectNIC.Name = "CustomLabelSelectNIC";
- this.CustomLabelSelectNIC.RoundedCorners = 0;
- this.CustomLabelSelectNIC.Size = new System.Drawing.Size(135, 15);
- this.CustomLabelSelectNIC.TabIndex = 0;
- this.CustomLabelSelectNIC.Text = "Select Network Interface";
+ CustomLabelSelectNIC.AutoSize = true;
+ CustomLabelSelectNIC.BackColor = Color.DimGray;
+ CustomLabelSelectNIC.Border = false;
+ CustomLabelSelectNIC.BorderColor = Color.Blue;
+ CustomLabelSelectNIC.FlatStyle = FlatStyle.Flat;
+ CustomLabelSelectNIC.ForeColor = Color.White;
+ CustomLabelSelectNIC.Location = new Point(25, 25);
+ CustomLabelSelectNIC.Name = "CustomLabelSelectNIC";
+ CustomLabelSelectNIC.RoundedCorners = 0;
+ CustomLabelSelectNIC.Size = new Size(135, 15);
+ CustomLabelSelectNIC.TabIndex = 0;
+ CustomLabelSelectNIC.Text = "Select Network Interface";
//
// CustomLabelSetDNSInfo
//
- this.CustomLabelSetDNSInfo.AutoSize = true;
- this.CustomLabelSetDNSInfo.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSetDNSInfo.Border = false;
- this.CustomLabelSetDNSInfo.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSetDNSInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSetDNSInfo.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSetDNSInfo.Location = new System.Drawing.Point(25, 100);
- this.CustomLabelSetDNSInfo.Name = "CustomLabelSetDNSInfo";
- this.CustomLabelSetDNSInfo.RoundedCorners = 0;
- this.CustomLabelSetDNSInfo.Size = new System.Drawing.Size(220, 45);
- this.CustomLabelSetDNSInfo.TabIndex = 2;
- this.CustomLabelSetDNSInfo.Text = "You have two options:\r\n1. Set DNS to Windows by below button.\r\n2. Set DoH to Fire" +
- "fox manually.";
+ CustomLabelSetDNSInfo.AutoSize = true;
+ CustomLabelSetDNSInfo.BackColor = Color.DimGray;
+ CustomLabelSetDNSInfo.Border = false;
+ CustomLabelSetDNSInfo.BorderColor = Color.Blue;
+ CustomLabelSetDNSInfo.FlatStyle = FlatStyle.Flat;
+ CustomLabelSetDNSInfo.ForeColor = Color.White;
+ CustomLabelSetDNSInfo.Location = new Point(25, 100);
+ CustomLabelSetDNSInfo.Name = "CustomLabelSetDNSInfo";
+ CustomLabelSetDNSInfo.RoundedCorners = 0;
+ CustomLabelSetDNSInfo.Size = new Size(220, 45);
+ CustomLabelSetDNSInfo.TabIndex = 2;
+ CustomLabelSetDNSInfo.Text = "You have two options:\r\n1. Set DNS to Windows by below button.\r\n2. Set DoH to Firefox manually.";
//
// CustomComboBoxNICs
//
- this.CustomComboBoxNICs.BackColor = System.Drawing.Color.DimGray;
- this.CustomComboBoxNICs.BorderColor = System.Drawing.Color.Blue;
- this.CustomComboBoxNICs.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
- this.CustomComboBoxNICs.ForeColor = System.Drawing.Color.White;
- this.CustomComboBoxNICs.FormattingEnabled = true;
- this.CustomComboBoxNICs.ItemHeight = 17;
- this.CustomComboBoxNICs.Location = new System.Drawing.Point(25, 55);
- this.CustomComboBoxNICs.Name = "CustomComboBoxNICs";
- this.CustomComboBoxNICs.SelectionColor = System.Drawing.Color.DodgerBlue;
- this.CustomComboBoxNICs.Size = new System.Drawing.Size(171, 23);
- this.CustomComboBoxNICs.TabIndex = 1;
+ CustomComboBoxNICs.BackColor = Color.DimGray;
+ CustomComboBoxNICs.BorderColor = Color.Blue;
+ CustomComboBoxNICs.DrawMode = DrawMode.OwnerDrawVariable;
+ CustomComboBoxNICs.ForeColor = Color.White;
+ CustomComboBoxNICs.FormattingEnabled = true;
+ CustomComboBoxNICs.ItemHeight = 17;
+ CustomComboBoxNICs.Location = new Point(25, 55);
+ CustomComboBoxNICs.Name = "CustomComboBoxNICs";
+ CustomComboBoxNICs.SelectionColor = Color.DodgerBlue;
+ CustomComboBoxNICs.Size = new Size(171, 23);
+ CustomComboBoxNICs.TabIndex = 1;
//
// TabPageShare
//
- this.TabPageShare.BackColor = System.Drawing.Color.Transparent;
- this.TabPageShare.Controls.Add(this.CustomButtonPDpiPresetDefault);
- this.TabPageShare.Controls.Add(this.CustomLabelPDpiPresets);
- this.TabPageShare.Controls.Add(this.CustomNumericUpDownPDpiBeforeSniChunks);
- this.TabPageShare.Controls.Add(this.CustomLabelPDpiBeforeSniChunks);
- this.TabPageShare.Controls.Add(this.CustomLabelPDpiSniChunkMode);
- this.TabPageShare.Controls.Add(this.CustomComboBoxPDpiSniChunkMode);
- this.TabPageShare.Controls.Add(this.CustomNumericUpDownPDpiAntiPatternOffset);
- this.TabPageShare.Controls.Add(this.CustomLabelPDpiAntiPatternOffset);
- this.TabPageShare.Controls.Add(this.CustomCheckBoxHTTPProxyEventShowChunkDetails);
- this.TabPageShare.Controls.Add(this.CustomButtonPDpiApplyChanges);
- this.TabPageShare.Controls.Add(this.CustomNumericUpDownPDpiFragDelay);
- this.TabPageShare.Controls.Add(this.CustomLabelPDpiFragDelay);
- this.TabPageShare.Controls.Add(this.CustomButtonSetProxy);
- this.TabPageShare.Controls.Add(this.CustomNumericUpDownPDpiSniChunks);
- this.TabPageShare.Controls.Add(this.CustomLabelPDpiSniChunks);
- this.TabPageShare.Controls.Add(this.CustomLabelShareSeparator1);
- this.TabPageShare.Controls.Add(this.CustomCheckBoxHTTPProxyEventShowRequest);
- this.TabPageShare.Controls.Add(this.CustomCheckBoxPDpiEnableDpiBypass);
- this.TabPageShare.Controls.Add(this.CustomButtonShare);
- this.TabPageShare.Controls.Add(this.CustomLabelShareInfo);
- this.TabPageShare.Location = new System.Drawing.Point(4, 25);
- this.TabPageShare.Name = "TabPageShare";
- this.TabPageShare.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageShare.Size = new System.Drawing.Size(678, 336);
- this.TabPageShare.TabIndex = 4;
- this.TabPageShare.Tag = 3;
- this.TabPageShare.Text = "4. Share + Bypass DPI";
+ TabPageShare.BackColor = Color.Transparent;
+ TabPageShare.Controls.Add(CustomButtonPDpiPresetDefault);
+ TabPageShare.Controls.Add(CustomLabelPDpiPresets);
+ TabPageShare.Controls.Add(CustomNumericUpDownPDpiBeforeSniChunks);
+ TabPageShare.Controls.Add(CustomLabelPDpiBeforeSniChunks);
+ TabPageShare.Controls.Add(CustomLabelPDpiSniChunkMode);
+ TabPageShare.Controls.Add(CustomComboBoxPDpiSniChunkMode);
+ TabPageShare.Controls.Add(CustomNumericUpDownPDpiAntiPatternOffset);
+ TabPageShare.Controls.Add(CustomLabelPDpiAntiPatternOffset);
+ TabPageShare.Controls.Add(CustomCheckBoxHTTPProxyEventShowChunkDetails);
+ TabPageShare.Controls.Add(CustomButtonPDpiApplyChanges);
+ TabPageShare.Controls.Add(CustomNumericUpDownPDpiFragDelay);
+ TabPageShare.Controls.Add(CustomLabelPDpiFragDelay);
+ TabPageShare.Controls.Add(CustomButtonSetProxy);
+ TabPageShare.Controls.Add(CustomNumericUpDownPDpiSniChunks);
+ TabPageShare.Controls.Add(CustomLabelPDpiSniChunks);
+ TabPageShare.Controls.Add(CustomLabelShareSeparator1);
+ TabPageShare.Controls.Add(CustomCheckBoxHTTPProxyEventShowRequest);
+ TabPageShare.Controls.Add(CustomCheckBoxPDpiEnableDpiBypass);
+ TabPageShare.Controls.Add(CustomButtonShare);
+ TabPageShare.Controls.Add(CustomLabelShareInfo);
+ TabPageShare.Location = new Point(4, 25);
+ TabPageShare.Name = "TabPageShare";
+ TabPageShare.Padding = new Padding(3);
+ TabPageShare.Size = new Size(678, 336);
+ TabPageShare.TabIndex = 4;
+ TabPageShare.Tag = 3;
+ TabPageShare.Text = "4. Share + Bypass DPI";
//
// CustomButtonPDpiPresetDefault
//
- this.CustomButtonPDpiPresetDefault.AutoSize = true;
- this.CustomButtonPDpiPresetDefault.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonPDpiPresetDefault.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonPDpiPresetDefault.Location = new System.Drawing.Point(470, 130);
- this.CustomButtonPDpiPresetDefault.Name = "CustomButtonPDpiPresetDefault";
- this.CustomButtonPDpiPresetDefault.RoundedCorners = 5;
- this.CustomButtonPDpiPresetDefault.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonPDpiPresetDefault.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonPDpiPresetDefault.TabIndex = 46;
- this.CustomButtonPDpiPresetDefault.Text = "Default";
- this.CustomButtonPDpiPresetDefault.UseVisualStyleBackColor = true;
- this.CustomButtonPDpiPresetDefault.Click += new System.EventHandler(this.CustomButtonPDpiPresetDefault_Click);
+ CustomButtonPDpiPresetDefault.BorderColor = Color.Blue;
+ CustomButtonPDpiPresetDefault.FlatStyle = FlatStyle.Flat;
+ CustomButtonPDpiPresetDefault.Location = new Point(470, 130);
+ CustomButtonPDpiPresetDefault.Name = "CustomButtonPDpiPresetDefault";
+ CustomButtonPDpiPresetDefault.RoundedCorners = 5;
+ CustomButtonPDpiPresetDefault.SelectionColor = Color.LightBlue;
+ CustomButtonPDpiPresetDefault.Size = new Size(75, 27);
+ CustomButtonPDpiPresetDefault.TabIndex = 46;
+ CustomButtonPDpiPresetDefault.Text = "Default";
+ CustomButtonPDpiPresetDefault.UseVisualStyleBackColor = true;
+ CustomButtonPDpiPresetDefault.Click += CustomButtonPDpiPresetDefault_Click;
//
// CustomLabelPDpiPresets
//
- this.CustomLabelPDpiPresets.AutoSize = true;
- this.CustomLabelPDpiPresets.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPDpiPresets.Border = false;
- this.CustomLabelPDpiPresets.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPDpiPresets.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPDpiPresets.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPDpiPresets.Location = new System.Drawing.Point(470, 110);
- this.CustomLabelPDpiPresets.Name = "CustomLabelPDpiPresets";
- this.CustomLabelPDpiPresets.RoundedCorners = 0;
- this.CustomLabelPDpiPresets.Size = new System.Drawing.Size(47, 15);
- this.CustomLabelPDpiPresets.TabIndex = 45;
- this.CustomLabelPDpiPresets.Text = "Presets:";
+ CustomLabelPDpiPresets.AutoSize = true;
+ CustomLabelPDpiPresets.BackColor = Color.DimGray;
+ CustomLabelPDpiPresets.Border = false;
+ CustomLabelPDpiPresets.BorderColor = Color.Blue;
+ CustomLabelPDpiPresets.FlatStyle = FlatStyle.Flat;
+ CustomLabelPDpiPresets.ForeColor = Color.White;
+ CustomLabelPDpiPresets.Location = new Point(470, 110);
+ CustomLabelPDpiPresets.Name = "CustomLabelPDpiPresets";
+ CustomLabelPDpiPresets.RoundedCorners = 0;
+ CustomLabelPDpiPresets.Size = new Size(47, 15);
+ CustomLabelPDpiPresets.TabIndex = 45;
+ CustomLabelPDpiPresets.Text = "Presets:";
//
// CustomNumericUpDownPDpiBeforeSniChunks
//
- this.CustomNumericUpDownPDpiBeforeSniChunks.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownPDpiBeforeSniChunks.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownPDpiBeforeSniChunks.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownPDpiBeforeSniChunks.Location = new System.Drawing.Point(167, 108);
- this.CustomNumericUpDownPDpiBeforeSniChunks.Maximum = new decimal(new int[] {
- 500,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownPDpiBeforeSniChunks.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownPDpiBeforeSniChunks.Name = "CustomNumericUpDownPDpiBeforeSniChunks";
- this.CustomNumericUpDownPDpiBeforeSniChunks.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownPDpiBeforeSniChunks.TabIndex = 44;
- this.CustomNumericUpDownPDpiBeforeSniChunks.Value = new decimal(new int[] {
- 50,
- 0,
- 0,
- 0});
+ CustomNumericUpDownPDpiBeforeSniChunks.BackColor = Color.DimGray;
+ CustomNumericUpDownPDpiBeforeSniChunks.BorderColor = Color.Blue;
+ CustomNumericUpDownPDpiBeforeSniChunks.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownPDpiBeforeSniChunks.Location = new Point(167, 108);
+ CustomNumericUpDownPDpiBeforeSniChunks.Maximum = new decimal(new int[] { 500, 0, 0, 0 });
+ CustomNumericUpDownPDpiBeforeSniChunks.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownPDpiBeforeSniChunks.Name = "CustomNumericUpDownPDpiBeforeSniChunks";
+ CustomNumericUpDownPDpiBeforeSniChunks.Size = new Size(45, 23);
+ CustomNumericUpDownPDpiBeforeSniChunks.TabIndex = 44;
+ CustomNumericUpDownPDpiBeforeSniChunks.Value = new decimal(new int[] { 50, 0, 0, 0 });
//
// CustomLabelPDpiBeforeSniChunks
//
- this.CustomLabelPDpiBeforeSniChunks.AutoSize = true;
- this.CustomLabelPDpiBeforeSniChunks.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPDpiBeforeSniChunks.Border = false;
- this.CustomLabelPDpiBeforeSniChunks.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPDpiBeforeSniChunks.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPDpiBeforeSniChunks.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPDpiBeforeSniChunks.Location = new System.Drawing.Point(40, 110);
- this.CustomLabelPDpiBeforeSniChunks.Name = "CustomLabelPDpiBeforeSniChunks";
- this.CustomLabelPDpiBeforeSniChunks.RoundedCorners = 0;
- this.CustomLabelPDpiBeforeSniChunks.Size = new System.Drawing.Size(108, 15);
- this.CustomLabelPDpiBeforeSniChunks.TabIndex = 43;
- this.CustomLabelPDpiBeforeSniChunks.Text = "Chunks before SNI:";
+ CustomLabelPDpiBeforeSniChunks.AutoSize = true;
+ CustomLabelPDpiBeforeSniChunks.BackColor = Color.DimGray;
+ CustomLabelPDpiBeforeSniChunks.Border = false;
+ CustomLabelPDpiBeforeSniChunks.BorderColor = Color.Blue;
+ CustomLabelPDpiBeforeSniChunks.FlatStyle = FlatStyle.Flat;
+ CustomLabelPDpiBeforeSniChunks.ForeColor = Color.White;
+ CustomLabelPDpiBeforeSniChunks.Location = new Point(40, 110);
+ CustomLabelPDpiBeforeSniChunks.Name = "CustomLabelPDpiBeforeSniChunks";
+ CustomLabelPDpiBeforeSniChunks.RoundedCorners = 0;
+ CustomLabelPDpiBeforeSniChunks.Size = new Size(108, 15);
+ CustomLabelPDpiBeforeSniChunks.TabIndex = 43;
+ CustomLabelPDpiBeforeSniChunks.Text = "Chunks before SNI:";
//
// CustomLabelPDpiSniChunkMode
//
- this.CustomLabelPDpiSniChunkMode.AutoSize = true;
- this.CustomLabelPDpiSniChunkMode.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPDpiSniChunkMode.Border = false;
- this.CustomLabelPDpiSniChunkMode.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPDpiSniChunkMode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPDpiSniChunkMode.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPDpiSniChunkMode.Location = new System.Drawing.Point(40, 140);
- this.CustomLabelPDpiSniChunkMode.Name = "CustomLabelPDpiSniChunkMode";
- this.CustomLabelPDpiSniChunkMode.RoundedCorners = 0;
- this.CustomLabelPDpiSniChunkMode.Size = new System.Drawing.Size(98, 15);
- this.CustomLabelPDpiSniChunkMode.TabIndex = 42;
- this.CustomLabelPDpiSniChunkMode.Text = "SNI chunk mode:";
+ CustomLabelPDpiSniChunkMode.AutoSize = true;
+ CustomLabelPDpiSniChunkMode.BackColor = Color.DimGray;
+ CustomLabelPDpiSniChunkMode.Border = false;
+ CustomLabelPDpiSniChunkMode.BorderColor = Color.Blue;
+ CustomLabelPDpiSniChunkMode.FlatStyle = FlatStyle.Flat;
+ CustomLabelPDpiSniChunkMode.ForeColor = Color.White;
+ CustomLabelPDpiSniChunkMode.Location = new Point(40, 140);
+ CustomLabelPDpiSniChunkMode.Name = "CustomLabelPDpiSniChunkMode";
+ CustomLabelPDpiSniChunkMode.RoundedCorners = 0;
+ CustomLabelPDpiSniChunkMode.Size = new Size(98, 15);
+ CustomLabelPDpiSniChunkMode.TabIndex = 42;
+ CustomLabelPDpiSniChunkMode.Text = "SNI chunk mode:";
//
// CustomComboBoxPDpiSniChunkMode
//
- this.CustomComboBoxPDpiSniChunkMode.BackColor = System.Drawing.Color.DimGray;
- this.CustomComboBoxPDpiSniChunkMode.BorderColor = System.Drawing.Color.Blue;
- this.CustomComboBoxPDpiSniChunkMode.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
- this.CustomComboBoxPDpiSniChunkMode.ForeColor = System.Drawing.Color.White;
- this.CustomComboBoxPDpiSniChunkMode.FormattingEnabled = true;
- this.CustomComboBoxPDpiSniChunkMode.ItemHeight = 17;
- this.CustomComboBoxPDpiSniChunkMode.Items.AddRange(new object[] {
- "SNI",
- "SNI Extension",
- "All Extensions"});
- this.CustomComboBoxPDpiSniChunkMode.Location = new System.Drawing.Point(167, 138);
- this.CustomComboBoxPDpiSniChunkMode.Name = "CustomComboBoxPDpiSniChunkMode";
- this.CustomComboBoxPDpiSniChunkMode.SelectionColor = System.Drawing.Color.DodgerBlue;
- this.CustomComboBoxPDpiSniChunkMode.Size = new System.Drawing.Size(100, 23);
- this.CustomComboBoxPDpiSniChunkMode.TabIndex = 41;
+ CustomComboBoxPDpiSniChunkMode.BackColor = Color.DimGray;
+ CustomComboBoxPDpiSniChunkMode.BorderColor = Color.Blue;
+ CustomComboBoxPDpiSniChunkMode.DrawMode = DrawMode.OwnerDrawVariable;
+ CustomComboBoxPDpiSniChunkMode.ForeColor = Color.White;
+ CustomComboBoxPDpiSniChunkMode.FormattingEnabled = true;
+ CustomComboBoxPDpiSniChunkMode.ItemHeight = 17;
+ CustomComboBoxPDpiSniChunkMode.Items.AddRange(new object[] { "SNI", "SNI Extension", "All Extensions" });
+ CustomComboBoxPDpiSniChunkMode.Location = new Point(167, 138);
+ CustomComboBoxPDpiSniChunkMode.Name = "CustomComboBoxPDpiSniChunkMode";
+ CustomComboBoxPDpiSniChunkMode.SelectionColor = Color.DodgerBlue;
+ CustomComboBoxPDpiSniChunkMode.Size = new Size(100, 23);
+ CustomComboBoxPDpiSniChunkMode.TabIndex = 41;
//
// CustomNumericUpDownPDpiAntiPatternOffset
//
- this.CustomNumericUpDownPDpiAntiPatternOffset.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownPDpiAntiPatternOffset.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownPDpiAntiPatternOffset.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownPDpiAntiPatternOffset.Location = new System.Drawing.Point(167, 198);
- this.CustomNumericUpDownPDpiAntiPatternOffset.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownPDpiAntiPatternOffset.Name = "CustomNumericUpDownPDpiAntiPatternOffset";
- this.CustomNumericUpDownPDpiAntiPatternOffset.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownPDpiAntiPatternOffset.TabIndex = 40;
- this.CustomNumericUpDownPDpiAntiPatternOffset.Value = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
+ CustomNumericUpDownPDpiAntiPatternOffset.BackColor = Color.DimGray;
+ CustomNumericUpDownPDpiAntiPatternOffset.BorderColor = Color.Blue;
+ CustomNumericUpDownPDpiAntiPatternOffset.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownPDpiAntiPatternOffset.Location = new Point(167, 198);
+ CustomNumericUpDownPDpiAntiPatternOffset.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
+ CustomNumericUpDownPDpiAntiPatternOffset.Name = "CustomNumericUpDownPDpiAntiPatternOffset";
+ CustomNumericUpDownPDpiAntiPatternOffset.Size = new Size(45, 23);
+ CustomNumericUpDownPDpiAntiPatternOffset.TabIndex = 40;
+ CustomNumericUpDownPDpiAntiPatternOffset.Value = new decimal(new int[] { 2, 0, 0, 0 });
//
// CustomLabelPDpiAntiPatternOffset
//
- this.CustomLabelPDpiAntiPatternOffset.AutoSize = true;
- this.CustomLabelPDpiAntiPatternOffset.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPDpiAntiPatternOffset.Border = false;
- this.CustomLabelPDpiAntiPatternOffset.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPDpiAntiPatternOffset.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPDpiAntiPatternOffset.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPDpiAntiPatternOffset.Location = new System.Drawing.Point(40, 200);
- this.CustomLabelPDpiAntiPatternOffset.Name = "CustomLabelPDpiAntiPatternOffset";
- this.CustomLabelPDpiAntiPatternOffset.RoundedCorners = 0;
- this.CustomLabelPDpiAntiPatternOffset.Size = new System.Drawing.Size(106, 15);
- this.CustomLabelPDpiAntiPatternOffset.TabIndex = 39;
- this.CustomLabelPDpiAntiPatternOffset.Text = "Anti pattern offset:";
+ CustomLabelPDpiAntiPatternOffset.AutoSize = true;
+ CustomLabelPDpiAntiPatternOffset.BackColor = Color.DimGray;
+ CustomLabelPDpiAntiPatternOffset.Border = false;
+ CustomLabelPDpiAntiPatternOffset.BorderColor = Color.Blue;
+ CustomLabelPDpiAntiPatternOffset.FlatStyle = FlatStyle.Flat;
+ CustomLabelPDpiAntiPatternOffset.ForeColor = Color.White;
+ CustomLabelPDpiAntiPatternOffset.Location = new Point(40, 200);
+ CustomLabelPDpiAntiPatternOffset.Name = "CustomLabelPDpiAntiPatternOffset";
+ CustomLabelPDpiAntiPatternOffset.RoundedCorners = 0;
+ CustomLabelPDpiAntiPatternOffset.Size = new Size(106, 15);
+ CustomLabelPDpiAntiPatternOffset.TabIndex = 39;
+ CustomLabelPDpiAntiPatternOffset.Text = "Anti pattern offset:";
//
// CustomCheckBoxHTTPProxyEventShowChunkDetails
//
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.Location = new System.Drawing.Point(190, 40);
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.Name = "CustomCheckBoxHTTPProxyEventShowChunkDetails";
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.Size = new System.Drawing.Size(161, 17);
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.TabIndex = 38;
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.Text = "Write chunk details to log";
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.UseVisualStyleBackColor = false;
- this.CustomCheckBoxHTTPProxyEventShowChunkDetails.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.BackColor = Color.DimGray;
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.BorderColor = Color.Blue;
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.CheckColor = Color.Blue;
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.ForeColor = Color.White;
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.Location = new Point(190, 40);
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.Name = "CustomCheckBoxHTTPProxyEventShowChunkDetails";
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.SelectionColor = Color.LightBlue;
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.Size = new Size(161, 17);
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.TabIndex = 38;
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.Text = "Write chunk details to log";
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.UseVisualStyleBackColor = false;
+ CustomCheckBoxHTTPProxyEventShowChunkDetails.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomButtonPDpiApplyChanges
//
- this.CustomButtonPDpiApplyChanges.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonPDpiApplyChanges.AutoSize = true;
- this.CustomButtonPDpiApplyChanges.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonPDpiApplyChanges.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonPDpiApplyChanges.Location = new System.Drawing.Point(249, 303);
- this.CustomButtonPDpiApplyChanges.Name = "CustomButtonPDpiApplyChanges";
- this.CustomButtonPDpiApplyChanges.RoundedCorners = 5;
- this.CustomButtonPDpiApplyChanges.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonPDpiApplyChanges.Size = new System.Drawing.Size(157, 27);
- this.CustomButtonPDpiApplyChanges.TabIndex = 37;
- this.CustomButtonPDpiApplyChanges.Text = "Apply DPI bypass changes";
- this.CustomButtonPDpiApplyChanges.UseVisualStyleBackColor = true;
- this.CustomButtonPDpiApplyChanges.Click += new System.EventHandler(this.CustomButtonPDpiApplyChanges_Click);
+ CustomButtonPDpiApplyChanges.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonPDpiApplyChanges.BorderColor = Color.Blue;
+ CustomButtonPDpiApplyChanges.FlatStyle = FlatStyle.Flat;
+ CustomButtonPDpiApplyChanges.Location = new Point(250, 303);
+ CustomButtonPDpiApplyChanges.Name = "CustomButtonPDpiApplyChanges";
+ CustomButtonPDpiApplyChanges.RoundedCorners = 5;
+ CustomButtonPDpiApplyChanges.SelectionColor = Color.LightBlue;
+ CustomButtonPDpiApplyChanges.Size = new Size(157, 27);
+ CustomButtonPDpiApplyChanges.TabIndex = 37;
+ CustomButtonPDpiApplyChanges.Text = "Apply DPI bypass changes";
+ CustomButtonPDpiApplyChanges.UseVisualStyleBackColor = true;
+ CustomButtonPDpiApplyChanges.Click += CustomButtonPDpiApplyChanges_Click;
//
// CustomNumericUpDownPDpiFragDelay
//
- this.CustomNumericUpDownPDpiFragDelay.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownPDpiFragDelay.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownPDpiFragDelay.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownPDpiFragDelay.Location = new System.Drawing.Point(167, 228);
- this.CustomNumericUpDownPDpiFragDelay.Name = "CustomNumericUpDownPDpiFragDelay";
- this.CustomNumericUpDownPDpiFragDelay.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownPDpiFragDelay.TabIndex = 36;
- this.CustomNumericUpDownPDpiFragDelay.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
+ CustomNumericUpDownPDpiFragDelay.BackColor = Color.DimGray;
+ CustomNumericUpDownPDpiFragDelay.BorderColor = Color.Blue;
+ CustomNumericUpDownPDpiFragDelay.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownPDpiFragDelay.Location = new Point(167, 228);
+ CustomNumericUpDownPDpiFragDelay.Name = "CustomNumericUpDownPDpiFragDelay";
+ CustomNumericUpDownPDpiFragDelay.Size = new Size(45, 23);
+ CustomNumericUpDownPDpiFragDelay.TabIndex = 36;
+ CustomNumericUpDownPDpiFragDelay.Value = new decimal(new int[] { 1, 0, 0, 0 });
//
// CustomLabelPDpiFragDelay
//
- this.CustomLabelPDpiFragDelay.AutoSize = true;
- this.CustomLabelPDpiFragDelay.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPDpiFragDelay.Border = false;
- this.CustomLabelPDpiFragDelay.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPDpiFragDelay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPDpiFragDelay.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPDpiFragDelay.Location = new System.Drawing.Point(40, 230);
- this.CustomLabelPDpiFragDelay.Name = "CustomLabelPDpiFragDelay";
- this.CustomLabelPDpiFragDelay.RoundedCorners = 0;
- this.CustomLabelPDpiFragDelay.Size = new System.Drawing.Size(119, 15);
- this.CustomLabelPDpiFragDelay.TabIndex = 35;
- this.CustomLabelPDpiFragDelay.Text = "Fragment delay (ms):";
+ CustomLabelPDpiFragDelay.AutoSize = true;
+ CustomLabelPDpiFragDelay.BackColor = Color.DimGray;
+ CustomLabelPDpiFragDelay.Border = false;
+ CustomLabelPDpiFragDelay.BorderColor = Color.Blue;
+ CustomLabelPDpiFragDelay.FlatStyle = FlatStyle.Flat;
+ CustomLabelPDpiFragDelay.ForeColor = Color.White;
+ CustomLabelPDpiFragDelay.Location = new Point(40, 230);
+ CustomLabelPDpiFragDelay.Name = "CustomLabelPDpiFragDelay";
+ CustomLabelPDpiFragDelay.RoundedCorners = 0;
+ CustomLabelPDpiFragDelay.Size = new Size(119, 15);
+ CustomLabelPDpiFragDelay.TabIndex = 35;
+ CustomLabelPDpiFragDelay.Text = "Fragment delay (ms):";
//
// CustomButtonSetProxy
//
- this.CustomButtonSetProxy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonSetProxy.AutoSize = true;
- this.CustomButtonSetProxy.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonSetProxy.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonSetProxy.Location = new System.Drawing.Point(143, 303);
- this.CustomButtonSetProxy.Name = "CustomButtonSetProxy";
- this.CustomButtonSetProxy.RoundedCorners = 5;
- this.CustomButtonSetProxy.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonSetProxy.Size = new System.Drawing.Size(71, 27);
- this.CustomButtonSetProxy.TabIndex = 32;
- this.CustomButtonSetProxy.Text = "Set/Unset";
- this.CustomButtonSetProxy.UseVisualStyleBackColor = true;
- this.CustomButtonSetProxy.Click += new System.EventHandler(this.CustomButtonSetProxy_Click);
+ CustomButtonSetProxy.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonSetProxy.BorderColor = Color.Blue;
+ CustomButtonSetProxy.FlatStyle = FlatStyle.Flat;
+ CustomButtonSetProxy.Location = new Point(122, 303);
+ CustomButtonSetProxy.Name = "CustomButtonSetProxy";
+ CustomButtonSetProxy.RoundedCorners = 5;
+ CustomButtonSetProxy.SelectionColor = Color.LightBlue;
+ CustomButtonSetProxy.Size = new Size(82, 27);
+ CustomButtonSetProxy.TabIndex = 32;
+ CustomButtonSetProxy.Text = "Unset Proxy";
+ CustomButtonSetProxy.UseVisualStyleBackColor = true;
+ CustomButtonSetProxy.Click += CustomButtonSetProxy_Click;
//
// CustomNumericUpDownPDpiSniChunks
//
- this.CustomNumericUpDownPDpiSniChunks.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownPDpiSniChunks.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownPDpiSniChunks.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownPDpiSniChunks.Location = new System.Drawing.Point(167, 168);
- this.CustomNumericUpDownPDpiSniChunks.Maximum = new decimal(new int[] {
- 500,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownPDpiSniChunks.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownPDpiSniChunks.Name = "CustomNumericUpDownPDpiSniChunks";
- this.CustomNumericUpDownPDpiSniChunks.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownPDpiSniChunks.TabIndex = 28;
- this.CustomNumericUpDownPDpiSniChunks.Value = new decimal(new int[] {
- 5,
- 0,
- 0,
- 0});
+ CustomNumericUpDownPDpiSniChunks.BackColor = Color.DimGray;
+ CustomNumericUpDownPDpiSniChunks.BorderColor = Color.Blue;
+ CustomNumericUpDownPDpiSniChunks.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownPDpiSniChunks.Location = new Point(167, 168);
+ CustomNumericUpDownPDpiSniChunks.Maximum = new decimal(new int[] { 500, 0, 0, 0 });
+ CustomNumericUpDownPDpiSniChunks.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownPDpiSniChunks.Name = "CustomNumericUpDownPDpiSniChunks";
+ CustomNumericUpDownPDpiSniChunks.Size = new Size(45, 23);
+ CustomNumericUpDownPDpiSniChunks.TabIndex = 28;
+ CustomNumericUpDownPDpiSniChunks.Value = new decimal(new int[] { 5, 0, 0, 0 });
//
// CustomLabelPDpiSniChunks
//
- this.CustomLabelPDpiSniChunks.AutoSize = true;
- this.CustomLabelPDpiSniChunks.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPDpiSniChunks.Border = false;
- this.CustomLabelPDpiSniChunks.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPDpiSniChunks.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPDpiSniChunks.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPDpiSniChunks.Location = new System.Drawing.Point(40, 170);
- this.CustomLabelPDpiSniChunks.Name = "CustomLabelPDpiSniChunks";
- this.CustomLabelPDpiSniChunks.RoundedCorners = 0;
- this.CustomLabelPDpiSniChunks.Size = new System.Drawing.Size(71, 15);
- this.CustomLabelPDpiSniChunks.TabIndex = 27;
- this.CustomLabelPDpiSniChunks.Text = "Chunks SNI:";
+ CustomLabelPDpiSniChunks.AutoSize = true;
+ CustomLabelPDpiSniChunks.BackColor = Color.DimGray;
+ CustomLabelPDpiSniChunks.Border = false;
+ CustomLabelPDpiSniChunks.BorderColor = Color.Blue;
+ CustomLabelPDpiSniChunks.FlatStyle = FlatStyle.Flat;
+ CustomLabelPDpiSniChunks.ForeColor = Color.White;
+ CustomLabelPDpiSniChunks.Location = new Point(40, 170);
+ CustomLabelPDpiSniChunks.Name = "CustomLabelPDpiSniChunks";
+ CustomLabelPDpiSniChunks.RoundedCorners = 0;
+ CustomLabelPDpiSniChunks.Size = new Size(71, 15);
+ CustomLabelPDpiSniChunks.TabIndex = 27;
+ CustomLabelPDpiSniChunks.Text = "Chunks SNI:";
//
// CustomLabelShareSeparator1
//
- this.CustomLabelShareSeparator1.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelShareSeparator1.Border = true;
- this.CustomLabelShareSeparator1.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelShareSeparator1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelShareSeparator1.ForeColor = System.Drawing.Color.White;
- this.CustomLabelShareSeparator1.Location = new System.Drawing.Point(20, 65);
- this.CustomLabelShareSeparator1.Name = "CustomLabelShareSeparator1";
- this.CustomLabelShareSeparator1.RoundedCorners = 0;
- this.CustomLabelShareSeparator1.Size = new System.Drawing.Size(609, 1);
- this.CustomLabelShareSeparator1.TabIndex = 24;
+ CustomLabelShareSeparator1.BackColor = Color.DimGray;
+ CustomLabelShareSeparator1.Border = true;
+ CustomLabelShareSeparator1.BorderColor = Color.Blue;
+ CustomLabelShareSeparator1.FlatStyle = FlatStyle.Flat;
+ CustomLabelShareSeparator1.ForeColor = Color.White;
+ CustomLabelShareSeparator1.Location = new Point(20, 65);
+ CustomLabelShareSeparator1.Name = "CustomLabelShareSeparator1";
+ CustomLabelShareSeparator1.RoundedCorners = 0;
+ CustomLabelShareSeparator1.Size = new Size(609, 1);
+ CustomLabelShareSeparator1.TabIndex = 24;
//
// CustomCheckBoxHTTPProxyEventShowRequest
//
- this.CustomCheckBoxHTTPProxyEventShowRequest.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxHTTPProxyEventShowRequest.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxHTTPProxyEventShowRequest.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxHTTPProxyEventShowRequest.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxHTTPProxyEventShowRequest.Location = new System.Drawing.Point(25, 40);
- this.CustomCheckBoxHTTPProxyEventShowRequest.Name = "CustomCheckBoxHTTPProxyEventShowRequest";
- this.CustomCheckBoxHTTPProxyEventShowRequest.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxHTTPProxyEventShowRequest.Size = new System.Drawing.Size(135, 17);
- this.CustomCheckBoxHTTPProxyEventShowRequest.TabIndex = 23;
- this.CustomCheckBoxHTTPProxyEventShowRequest.Text = "Write requests to log";
- this.CustomCheckBoxHTTPProxyEventShowRequest.UseVisualStyleBackColor = false;
- this.CustomCheckBoxHTTPProxyEventShowRequest.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomCheckBoxHTTPProxyEventShowRequest.BackColor = Color.DimGray;
+ CustomCheckBoxHTTPProxyEventShowRequest.BorderColor = Color.Blue;
+ CustomCheckBoxHTTPProxyEventShowRequest.CheckColor = Color.Blue;
+ CustomCheckBoxHTTPProxyEventShowRequest.ForeColor = Color.White;
+ CustomCheckBoxHTTPProxyEventShowRequest.Location = new Point(25, 40);
+ CustomCheckBoxHTTPProxyEventShowRequest.Name = "CustomCheckBoxHTTPProxyEventShowRequest";
+ CustomCheckBoxHTTPProxyEventShowRequest.SelectionColor = Color.LightBlue;
+ CustomCheckBoxHTTPProxyEventShowRequest.Size = new Size(135, 17);
+ CustomCheckBoxHTTPProxyEventShowRequest.TabIndex = 23;
+ CustomCheckBoxHTTPProxyEventShowRequest.Text = "Write requests to log";
+ CustomCheckBoxHTTPProxyEventShowRequest.UseVisualStyleBackColor = false;
+ CustomCheckBoxHTTPProxyEventShowRequest.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomCheckBoxPDpiEnableDpiBypass
//
- this.CustomCheckBoxPDpiEnableDpiBypass.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxPDpiEnableDpiBypass.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxPDpiEnableDpiBypass.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxPDpiEnableDpiBypass.Checked = true;
- this.CustomCheckBoxPDpiEnableDpiBypass.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxPDpiEnableDpiBypass.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxPDpiEnableDpiBypass.Location = new System.Drawing.Point(25, 80);
- this.CustomCheckBoxPDpiEnableDpiBypass.Name = "CustomCheckBoxPDpiEnableDpiBypass";
- this.CustomCheckBoxPDpiEnableDpiBypass.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxPDpiEnableDpiBypass.Size = new System.Drawing.Size(120, 17);
- this.CustomCheckBoxPDpiEnableDpiBypass.TabIndex = 17;
- this.CustomCheckBoxPDpiEnableDpiBypass.Text = "Enable DPI bypass";
- this.CustomCheckBoxPDpiEnableDpiBypass.UseVisualStyleBackColor = false;
+ CustomCheckBoxPDpiEnableDpiBypass.BackColor = Color.DimGray;
+ CustomCheckBoxPDpiEnableDpiBypass.BorderColor = Color.Blue;
+ CustomCheckBoxPDpiEnableDpiBypass.CheckColor = Color.Blue;
+ CustomCheckBoxPDpiEnableDpiBypass.Checked = true;
+ CustomCheckBoxPDpiEnableDpiBypass.CheckState = CheckState.Checked;
+ CustomCheckBoxPDpiEnableDpiBypass.ForeColor = Color.White;
+ CustomCheckBoxPDpiEnableDpiBypass.Location = new Point(25, 80);
+ CustomCheckBoxPDpiEnableDpiBypass.Name = "CustomCheckBoxPDpiEnableDpiBypass";
+ CustomCheckBoxPDpiEnableDpiBypass.SelectionColor = Color.LightBlue;
+ CustomCheckBoxPDpiEnableDpiBypass.Size = new Size(120, 17);
+ CustomCheckBoxPDpiEnableDpiBypass.TabIndex = 17;
+ CustomCheckBoxPDpiEnableDpiBypass.Text = "Enable DPI bypass";
+ CustomCheckBoxPDpiEnableDpiBypass.UseVisualStyleBackColor = false;
//
// CustomButtonShare
//
- this.CustomButtonShare.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonShare.AutoSize = true;
- this.CustomButtonShare.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonShare.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonShare.Location = new System.Drawing.Point(40, 303);
- this.CustomButtonShare.Name = "CustomButtonShare";
- this.CustomButtonShare.RoundedCorners = 5;
- this.CustomButtonShare.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonShare.Size = new System.Drawing.Size(97, 27);
- this.CustomButtonShare.TabIndex = 16;
- this.CustomButtonShare.Text = "Enable/Disable";
- this.CustomButtonShare.UseVisualStyleBackColor = true;
- this.CustomButtonShare.Click += new System.EventHandler(this.CustomButtonShare_Click);
+ CustomButtonShare.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonShare.BorderColor = Color.Blue;
+ CustomButtonShare.FlatStyle = FlatStyle.Flat;
+ CustomButtonShare.Location = new Point(40, 303);
+ CustomButtonShare.Name = "CustomButtonShare";
+ CustomButtonShare.RoundedCorners = 5;
+ CustomButtonShare.SelectionColor = Color.LightBlue;
+ CustomButtonShare.Size = new Size(76, 27);
+ CustomButtonShare.TabIndex = 16;
+ CustomButtonShare.Text = "Start Proxy";
+ CustomButtonShare.UseVisualStyleBackColor = true;
+ CustomButtonShare.Click += CustomButtonShare_Click;
//
// CustomLabelShareInfo
//
- this.CustomLabelShareInfo.AutoSize = true;
- this.CustomLabelShareInfo.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelShareInfo.Border = false;
- this.CustomLabelShareInfo.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelShareInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelShareInfo.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomLabelShareInfo.ForeColor = System.Drawing.Color.White;
- this.CustomLabelShareInfo.Location = new System.Drawing.Point(25, 10);
- this.CustomLabelShareInfo.Name = "CustomLabelShareInfo";
- this.CustomLabelShareInfo.RoundedCorners = 0;
- this.CustomLabelShareInfo.Size = new System.Drawing.Size(317, 21);
- this.CustomLabelShareInfo.TabIndex = 14;
- this.CustomLabelShareInfo.Text = "Share to other devices on the same network.";
+ CustomLabelShareInfo.AutoSize = true;
+ CustomLabelShareInfo.BackColor = Color.DimGray;
+ CustomLabelShareInfo.Border = false;
+ CustomLabelShareInfo.BorderColor = Color.Blue;
+ CustomLabelShareInfo.FlatStyle = FlatStyle.Flat;
+ CustomLabelShareInfo.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomLabelShareInfo.ForeColor = Color.White;
+ CustomLabelShareInfo.Location = new Point(25, 10);
+ CustomLabelShareInfo.Name = "CustomLabelShareInfo";
+ CustomLabelShareInfo.RoundedCorners = 0;
+ CustomLabelShareInfo.Size = new Size(317, 21);
+ CustomLabelShareInfo.TabIndex = 14;
+ CustomLabelShareInfo.Text = "Share to other devices on the same network.";
//
// TabPageGoodbyeDPI
//
- this.TabPageGoodbyeDPI.BackColor = System.Drawing.Color.Transparent;
- this.TabPageGoodbyeDPI.Controls.Add(this.CustomTabControlDPIBasicAdvanced);
- this.TabPageGoodbyeDPI.Location = new System.Drawing.Point(4, 25);
- this.TabPageGoodbyeDPI.Name = "TabPageGoodbyeDPI";
- this.TabPageGoodbyeDPI.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageGoodbyeDPI.Size = new System.Drawing.Size(678, 336);
- this.TabPageGoodbyeDPI.TabIndex = 2;
- this.TabPageGoodbyeDPI.Tag = 4;
- this.TabPageGoodbyeDPI.Text = "GoodbyeDPI";
+ TabPageGoodbyeDPI.BackColor = Color.Transparent;
+ TabPageGoodbyeDPI.Controls.Add(CustomTabControlDPIBasicAdvanced);
+ TabPageGoodbyeDPI.Location = new Point(4, 25);
+ TabPageGoodbyeDPI.Name = "TabPageGoodbyeDPI";
+ TabPageGoodbyeDPI.Padding = new Padding(3);
+ TabPageGoodbyeDPI.Size = new Size(678, 336);
+ TabPageGoodbyeDPI.TabIndex = 2;
+ TabPageGoodbyeDPI.Tag = 4;
+ TabPageGoodbyeDPI.Text = "GoodbyeDPI";
//
// CustomTabControlDPIBasicAdvanced
//
- this.CustomTabControlDPIBasicAdvanced.BorderColor = System.Drawing.Color.Blue;
- this.CustomTabControlDPIBasicAdvanced.Controls.Add(this.TabPageDPIBasic);
- this.CustomTabControlDPIBasicAdvanced.Controls.Add(this.TabPageDPIAdvanced);
- this.CustomTabControlDPIBasicAdvanced.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomTabControlDPIBasicAdvanced.HideTabHeader = false;
- this.CustomTabControlDPIBasicAdvanced.ItemSize = new System.Drawing.Size(90, 21);
- this.CustomTabControlDPIBasicAdvanced.Location = new System.Drawing.Point(3, 3);
- this.CustomTabControlDPIBasicAdvanced.Name = "CustomTabControlDPIBasicAdvanced";
- this.CustomTabControlDPIBasicAdvanced.SelectedIndex = 0;
- this.CustomTabControlDPIBasicAdvanced.Size = new System.Drawing.Size(672, 330);
- this.CustomTabControlDPIBasicAdvanced.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
- this.CustomTabControlDPIBasicAdvanced.TabIndex = 13;
- this.CustomTabControlDPIBasicAdvanced.Tag = 1;
+ CustomTabControlDPIBasicAdvanced.BorderColor = Color.Blue;
+ CustomTabControlDPIBasicAdvanced.Controls.Add(TabPageDPIBasic);
+ CustomTabControlDPIBasicAdvanced.Controls.Add(TabPageDPIAdvanced);
+ CustomTabControlDPIBasicAdvanced.Dock = DockStyle.Fill;
+ CustomTabControlDPIBasicAdvanced.HideTabHeader = false;
+ CustomTabControlDPIBasicAdvanced.ItemSize = new Size(90, 21);
+ CustomTabControlDPIBasicAdvanced.Location = new Point(3, 3);
+ CustomTabControlDPIBasicAdvanced.Name = "CustomTabControlDPIBasicAdvanced";
+ CustomTabControlDPIBasicAdvanced.SelectedIndex = 0;
+ CustomTabControlDPIBasicAdvanced.Size = new Size(672, 330);
+ CustomTabControlDPIBasicAdvanced.SizeMode = TabSizeMode.Fixed;
+ CustomTabControlDPIBasicAdvanced.TabIndex = 13;
+ CustomTabControlDPIBasicAdvanced.Tag = 1;
//
// TabPageDPIBasic
//
- this.TabPageDPIBasic.BackColor = System.Drawing.Color.Transparent;
- this.TabPageDPIBasic.Controls.Add(this.CustomLabelInfoDPIModes);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIMode6);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIMode5);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIMode4);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIMode3);
- this.TabPageDPIBasic.Controls.Add(this.CustomLabelDPIModesGoodbyeDPI);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIMode2);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIMode1);
- this.TabPageDPIBasic.Controls.Add(this.CustomButtonDPIBasicDeactivate);
- this.TabPageDPIBasic.Controls.Add(this.CustomButtonDPIBasicActivate);
- this.TabPageDPIBasic.Controls.Add(this.CustomNumericUpDownSSLFragmentSize);
- this.TabPageDPIBasic.Controls.Add(this.CustomLabelDPIModes);
- this.TabPageDPIBasic.Controls.Add(this.CustomLabelSSLFragmentSize);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIModeLight);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIModeMedium);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIModeExtreme);
- this.TabPageDPIBasic.Controls.Add(this.CustomRadioButtonDPIModeHigh);
- this.TabPageDPIBasic.Location = new System.Drawing.Point(4, 25);
- this.TabPageDPIBasic.Name = "TabPageDPIBasic";
- this.TabPageDPIBasic.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageDPIBasic.Size = new System.Drawing.Size(664, 301);
- this.TabPageDPIBasic.TabIndex = 0;
- this.TabPageDPIBasic.Tag = 0;
- this.TabPageDPIBasic.Text = "Basic";
+ TabPageDPIBasic.BackColor = Color.Transparent;
+ TabPageDPIBasic.Controls.Add(CustomLabelInfoDPIModes);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIMode6);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIMode5);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIMode4);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIMode3);
+ TabPageDPIBasic.Controls.Add(CustomLabelDPIModesGoodbyeDPI);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIMode2);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIMode1);
+ TabPageDPIBasic.Controls.Add(CustomButtonDPIBasicDeactivate);
+ TabPageDPIBasic.Controls.Add(CustomButtonDPIBasicActivate);
+ TabPageDPIBasic.Controls.Add(CustomNumericUpDownSSLFragmentSize);
+ TabPageDPIBasic.Controls.Add(CustomLabelDPIModes);
+ TabPageDPIBasic.Controls.Add(CustomLabelSSLFragmentSize);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIModeLight);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIModeMedium);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIModeExtreme);
+ TabPageDPIBasic.Controls.Add(CustomRadioButtonDPIModeHigh);
+ TabPageDPIBasic.Location = new Point(4, 25);
+ TabPageDPIBasic.Name = "TabPageDPIBasic";
+ TabPageDPIBasic.Padding = new Padding(3);
+ TabPageDPIBasic.Size = new Size(664, 301);
+ TabPageDPIBasic.TabIndex = 0;
+ TabPageDPIBasic.Tag = 0;
+ TabPageDPIBasic.Text = "Basic";
//
// CustomLabelInfoDPIModes
//
- this.CustomLabelInfoDPIModes.AutoSize = true;
- this.CustomLabelInfoDPIModes.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelInfoDPIModes.Border = false;
- this.CustomLabelInfoDPIModes.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelInfoDPIModes.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelInfoDPIModes.Font = new System.Drawing.Font("Segoe UI", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
- this.CustomLabelInfoDPIModes.ForeColor = System.Drawing.Color.White;
- this.CustomLabelInfoDPIModes.Location = new System.Drawing.Point(25, 15);
- this.CustomLabelInfoDPIModes.Name = "CustomLabelInfoDPIModes";
- this.CustomLabelInfoDPIModes.RoundedCorners = 0;
- this.CustomLabelInfoDPIModes.Size = new System.Drawing.Size(147, 38);
- this.CustomLabelInfoDPIModes.TabIndex = 20;
- this.CustomLabelInfoDPIModes.Text = "Light: MTN-AST-ASK\r\nMedium: MCI-SHT";
+ CustomLabelInfoDPIModes.AutoSize = true;
+ CustomLabelInfoDPIModes.BackColor = Color.DimGray;
+ CustomLabelInfoDPIModes.Border = false;
+ CustomLabelInfoDPIModes.BorderColor = Color.Blue;
+ CustomLabelInfoDPIModes.FlatStyle = FlatStyle.Flat;
+ CustomLabelInfoDPIModes.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
+ CustomLabelInfoDPIModes.ForeColor = Color.White;
+ CustomLabelInfoDPIModes.Location = new Point(25, 15);
+ CustomLabelInfoDPIModes.Name = "CustomLabelInfoDPIModes";
+ CustomLabelInfoDPIModes.RoundedCorners = 0;
+ CustomLabelInfoDPIModes.Size = new Size(147, 38);
+ CustomLabelInfoDPIModes.TabIndex = 20;
+ CustomLabelInfoDPIModes.Text = "Light: MTN-AST-ASK\r\nMedium: MCI-SHT";
//
// CustomRadioButtonDPIMode6
//
- this.CustomRadioButtonDPIMode6.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIMode6.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode6.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode6.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIMode6.Location = new System.Drawing.Point(370, 155);
- this.CustomRadioButtonDPIMode6.Name = "CustomRadioButtonDPIMode6";
- this.CustomRadioButtonDPIMode6.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIMode6.Size = new System.Drawing.Size(63, 17);
- this.CustomRadioButtonDPIMode6.TabIndex = 19;
- this.CustomRadioButtonDPIMode6.Text = "Mode 6";
- this.CustomRadioButtonDPIMode6.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIMode6.BackColor = Color.DimGray;
+ CustomRadioButtonDPIMode6.BorderColor = Color.Blue;
+ CustomRadioButtonDPIMode6.CheckColor = Color.Blue;
+ CustomRadioButtonDPIMode6.ForeColor = Color.White;
+ CustomRadioButtonDPIMode6.Location = new Point(370, 155);
+ CustomRadioButtonDPIMode6.Name = "CustomRadioButtonDPIMode6";
+ CustomRadioButtonDPIMode6.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIMode6.Size = new Size(63, 17);
+ CustomRadioButtonDPIMode6.TabIndex = 19;
+ CustomRadioButtonDPIMode6.Text = "Mode 6";
+ CustomRadioButtonDPIMode6.UseVisualStyleBackColor = false;
//
// CustomRadioButtonDPIMode5
//
- this.CustomRadioButtonDPIMode5.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIMode5.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode5.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode5.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIMode5.Location = new System.Drawing.Point(301, 155);
- this.CustomRadioButtonDPIMode5.Name = "CustomRadioButtonDPIMode5";
- this.CustomRadioButtonDPIMode5.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIMode5.Size = new System.Drawing.Size(63, 17);
- this.CustomRadioButtonDPIMode5.TabIndex = 18;
- this.CustomRadioButtonDPIMode5.Text = "Mode 5";
- this.CustomRadioButtonDPIMode5.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIMode5.BackColor = Color.DimGray;
+ CustomRadioButtonDPIMode5.BorderColor = Color.Blue;
+ CustomRadioButtonDPIMode5.CheckColor = Color.Blue;
+ CustomRadioButtonDPIMode5.ForeColor = Color.White;
+ CustomRadioButtonDPIMode5.Location = new Point(301, 155);
+ CustomRadioButtonDPIMode5.Name = "CustomRadioButtonDPIMode5";
+ CustomRadioButtonDPIMode5.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIMode5.Size = new Size(63, 17);
+ CustomRadioButtonDPIMode5.TabIndex = 18;
+ CustomRadioButtonDPIMode5.Text = "Mode 5";
+ CustomRadioButtonDPIMode5.UseVisualStyleBackColor = false;
//
// CustomRadioButtonDPIMode4
//
- this.CustomRadioButtonDPIMode4.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIMode4.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode4.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode4.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIMode4.Location = new System.Drawing.Point(232, 155);
- this.CustomRadioButtonDPIMode4.Name = "CustomRadioButtonDPIMode4";
- this.CustomRadioButtonDPIMode4.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIMode4.Size = new System.Drawing.Size(63, 17);
- this.CustomRadioButtonDPIMode4.TabIndex = 17;
- this.CustomRadioButtonDPIMode4.Text = "Mode 4";
- this.CustomRadioButtonDPIMode4.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIMode4.BackColor = Color.DimGray;
+ CustomRadioButtonDPIMode4.BorderColor = Color.Blue;
+ CustomRadioButtonDPIMode4.CheckColor = Color.Blue;
+ CustomRadioButtonDPIMode4.ForeColor = Color.White;
+ CustomRadioButtonDPIMode4.Location = new Point(232, 155);
+ CustomRadioButtonDPIMode4.Name = "CustomRadioButtonDPIMode4";
+ CustomRadioButtonDPIMode4.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIMode4.Size = new Size(63, 17);
+ CustomRadioButtonDPIMode4.TabIndex = 17;
+ CustomRadioButtonDPIMode4.Text = "Mode 4";
+ CustomRadioButtonDPIMode4.UseVisualStyleBackColor = false;
//
// CustomRadioButtonDPIMode3
//
- this.CustomRadioButtonDPIMode3.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIMode3.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode3.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode3.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIMode3.Location = new System.Drawing.Point(163, 155);
- this.CustomRadioButtonDPIMode3.Name = "CustomRadioButtonDPIMode3";
- this.CustomRadioButtonDPIMode3.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIMode3.Size = new System.Drawing.Size(63, 17);
- this.CustomRadioButtonDPIMode3.TabIndex = 16;
- this.CustomRadioButtonDPIMode3.Text = "Mode 3";
- this.CustomRadioButtonDPIMode3.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIMode3.BackColor = Color.DimGray;
+ CustomRadioButtonDPIMode3.BorderColor = Color.Blue;
+ CustomRadioButtonDPIMode3.CheckColor = Color.Blue;
+ CustomRadioButtonDPIMode3.ForeColor = Color.White;
+ CustomRadioButtonDPIMode3.Location = new Point(163, 155);
+ CustomRadioButtonDPIMode3.Name = "CustomRadioButtonDPIMode3";
+ CustomRadioButtonDPIMode3.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIMode3.Size = new Size(63, 17);
+ CustomRadioButtonDPIMode3.TabIndex = 16;
+ CustomRadioButtonDPIMode3.Text = "Mode 3";
+ CustomRadioButtonDPIMode3.UseVisualStyleBackColor = false;
//
// CustomLabelDPIModesGoodbyeDPI
//
- this.CustomLabelDPIModesGoodbyeDPI.AutoSize = true;
- this.CustomLabelDPIModesGoodbyeDPI.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelDPIModesGoodbyeDPI.Border = false;
- this.CustomLabelDPIModesGoodbyeDPI.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelDPIModesGoodbyeDPI.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelDPIModesGoodbyeDPI.ForeColor = System.Drawing.Color.White;
- this.CustomLabelDPIModesGoodbyeDPI.Location = new System.Drawing.Point(25, 130);
- this.CustomLabelDPIModesGoodbyeDPI.Name = "CustomLabelDPIModesGoodbyeDPI";
- this.CustomLabelDPIModesGoodbyeDPI.RoundedCorners = 0;
- this.CustomLabelDPIModesGoodbyeDPI.Size = new System.Drawing.Size(118, 15);
- this.CustomLabelDPIModesGoodbyeDPI.TabIndex = 15;
- this.CustomLabelDPIModesGoodbyeDPI.Text = "Goodbye DPI modes:";
+ CustomLabelDPIModesGoodbyeDPI.AutoSize = true;
+ CustomLabelDPIModesGoodbyeDPI.BackColor = Color.DimGray;
+ CustomLabelDPIModesGoodbyeDPI.Border = false;
+ CustomLabelDPIModesGoodbyeDPI.BorderColor = Color.Blue;
+ CustomLabelDPIModesGoodbyeDPI.FlatStyle = FlatStyle.Flat;
+ CustomLabelDPIModesGoodbyeDPI.ForeColor = Color.White;
+ CustomLabelDPIModesGoodbyeDPI.Location = new Point(25, 130);
+ CustomLabelDPIModesGoodbyeDPI.Name = "CustomLabelDPIModesGoodbyeDPI";
+ CustomLabelDPIModesGoodbyeDPI.RoundedCorners = 0;
+ CustomLabelDPIModesGoodbyeDPI.Size = new Size(118, 15);
+ CustomLabelDPIModesGoodbyeDPI.TabIndex = 15;
+ CustomLabelDPIModesGoodbyeDPI.Text = "Goodbye DPI modes:";
//
// CustomRadioButtonDPIMode2
//
- this.CustomRadioButtonDPIMode2.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIMode2.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode2.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode2.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIMode2.Location = new System.Drawing.Point(94, 155);
- this.CustomRadioButtonDPIMode2.Name = "CustomRadioButtonDPIMode2";
- this.CustomRadioButtonDPIMode2.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIMode2.Size = new System.Drawing.Size(63, 17);
- this.CustomRadioButtonDPIMode2.TabIndex = 14;
- this.CustomRadioButtonDPIMode2.Text = "Mode 2";
- this.CustomRadioButtonDPIMode2.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIMode2.BackColor = Color.DimGray;
+ CustomRadioButtonDPIMode2.BorderColor = Color.Blue;
+ CustomRadioButtonDPIMode2.CheckColor = Color.Blue;
+ CustomRadioButtonDPIMode2.ForeColor = Color.White;
+ CustomRadioButtonDPIMode2.Location = new Point(94, 155);
+ CustomRadioButtonDPIMode2.Name = "CustomRadioButtonDPIMode2";
+ CustomRadioButtonDPIMode2.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIMode2.Size = new Size(63, 17);
+ CustomRadioButtonDPIMode2.TabIndex = 14;
+ CustomRadioButtonDPIMode2.Text = "Mode 2";
+ CustomRadioButtonDPIMode2.UseVisualStyleBackColor = false;
//
// CustomRadioButtonDPIMode1
//
- this.CustomRadioButtonDPIMode1.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonDPIMode1.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode1.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonDPIMode1.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonDPIMode1.Location = new System.Drawing.Point(25, 155);
- this.CustomRadioButtonDPIMode1.Name = "CustomRadioButtonDPIMode1";
- this.CustomRadioButtonDPIMode1.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonDPIMode1.Size = new System.Drawing.Size(63, 17);
- this.CustomRadioButtonDPIMode1.TabIndex = 13;
- this.CustomRadioButtonDPIMode1.Text = "Mode 1";
- this.CustomRadioButtonDPIMode1.UseVisualStyleBackColor = false;
+ CustomRadioButtonDPIMode1.BackColor = Color.DimGray;
+ CustomRadioButtonDPIMode1.BorderColor = Color.Blue;
+ CustomRadioButtonDPIMode1.CheckColor = Color.Blue;
+ CustomRadioButtonDPIMode1.ForeColor = Color.White;
+ CustomRadioButtonDPIMode1.Location = new Point(25, 155);
+ CustomRadioButtonDPIMode1.Name = "CustomRadioButtonDPIMode1";
+ CustomRadioButtonDPIMode1.SelectionColor = Color.LightBlue;
+ CustomRadioButtonDPIMode1.Size = new Size(63, 17);
+ CustomRadioButtonDPIMode1.TabIndex = 13;
+ CustomRadioButtonDPIMode1.Text = "Mode 1";
+ CustomRadioButtonDPIMode1.UseVisualStyleBackColor = false;
//
// CustomButtonDPIBasicDeactivate
//
- this.CustomButtonDPIBasicDeactivate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonDPIBasicDeactivate.AutoSize = true;
- this.CustomButtonDPIBasicDeactivate.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDPIBasicDeactivate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDPIBasicDeactivate.Location = new System.Drawing.Point(172, 268);
- this.CustomButtonDPIBasicDeactivate.Name = "CustomButtonDPIBasicDeactivate";
- this.CustomButtonDPIBasicDeactivate.RoundedCorners = 5;
- this.CustomButtonDPIBasicDeactivate.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDPIBasicDeactivate.Size = new System.Drawing.Size(74, 27);
- this.CustomButtonDPIBasicDeactivate.TabIndex = 12;
- this.CustomButtonDPIBasicDeactivate.Text = "Deactivate";
- this.CustomButtonDPIBasicDeactivate.UseVisualStyleBackColor = true;
- this.CustomButtonDPIBasicDeactivate.Click += new System.EventHandler(this.CustomButtonDPIBasicDeactivate_Click);
+ CustomButtonDPIBasicDeactivate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonDPIBasicDeactivate.BorderColor = Color.Blue;
+ CustomButtonDPIBasicDeactivate.FlatStyle = FlatStyle.Flat;
+ CustomButtonDPIBasicDeactivate.Location = new Point(124, 268);
+ CustomButtonDPIBasicDeactivate.Name = "CustomButtonDPIBasicDeactivate";
+ CustomButtonDPIBasicDeactivate.RoundedCorners = 5;
+ CustomButtonDPIBasicDeactivate.SelectionColor = Color.LightBlue;
+ CustomButtonDPIBasicDeactivate.Size = new Size(74, 27);
+ CustomButtonDPIBasicDeactivate.TabIndex = 12;
+ CustomButtonDPIBasicDeactivate.Text = "Deactivate";
+ CustomButtonDPIBasicDeactivate.UseVisualStyleBackColor = true;
+ CustomButtonDPIBasicDeactivate.Click += CustomButtonDPIBasicDeactivate_Click;
//
// CustomButtonDPIBasicActivate
//
- this.CustomButtonDPIBasicActivate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonDPIBasicActivate.AutoSize = true;
- this.CustomButtonDPIBasicActivate.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDPIBasicActivate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDPIBasicActivate.Location = new System.Drawing.Point(45, 268);
- this.CustomButtonDPIBasicActivate.Name = "CustomButtonDPIBasicActivate";
- this.CustomButtonDPIBasicActivate.RoundedCorners = 5;
- this.CustomButtonDPIBasicActivate.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDPIBasicActivate.Size = new System.Drawing.Size(121, 27);
- this.CustomButtonDPIBasicActivate.TabIndex = 11;
- this.CustomButtonDPIBasicActivate.Text = "Activate/Reactivate";
- this.CustomButtonDPIBasicActivate.UseVisualStyleBackColor = true;
- this.CustomButtonDPIBasicActivate.Click += new System.EventHandler(this.CustomButtonDPIBasic_Click);
+ CustomButtonDPIBasicActivate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonDPIBasicActivate.BorderColor = Color.Blue;
+ CustomButtonDPIBasicActivate.FlatStyle = FlatStyle.Flat;
+ CustomButtonDPIBasicActivate.Location = new Point(45, 268);
+ CustomButtonDPIBasicActivate.Name = "CustomButtonDPIBasicActivate";
+ CustomButtonDPIBasicActivate.RoundedCorners = 5;
+ CustomButtonDPIBasicActivate.SelectionColor = Color.LightBlue;
+ CustomButtonDPIBasicActivate.Size = new Size(73, 27);
+ CustomButtonDPIBasicActivate.TabIndex = 11;
+ CustomButtonDPIBasicActivate.Text = "Reactivate";
+ CustomButtonDPIBasicActivate.UseVisualStyleBackColor = true;
+ CustomButtonDPIBasicActivate.Click += CustomButtonDPIBasic_Click;
//
// TabPageDPIAdvanced
//
- this.TabPageDPIAdvanced.BackColor = System.Drawing.Color.Transparent;
- this.TabPageDPIAdvanced.Controls.Add(this.CustomTextBoxDPIAdvAutoTTL);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomNumericUpDownDPIAdvMaxPayload);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomNumericUpDownDPIAdvMinTTL);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomNumericUpDownDPIAdvSetTTL);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomNumericUpDownDPIAdvPort);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomButtonDPIAdvDeactivate);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomButtonDPIAdvActivate);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomButtonDPIAdvBlacklist);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvBlacklist);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvMaxPayload);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvReverseFrag);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvNativeFrag);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvWrongSeq);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvWrongChksum);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvMinTTL);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvAutoTTL);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvSetTTL);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvAllowNoSNI);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomTextBoxDPIAdvIpId);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvIpId);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvPort);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvW);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvA);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomNumericUpDownDPIAdvE);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvE);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvN);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomNumericUpDownDPIAdvK);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvK);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomNumericUpDownDPIAdvF);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvF);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvM);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvS);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvR);
- this.TabPageDPIAdvanced.Controls.Add(this.CustomCheckBoxDPIAdvP);
- this.TabPageDPIAdvanced.Location = new System.Drawing.Point(4, 25);
- this.TabPageDPIAdvanced.Name = "TabPageDPIAdvanced";
- this.TabPageDPIAdvanced.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageDPIAdvanced.Size = new System.Drawing.Size(664, 301);
- this.TabPageDPIAdvanced.TabIndex = 1;
- this.TabPageDPIAdvanced.Tag = 1;
- this.TabPageDPIAdvanced.Text = "Advanced";
+ TabPageDPIAdvanced.BackColor = Color.Transparent;
+ TabPageDPIAdvanced.Controls.Add(CustomTextBoxDPIAdvAutoTTL);
+ TabPageDPIAdvanced.Controls.Add(CustomNumericUpDownDPIAdvMaxPayload);
+ TabPageDPIAdvanced.Controls.Add(CustomNumericUpDownDPIAdvMinTTL);
+ TabPageDPIAdvanced.Controls.Add(CustomNumericUpDownDPIAdvSetTTL);
+ TabPageDPIAdvanced.Controls.Add(CustomNumericUpDownDPIAdvPort);
+ TabPageDPIAdvanced.Controls.Add(CustomButtonDPIAdvDeactivate);
+ TabPageDPIAdvanced.Controls.Add(CustomButtonDPIAdvActivate);
+ TabPageDPIAdvanced.Controls.Add(CustomButtonDPIAdvBlacklist);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvBlacklist);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvMaxPayload);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvReverseFrag);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvNativeFrag);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvWrongSeq);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvWrongChksum);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvMinTTL);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvAutoTTL);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvSetTTL);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvAllowNoSNI);
+ TabPageDPIAdvanced.Controls.Add(CustomTextBoxDPIAdvIpId);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvIpId);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvPort);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvW);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvA);
+ TabPageDPIAdvanced.Controls.Add(CustomNumericUpDownDPIAdvE);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvE);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvN);
+ TabPageDPIAdvanced.Controls.Add(CustomNumericUpDownDPIAdvK);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvK);
+ TabPageDPIAdvanced.Controls.Add(CustomNumericUpDownDPIAdvF);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvF);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvM);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvS);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvR);
+ TabPageDPIAdvanced.Controls.Add(CustomCheckBoxDPIAdvP);
+ TabPageDPIAdvanced.Location = new Point(4, 25);
+ TabPageDPIAdvanced.Name = "TabPageDPIAdvanced";
+ TabPageDPIAdvanced.Padding = new Padding(3);
+ TabPageDPIAdvanced.Size = new Size(664, 301);
+ TabPageDPIAdvanced.TabIndex = 1;
+ TabPageDPIAdvanced.Tag = 1;
+ TabPageDPIAdvanced.Text = "Advanced";
//
// CustomTextBoxDPIAdvAutoTTL
//
- this.CustomTextBoxDPIAdvAutoTTL.AcceptsReturn = false;
- this.CustomTextBoxDPIAdvAutoTTL.AcceptsTab = false;
- this.CustomTextBoxDPIAdvAutoTTL.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxDPIAdvAutoTTL.Border = true;
- this.CustomTextBoxDPIAdvAutoTTL.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxDPIAdvAutoTTL.BorderSize = 1;
- this.CustomTextBoxDPIAdvAutoTTL.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxDPIAdvAutoTTL.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxDPIAdvAutoTTL.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxDPIAdvAutoTTL.HideSelection = true;
- this.CustomTextBoxDPIAdvAutoTTL.Location = new System.Drawing.Point(393, 93);
- this.CustomTextBoxDPIAdvAutoTTL.MaxLength = 32767;
- this.CustomTextBoxDPIAdvAutoTTL.Multiline = false;
- this.CustomTextBoxDPIAdvAutoTTL.Name = "CustomTextBoxDPIAdvAutoTTL";
- this.CustomTextBoxDPIAdvAutoTTL.ReadOnly = false;
- this.CustomTextBoxDPIAdvAutoTTL.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxDPIAdvAutoTTL.ShortcutsEnabled = true;
- this.CustomTextBoxDPIAdvAutoTTL.Size = new System.Drawing.Size(53, 23);
- this.CustomTextBoxDPIAdvAutoTTL.TabIndex = 0;
- this.CustomTextBoxDPIAdvAutoTTL.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxDPIAdvAutoTTL.Texts = "1-4-10";
- this.CustomTextBoxDPIAdvAutoTTL.UnderlinedStyle = true;
- this.CustomTextBoxDPIAdvAutoTTL.UsePasswordChar = false;
- this.CustomTextBoxDPIAdvAutoTTL.WordWrap = true;
+ CustomTextBoxDPIAdvAutoTTL.AcceptsReturn = false;
+ CustomTextBoxDPIAdvAutoTTL.AcceptsTab = false;
+ CustomTextBoxDPIAdvAutoTTL.BackColor = Color.DimGray;
+ CustomTextBoxDPIAdvAutoTTL.Border = true;
+ CustomTextBoxDPIAdvAutoTTL.BorderColor = Color.Blue;
+ CustomTextBoxDPIAdvAutoTTL.BorderSize = 1;
+ CustomTextBoxDPIAdvAutoTTL.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxDPIAdvAutoTTL.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxDPIAdvAutoTTL.ForeColor = Color.White;
+ CustomTextBoxDPIAdvAutoTTL.HideSelection = true;
+ CustomTextBoxDPIAdvAutoTTL.Location = new Point(393, 93);
+ CustomTextBoxDPIAdvAutoTTL.MaxLength = 32767;
+ CustomTextBoxDPIAdvAutoTTL.Multiline = false;
+ CustomTextBoxDPIAdvAutoTTL.Name = "CustomTextBoxDPIAdvAutoTTL";
+ CustomTextBoxDPIAdvAutoTTL.ReadOnly = false;
+ CustomTextBoxDPIAdvAutoTTL.ScrollBars = ScrollBars.None;
+ CustomTextBoxDPIAdvAutoTTL.ShortcutsEnabled = true;
+ CustomTextBoxDPIAdvAutoTTL.Size = new Size(53, 23);
+ CustomTextBoxDPIAdvAutoTTL.TabIndex = 0;
+ CustomTextBoxDPIAdvAutoTTL.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxDPIAdvAutoTTL.Texts = "1-4-10";
+ CustomTextBoxDPIAdvAutoTTL.UnderlinedStyle = true;
+ CustomTextBoxDPIAdvAutoTTL.UsePasswordChar = false;
+ CustomTextBoxDPIAdvAutoTTL.WordWrap = true;
//
// CustomNumericUpDownDPIAdvMaxPayload
//
- this.CustomNumericUpDownDPIAdvMaxPayload.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDPIAdvMaxPayload.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDPIAdvMaxPayload.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDPIAdvMaxPayload.Location = new System.Drawing.Point(106, 153);
- this.CustomNumericUpDownDPIAdvMaxPayload.Maximum = new decimal(new int[] {
- 10000,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvMaxPayload.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvMaxPayload.Name = "CustomNumericUpDownDPIAdvMaxPayload";
- this.CustomNumericUpDownDPIAdvMaxPayload.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownDPIAdvMaxPayload.TabIndex = 36;
- this.CustomNumericUpDownDPIAdvMaxPayload.Value = new decimal(new int[] {
- 1200,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDPIAdvMaxPayload.BackColor = Color.DimGray;
+ CustomNumericUpDownDPIAdvMaxPayload.BorderColor = Color.Blue;
+ CustomNumericUpDownDPIAdvMaxPayload.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDPIAdvMaxPayload.Location = new Point(106, 153);
+ CustomNumericUpDownDPIAdvMaxPayload.Maximum = new decimal(new int[] { 10000, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvMaxPayload.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvMaxPayload.Name = "CustomNumericUpDownDPIAdvMaxPayload";
+ CustomNumericUpDownDPIAdvMaxPayload.Size = new Size(53, 23);
+ CustomNumericUpDownDPIAdvMaxPayload.TabIndex = 36;
+ CustomNumericUpDownDPIAdvMaxPayload.Value = new decimal(new int[] { 1200, 0, 0, 0 });
//
// CustomNumericUpDownDPIAdvMinTTL
//
- this.CustomNumericUpDownDPIAdvMinTTL.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDPIAdvMinTTL.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDPIAdvMinTTL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDPIAdvMinTTL.Location = new System.Drawing.Point(539, 93);
- this.CustomNumericUpDownDPIAdvMinTTL.Maximum = new decimal(new int[] {
- 3600,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvMinTTL.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvMinTTL.Name = "CustomNumericUpDownDPIAdvMinTTL";
- this.CustomNumericUpDownDPIAdvMinTTL.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownDPIAdvMinTTL.TabIndex = 35;
- this.CustomNumericUpDownDPIAdvMinTTL.Value = new decimal(new int[] {
- 3,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDPIAdvMinTTL.BackColor = Color.DimGray;
+ CustomNumericUpDownDPIAdvMinTTL.BorderColor = Color.Blue;
+ CustomNumericUpDownDPIAdvMinTTL.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDPIAdvMinTTL.Location = new Point(539, 93);
+ CustomNumericUpDownDPIAdvMinTTL.Maximum = new decimal(new int[] { 3600, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvMinTTL.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvMinTTL.Name = "CustomNumericUpDownDPIAdvMinTTL";
+ CustomNumericUpDownDPIAdvMinTTL.Size = new Size(53, 23);
+ CustomNumericUpDownDPIAdvMinTTL.TabIndex = 35;
+ CustomNumericUpDownDPIAdvMinTTL.Value = new decimal(new int[] { 3, 0, 0, 0 });
//
// CustomNumericUpDownDPIAdvSetTTL
//
- this.CustomNumericUpDownDPIAdvSetTTL.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDPIAdvSetTTL.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDPIAdvSetTTL.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDPIAdvSetTTL.Location = new System.Drawing.Point(230, 93);
- this.CustomNumericUpDownDPIAdvSetTTL.Maximum = new decimal(new int[] {
- 3600,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvSetTTL.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvSetTTL.Name = "CustomNumericUpDownDPIAdvSetTTL";
- this.CustomNumericUpDownDPIAdvSetTTL.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownDPIAdvSetTTL.TabIndex = 34;
- this.CustomNumericUpDownDPIAdvSetTTL.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDPIAdvSetTTL.BackColor = Color.DimGray;
+ CustomNumericUpDownDPIAdvSetTTL.BorderColor = Color.Blue;
+ CustomNumericUpDownDPIAdvSetTTL.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDPIAdvSetTTL.Location = new Point(230, 93);
+ CustomNumericUpDownDPIAdvSetTTL.Maximum = new decimal(new int[] { 3600, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvSetTTL.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvSetTTL.Name = "CustomNumericUpDownDPIAdvSetTTL";
+ CustomNumericUpDownDPIAdvSetTTL.Size = new Size(53, 23);
+ CustomNumericUpDownDPIAdvSetTTL.TabIndex = 34;
+ CustomNumericUpDownDPIAdvSetTTL.Value = new decimal(new int[] { 1, 0, 0, 0 });
//
// CustomNumericUpDownDPIAdvPort
//
- this.CustomNumericUpDownDPIAdvPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDPIAdvPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDPIAdvPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDPIAdvPort.Location = new System.Drawing.Point(376, 63);
- this.CustomNumericUpDownDPIAdvPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvPort.Name = "CustomNumericUpDownDPIAdvPort";
- this.CustomNumericUpDownDPIAdvPort.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownDPIAdvPort.TabIndex = 33;
- this.CustomNumericUpDownDPIAdvPort.Value = new decimal(new int[] {
- 80,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDPIAdvPort.BackColor = Color.DimGray;
+ CustomNumericUpDownDPIAdvPort.BorderColor = Color.Blue;
+ CustomNumericUpDownDPIAdvPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDPIAdvPort.Location = new Point(376, 63);
+ CustomNumericUpDownDPIAdvPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvPort.Name = "CustomNumericUpDownDPIAdvPort";
+ CustomNumericUpDownDPIAdvPort.Size = new Size(53, 23);
+ CustomNumericUpDownDPIAdvPort.TabIndex = 33;
+ CustomNumericUpDownDPIAdvPort.Value = new decimal(new int[] { 80, 0, 0, 0 });
//
// CustomButtonDPIAdvDeactivate
//
- this.CustomButtonDPIAdvDeactivate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonDPIAdvDeactivate.AutoSize = true;
- this.CustomButtonDPIAdvDeactivate.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDPIAdvDeactivate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDPIAdvDeactivate.Location = new System.Drawing.Point(172, 268);
- this.CustomButtonDPIAdvDeactivate.Name = "CustomButtonDPIAdvDeactivate";
- this.CustomButtonDPIAdvDeactivate.RoundedCorners = 5;
- this.CustomButtonDPIAdvDeactivate.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDPIAdvDeactivate.Size = new System.Drawing.Size(74, 27);
- this.CustomButtonDPIAdvDeactivate.TabIndex = 32;
- this.CustomButtonDPIAdvDeactivate.Text = "Deactivate";
- this.CustomButtonDPIAdvDeactivate.UseVisualStyleBackColor = true;
- this.CustomButtonDPIAdvDeactivate.Click += new System.EventHandler(this.CustomButtonDPIAdvDeactivate_Click);
+ CustomButtonDPIAdvDeactivate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonDPIAdvDeactivate.BorderColor = Color.Blue;
+ CustomButtonDPIAdvDeactivate.FlatStyle = FlatStyle.Flat;
+ CustomButtonDPIAdvDeactivate.Location = new Point(124, 268);
+ CustomButtonDPIAdvDeactivate.Name = "CustomButtonDPIAdvDeactivate";
+ CustomButtonDPIAdvDeactivate.RoundedCorners = 5;
+ CustomButtonDPIAdvDeactivate.SelectionColor = Color.LightBlue;
+ CustomButtonDPIAdvDeactivate.Size = new Size(74, 27);
+ CustomButtonDPIAdvDeactivate.TabIndex = 32;
+ CustomButtonDPIAdvDeactivate.Text = "Deactivate";
+ CustomButtonDPIAdvDeactivate.UseVisualStyleBackColor = true;
+ CustomButtonDPIAdvDeactivate.Click += CustomButtonDPIAdvDeactivate_Click;
//
// CustomButtonDPIAdvActivate
//
- this.CustomButtonDPIAdvActivate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonDPIAdvActivate.AutoSize = true;
- this.CustomButtonDPIAdvActivate.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDPIAdvActivate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDPIAdvActivate.Location = new System.Drawing.Point(45, 268);
- this.CustomButtonDPIAdvActivate.Name = "CustomButtonDPIAdvActivate";
- this.CustomButtonDPIAdvActivate.RoundedCorners = 5;
- this.CustomButtonDPIAdvActivate.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDPIAdvActivate.Size = new System.Drawing.Size(121, 27);
- this.CustomButtonDPIAdvActivate.TabIndex = 31;
- this.CustomButtonDPIAdvActivate.Text = "Activate/Reactivate";
- this.CustomButtonDPIAdvActivate.UseVisualStyleBackColor = true;
- this.CustomButtonDPIAdvActivate.Click += new System.EventHandler(this.CustomButtonDPIAdvActivate_Click);
+ CustomButtonDPIAdvActivate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonDPIAdvActivate.BorderColor = Color.Blue;
+ CustomButtonDPIAdvActivate.FlatStyle = FlatStyle.Flat;
+ CustomButtonDPIAdvActivate.Location = new Point(45, 268);
+ CustomButtonDPIAdvActivate.Name = "CustomButtonDPIAdvActivate";
+ CustomButtonDPIAdvActivate.RoundedCorners = 5;
+ CustomButtonDPIAdvActivate.SelectionColor = Color.LightBlue;
+ CustomButtonDPIAdvActivate.Size = new Size(73, 27);
+ CustomButtonDPIAdvActivate.TabIndex = 31;
+ CustomButtonDPIAdvActivate.Text = "Reactivate";
+ CustomButtonDPIAdvActivate.UseVisualStyleBackColor = true;
+ CustomButtonDPIAdvActivate.Click += CustomButtonDPIAdvActivate_Click;
//
// CustomButtonDPIAdvBlacklist
//
- this.CustomButtonDPIAdvBlacklist.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDPIAdvBlacklist.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDPIAdvBlacklist.Location = new System.Drawing.Point(241, 153);
- this.CustomButtonDPIAdvBlacklist.Name = "CustomButtonDPIAdvBlacklist";
- this.CustomButtonDPIAdvBlacklist.RoundedCorners = 5;
- this.CustomButtonDPIAdvBlacklist.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDPIAdvBlacklist.Size = new System.Drawing.Size(57, 25);
- this.CustomButtonDPIAdvBlacklist.TabIndex = 30;
- this.CustomButtonDPIAdvBlacklist.Text = "Edit";
- this.CustomButtonDPIAdvBlacklist.UseVisualStyleBackColor = true;
- this.CustomButtonDPIAdvBlacklist.Click += new System.EventHandler(this.CustomButtonDPIAdvBlacklist_Click);
+ CustomButtonDPIAdvBlacklist.BorderColor = Color.Blue;
+ CustomButtonDPIAdvBlacklist.FlatStyle = FlatStyle.Flat;
+ CustomButtonDPIAdvBlacklist.Location = new Point(241, 153);
+ CustomButtonDPIAdvBlacklist.Name = "CustomButtonDPIAdvBlacklist";
+ CustomButtonDPIAdvBlacklist.RoundedCorners = 5;
+ CustomButtonDPIAdvBlacklist.SelectionColor = Color.LightBlue;
+ CustomButtonDPIAdvBlacklist.Size = new Size(50, 25);
+ CustomButtonDPIAdvBlacklist.TabIndex = 30;
+ CustomButtonDPIAdvBlacklist.Text = "Edit";
+ CustomButtonDPIAdvBlacklist.UseVisualStyleBackColor = true;
+ CustomButtonDPIAdvBlacklist.Click += CustomButtonDPIAdvBlacklist_Click;
//
// CustomCheckBoxDPIAdvBlacklist
//
- this.CustomCheckBoxDPIAdvBlacklist.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvBlacklist.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvBlacklist.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvBlacklist.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvBlacklist.Location = new System.Drawing.Point(165, 155);
- this.CustomCheckBoxDPIAdvBlacklist.Name = "CustomCheckBoxDPIAdvBlacklist";
- this.CustomCheckBoxDPIAdvBlacklist.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvBlacklist.Size = new System.Drawing.Size(74, 17);
- this.CustomCheckBoxDPIAdvBlacklist.TabIndex = 29;
- this.CustomCheckBoxDPIAdvBlacklist.Text = "--blacklist";
- this.CustomCheckBoxDPIAdvBlacklist.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvBlacklist.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvBlacklist.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvBlacklist.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvBlacklist.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvBlacklist.Location = new Point(165, 155);
+ CustomCheckBoxDPIAdvBlacklist.Name = "CustomCheckBoxDPIAdvBlacklist";
+ CustomCheckBoxDPIAdvBlacklist.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvBlacklist.Size = new Size(74, 17);
+ CustomCheckBoxDPIAdvBlacklist.TabIndex = 29;
+ CustomCheckBoxDPIAdvBlacklist.Text = "--blacklist";
+ CustomCheckBoxDPIAdvBlacklist.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvMaxPayload
//
- this.CustomCheckBoxDPIAdvMaxPayload.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvMaxPayload.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvMaxPayload.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvMaxPayload.Checked = true;
- this.CustomCheckBoxDPIAdvMaxPayload.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvMaxPayload.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvMaxPayload.Location = new System.Drawing.Point(5, 155);
- this.CustomCheckBoxDPIAdvMaxPayload.Name = "CustomCheckBoxDPIAdvMaxPayload";
- this.CustomCheckBoxDPIAdvMaxPayload.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvMaxPayload.Size = new System.Drawing.Size(101, 17);
- this.CustomCheckBoxDPIAdvMaxPayload.TabIndex = 27;
- this.CustomCheckBoxDPIAdvMaxPayload.Text = "--max-payload";
- this.CustomCheckBoxDPIAdvMaxPayload.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvMaxPayload.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvMaxPayload.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvMaxPayload.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvMaxPayload.Checked = true;
+ CustomCheckBoxDPIAdvMaxPayload.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvMaxPayload.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvMaxPayload.Location = new Point(5, 155);
+ CustomCheckBoxDPIAdvMaxPayload.Name = "CustomCheckBoxDPIAdvMaxPayload";
+ CustomCheckBoxDPIAdvMaxPayload.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvMaxPayload.Size = new Size(101, 17);
+ CustomCheckBoxDPIAdvMaxPayload.TabIndex = 27;
+ CustomCheckBoxDPIAdvMaxPayload.Text = "--max-payload";
+ CustomCheckBoxDPIAdvMaxPayload.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvReverseFrag
//
- this.CustomCheckBoxDPIAdvReverseFrag.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvReverseFrag.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvReverseFrag.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvReverseFrag.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvReverseFrag.Location = new System.Drawing.Point(470, 125);
- this.CustomCheckBoxDPIAdvReverseFrag.Name = "CustomCheckBoxDPIAdvReverseFrag";
- this.CustomCheckBoxDPIAdvReverseFrag.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvReverseFrag.Size = new System.Drawing.Size(96, 17);
- this.CustomCheckBoxDPIAdvReverseFrag.TabIndex = 26;
- this.CustomCheckBoxDPIAdvReverseFrag.Text = "--reverse-frag";
- this.CustomCheckBoxDPIAdvReverseFrag.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvReverseFrag.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvReverseFrag.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvReverseFrag.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvReverseFrag.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvReverseFrag.Location = new Point(470, 125);
+ CustomCheckBoxDPIAdvReverseFrag.Name = "CustomCheckBoxDPIAdvReverseFrag";
+ CustomCheckBoxDPIAdvReverseFrag.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvReverseFrag.Size = new Size(96, 17);
+ CustomCheckBoxDPIAdvReverseFrag.TabIndex = 26;
+ CustomCheckBoxDPIAdvReverseFrag.Text = "--reverse-frag";
+ CustomCheckBoxDPIAdvReverseFrag.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvNativeFrag
//
- this.CustomCheckBoxDPIAdvNativeFrag.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvNativeFrag.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvNativeFrag.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvNativeFrag.Checked = true;
- this.CustomCheckBoxDPIAdvNativeFrag.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvNativeFrag.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvNativeFrag.Location = new System.Drawing.Point(320, 125);
- this.CustomCheckBoxDPIAdvNativeFrag.Name = "CustomCheckBoxDPIAdvNativeFrag";
- this.CustomCheckBoxDPIAdvNativeFrag.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvNativeFrag.Size = new System.Drawing.Size(90, 17);
- this.CustomCheckBoxDPIAdvNativeFrag.TabIndex = 25;
- this.CustomCheckBoxDPIAdvNativeFrag.Text = "--native-frag";
- this.CustomCheckBoxDPIAdvNativeFrag.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvNativeFrag.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvNativeFrag.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvNativeFrag.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvNativeFrag.Checked = true;
+ CustomCheckBoxDPIAdvNativeFrag.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvNativeFrag.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvNativeFrag.Location = new Point(320, 125);
+ CustomCheckBoxDPIAdvNativeFrag.Name = "CustomCheckBoxDPIAdvNativeFrag";
+ CustomCheckBoxDPIAdvNativeFrag.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvNativeFrag.Size = new Size(90, 17);
+ CustomCheckBoxDPIAdvNativeFrag.TabIndex = 25;
+ CustomCheckBoxDPIAdvNativeFrag.Text = "--native-frag";
+ CustomCheckBoxDPIAdvNativeFrag.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvWrongSeq
//
- this.CustomCheckBoxDPIAdvWrongSeq.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvWrongSeq.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvWrongSeq.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvWrongSeq.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvWrongSeq.Location = new System.Drawing.Point(165, 125);
- this.CustomCheckBoxDPIAdvWrongSeq.Name = "CustomCheckBoxDPIAdvWrongSeq";
- this.CustomCheckBoxDPIAdvWrongSeq.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvWrongSeq.Size = new System.Drawing.Size(89, 17);
- this.CustomCheckBoxDPIAdvWrongSeq.TabIndex = 24;
- this.CustomCheckBoxDPIAdvWrongSeq.Text = "--wrong-seq";
- this.CustomCheckBoxDPIAdvWrongSeq.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvWrongSeq.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvWrongSeq.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvWrongSeq.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvWrongSeq.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvWrongSeq.Location = new Point(165, 125);
+ CustomCheckBoxDPIAdvWrongSeq.Name = "CustomCheckBoxDPIAdvWrongSeq";
+ CustomCheckBoxDPIAdvWrongSeq.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvWrongSeq.Size = new Size(89, 17);
+ CustomCheckBoxDPIAdvWrongSeq.TabIndex = 24;
+ CustomCheckBoxDPIAdvWrongSeq.Text = "--wrong-seq";
+ CustomCheckBoxDPIAdvWrongSeq.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvWrongChksum
//
- this.CustomCheckBoxDPIAdvWrongChksum.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvWrongChksum.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvWrongChksum.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvWrongChksum.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvWrongChksum.Location = new System.Drawing.Point(5, 125);
- this.CustomCheckBoxDPIAdvWrongChksum.Name = "CustomCheckBoxDPIAdvWrongChksum";
- this.CustomCheckBoxDPIAdvWrongChksum.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvWrongChksum.Size = new System.Drawing.Size(112, 17);
- this.CustomCheckBoxDPIAdvWrongChksum.TabIndex = 23;
- this.CustomCheckBoxDPIAdvWrongChksum.Text = "--wrong-chksum";
- this.CustomCheckBoxDPIAdvWrongChksum.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvWrongChksum.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvWrongChksum.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvWrongChksum.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvWrongChksum.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvWrongChksum.Location = new Point(5, 125);
+ CustomCheckBoxDPIAdvWrongChksum.Name = "CustomCheckBoxDPIAdvWrongChksum";
+ CustomCheckBoxDPIAdvWrongChksum.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvWrongChksum.Size = new Size(112, 17);
+ CustomCheckBoxDPIAdvWrongChksum.TabIndex = 23;
+ CustomCheckBoxDPIAdvWrongChksum.Text = "--wrong-chksum";
+ CustomCheckBoxDPIAdvWrongChksum.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvMinTTL
//
- this.CustomCheckBoxDPIAdvMinTTL.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvMinTTL.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvMinTTL.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvMinTTL.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvMinTTL.Location = new System.Drawing.Point(470, 95);
- this.CustomCheckBoxDPIAdvMinTTL.Name = "CustomCheckBoxDPIAdvMinTTL";
- this.CustomCheckBoxDPIAdvMinTTL.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvMinTTL.Size = new System.Drawing.Size(67, 17);
- this.CustomCheckBoxDPIAdvMinTTL.TabIndex = 21;
- this.CustomCheckBoxDPIAdvMinTTL.Text = "--min-ttl";
- this.CustomCheckBoxDPIAdvMinTTL.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvMinTTL.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvMinTTL.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvMinTTL.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvMinTTL.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvMinTTL.Location = new Point(470, 95);
+ CustomCheckBoxDPIAdvMinTTL.Name = "CustomCheckBoxDPIAdvMinTTL";
+ CustomCheckBoxDPIAdvMinTTL.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvMinTTL.Size = new Size(67, 17);
+ CustomCheckBoxDPIAdvMinTTL.TabIndex = 21;
+ CustomCheckBoxDPIAdvMinTTL.Text = "--min-ttl";
+ CustomCheckBoxDPIAdvMinTTL.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvAutoTTL
//
- this.CustomCheckBoxDPIAdvAutoTTL.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvAutoTTL.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvAutoTTL.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvAutoTTL.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvAutoTTL.Location = new System.Drawing.Point(320, 95);
- this.CustomCheckBoxDPIAdvAutoTTL.Name = "CustomCheckBoxDPIAdvAutoTTL";
- this.CustomCheckBoxDPIAdvAutoTTL.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvAutoTTL.Size = new System.Drawing.Size(71, 17);
- this.CustomCheckBoxDPIAdvAutoTTL.TabIndex = 20;
- this.CustomCheckBoxDPIAdvAutoTTL.Text = "--auto-ttl";
- this.CustomCheckBoxDPIAdvAutoTTL.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvAutoTTL.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvAutoTTL.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvAutoTTL.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvAutoTTL.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvAutoTTL.Location = new Point(320, 95);
+ CustomCheckBoxDPIAdvAutoTTL.Name = "CustomCheckBoxDPIAdvAutoTTL";
+ CustomCheckBoxDPIAdvAutoTTL.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvAutoTTL.Size = new Size(71, 17);
+ CustomCheckBoxDPIAdvAutoTTL.TabIndex = 20;
+ CustomCheckBoxDPIAdvAutoTTL.Text = "--auto-ttl";
+ CustomCheckBoxDPIAdvAutoTTL.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvSetTTL
//
- this.CustomCheckBoxDPIAdvSetTTL.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvSetTTL.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvSetTTL.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvSetTTL.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvSetTTL.Location = new System.Drawing.Point(165, 95);
- this.CustomCheckBoxDPIAdvSetTTL.Name = "CustomCheckBoxDPIAdvSetTTL";
- this.CustomCheckBoxDPIAdvSetTTL.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvSetTTL.Size = new System.Drawing.Size(63, 17);
- this.CustomCheckBoxDPIAdvSetTTL.TabIndex = 18;
- this.CustomCheckBoxDPIAdvSetTTL.Text = "--set-ttl";
- this.CustomCheckBoxDPIAdvSetTTL.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvSetTTL.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvSetTTL.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvSetTTL.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvSetTTL.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvSetTTL.Location = new Point(165, 95);
+ CustomCheckBoxDPIAdvSetTTL.Name = "CustomCheckBoxDPIAdvSetTTL";
+ CustomCheckBoxDPIAdvSetTTL.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvSetTTL.Size = new Size(63, 17);
+ CustomCheckBoxDPIAdvSetTTL.TabIndex = 18;
+ CustomCheckBoxDPIAdvSetTTL.Text = "--set-ttl";
+ CustomCheckBoxDPIAdvSetTTL.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvAllowNoSNI
//
- this.CustomCheckBoxDPIAdvAllowNoSNI.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvAllowNoSNI.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvAllowNoSNI.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvAllowNoSNI.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvAllowNoSNI.Location = new System.Drawing.Point(5, 95);
- this.CustomCheckBoxDPIAdvAllowNoSNI.Name = "CustomCheckBoxDPIAdvAllowNoSNI";
- this.CustomCheckBoxDPIAdvAllowNoSNI.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvAllowNoSNI.Size = new System.Drawing.Size(98, 17);
- this.CustomCheckBoxDPIAdvAllowNoSNI.TabIndex = 17;
- this.CustomCheckBoxDPIAdvAllowNoSNI.Text = "--allow-no-sni";
- this.CustomCheckBoxDPIAdvAllowNoSNI.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvAllowNoSNI.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvAllowNoSNI.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvAllowNoSNI.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvAllowNoSNI.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvAllowNoSNI.Location = new Point(5, 95);
+ CustomCheckBoxDPIAdvAllowNoSNI.Name = "CustomCheckBoxDPIAdvAllowNoSNI";
+ CustomCheckBoxDPIAdvAllowNoSNI.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvAllowNoSNI.Size = new Size(98, 17);
+ CustomCheckBoxDPIAdvAllowNoSNI.TabIndex = 17;
+ CustomCheckBoxDPIAdvAllowNoSNI.Text = "--allow-no-sni";
+ CustomCheckBoxDPIAdvAllowNoSNI.UseVisualStyleBackColor = false;
//
// CustomTextBoxDPIAdvIpId
//
- this.CustomTextBoxDPIAdvIpId.AcceptsReturn = false;
- this.CustomTextBoxDPIAdvIpId.AcceptsTab = false;
- this.CustomTextBoxDPIAdvIpId.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxDPIAdvIpId.Border = true;
- this.CustomTextBoxDPIAdvIpId.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxDPIAdvIpId.BorderSize = 1;
- this.CustomTextBoxDPIAdvIpId.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxDPIAdvIpId.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxDPIAdvIpId.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxDPIAdvIpId.HideSelection = true;
- this.CustomTextBoxDPIAdvIpId.Location = new System.Drawing.Point(529, 63);
- this.CustomTextBoxDPIAdvIpId.MaxLength = 32767;
- this.CustomTextBoxDPIAdvIpId.Multiline = false;
- this.CustomTextBoxDPIAdvIpId.Name = "CustomTextBoxDPIAdvIpId";
- this.CustomTextBoxDPIAdvIpId.ReadOnly = false;
- this.CustomTextBoxDPIAdvIpId.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxDPIAdvIpId.ShortcutsEnabled = true;
- this.CustomTextBoxDPIAdvIpId.Size = new System.Drawing.Size(70, 23);
- this.CustomTextBoxDPIAdvIpId.TabIndex = 0;
- this.CustomTextBoxDPIAdvIpId.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxDPIAdvIpId.Texts = "";
- this.CustomTextBoxDPIAdvIpId.UnderlinedStyle = true;
- this.CustomTextBoxDPIAdvIpId.UsePasswordChar = false;
- this.CustomTextBoxDPIAdvIpId.WordWrap = true;
+ CustomTextBoxDPIAdvIpId.AcceptsReturn = false;
+ CustomTextBoxDPIAdvIpId.AcceptsTab = false;
+ CustomTextBoxDPIAdvIpId.BackColor = Color.DimGray;
+ CustomTextBoxDPIAdvIpId.Border = true;
+ CustomTextBoxDPIAdvIpId.BorderColor = Color.Blue;
+ CustomTextBoxDPIAdvIpId.BorderSize = 1;
+ CustomTextBoxDPIAdvIpId.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxDPIAdvIpId.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxDPIAdvIpId.ForeColor = Color.White;
+ CustomTextBoxDPIAdvIpId.HideSelection = true;
+ CustomTextBoxDPIAdvIpId.Location = new Point(529, 63);
+ CustomTextBoxDPIAdvIpId.MaxLength = 32767;
+ CustomTextBoxDPIAdvIpId.Multiline = false;
+ CustomTextBoxDPIAdvIpId.Name = "CustomTextBoxDPIAdvIpId";
+ CustomTextBoxDPIAdvIpId.ReadOnly = false;
+ CustomTextBoxDPIAdvIpId.ScrollBars = ScrollBars.None;
+ CustomTextBoxDPIAdvIpId.ShortcutsEnabled = true;
+ CustomTextBoxDPIAdvIpId.Size = new Size(70, 23);
+ CustomTextBoxDPIAdvIpId.TabIndex = 0;
+ CustomTextBoxDPIAdvIpId.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxDPIAdvIpId.Texts = "";
+ CustomTextBoxDPIAdvIpId.UnderlinedStyle = true;
+ CustomTextBoxDPIAdvIpId.UsePasswordChar = false;
+ CustomTextBoxDPIAdvIpId.WordWrap = true;
//
// CustomCheckBoxDPIAdvIpId
//
- this.CustomCheckBoxDPIAdvIpId.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvIpId.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvIpId.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvIpId.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvIpId.Location = new System.Drawing.Point(470, 65);
- this.CustomCheckBoxDPIAdvIpId.Name = "CustomCheckBoxDPIAdvIpId";
- this.CustomCheckBoxDPIAdvIpId.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvIpId.Size = new System.Drawing.Size(56, 17);
- this.CustomCheckBoxDPIAdvIpId.TabIndex = 15;
- this.CustomCheckBoxDPIAdvIpId.Text = "--ip-id";
- this.CustomCheckBoxDPIAdvIpId.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvIpId.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvIpId.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvIpId.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvIpId.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvIpId.Location = new Point(470, 65);
+ CustomCheckBoxDPIAdvIpId.Name = "CustomCheckBoxDPIAdvIpId";
+ CustomCheckBoxDPIAdvIpId.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvIpId.Size = new Size(56, 17);
+ CustomCheckBoxDPIAdvIpId.TabIndex = 15;
+ CustomCheckBoxDPIAdvIpId.Text = "--ip-id";
+ CustomCheckBoxDPIAdvIpId.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvPort
//
- this.CustomCheckBoxDPIAdvPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvPort.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvPort.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvPort.Location = new System.Drawing.Point(320, 65);
- this.CustomCheckBoxDPIAdvPort.Name = "CustomCheckBoxDPIAdvPort";
- this.CustomCheckBoxDPIAdvPort.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvPort.Size = new System.Drawing.Size(53, 17);
- this.CustomCheckBoxDPIAdvPort.TabIndex = 13;
- this.CustomCheckBoxDPIAdvPort.Text = "--port";
- this.CustomCheckBoxDPIAdvPort.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvPort.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvPort.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvPort.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvPort.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvPort.Location = new Point(320, 65);
+ CustomCheckBoxDPIAdvPort.Name = "CustomCheckBoxDPIAdvPort";
+ CustomCheckBoxDPIAdvPort.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvPort.Size = new Size(53, 17);
+ CustomCheckBoxDPIAdvPort.TabIndex = 13;
+ CustomCheckBoxDPIAdvPort.Text = "--port";
+ CustomCheckBoxDPIAdvPort.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvW
//
- this.CustomCheckBoxDPIAdvW.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvW.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvW.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvW.Checked = true;
- this.CustomCheckBoxDPIAdvW.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvW.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvW.Location = new System.Drawing.Point(165, 65);
- this.CustomCheckBoxDPIAdvW.Name = "CustomCheckBoxDPIAdvW";
- this.CustomCheckBoxDPIAdvW.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvW.Size = new System.Drawing.Size(34, 17);
- this.CustomCheckBoxDPIAdvW.TabIndex = 12;
- this.CustomCheckBoxDPIAdvW.Text = "-w";
- this.CustomCheckBoxDPIAdvW.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvW.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvW.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvW.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvW.Checked = true;
+ CustomCheckBoxDPIAdvW.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvW.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvW.Location = new Point(165, 65);
+ CustomCheckBoxDPIAdvW.Name = "CustomCheckBoxDPIAdvW";
+ CustomCheckBoxDPIAdvW.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvW.Size = new Size(34, 17);
+ CustomCheckBoxDPIAdvW.TabIndex = 12;
+ CustomCheckBoxDPIAdvW.Text = "-w";
+ CustomCheckBoxDPIAdvW.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvA
//
- this.CustomCheckBoxDPIAdvA.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvA.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvA.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvA.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvA.Location = new System.Drawing.Point(5, 65);
- this.CustomCheckBoxDPIAdvA.Name = "CustomCheckBoxDPIAdvA";
- this.CustomCheckBoxDPIAdvA.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvA.Size = new System.Drawing.Size(32, 17);
- this.CustomCheckBoxDPIAdvA.TabIndex = 11;
- this.CustomCheckBoxDPIAdvA.Text = "-a";
- this.CustomCheckBoxDPIAdvA.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvA.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvA.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvA.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvA.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvA.Location = new Point(5, 65);
+ CustomCheckBoxDPIAdvA.Name = "CustomCheckBoxDPIAdvA";
+ CustomCheckBoxDPIAdvA.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvA.Size = new Size(32, 17);
+ CustomCheckBoxDPIAdvA.TabIndex = 11;
+ CustomCheckBoxDPIAdvA.Text = "-a";
+ CustomCheckBoxDPIAdvA.UseVisualStyleBackColor = false;
//
// CustomNumericUpDownDPIAdvE
//
- this.CustomNumericUpDownDPIAdvE.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDPIAdvE.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDPIAdvE.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDPIAdvE.Location = new System.Drawing.Point(506, 33);
- this.CustomNumericUpDownDPIAdvE.Maximum = new decimal(new int[] {
- 70000,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvE.Name = "CustomNumericUpDownDPIAdvE";
- this.CustomNumericUpDownDPIAdvE.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownDPIAdvE.TabIndex = 10;
- this.CustomNumericUpDownDPIAdvE.Value = new decimal(new int[] {
- 40,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDPIAdvE.BackColor = Color.DimGray;
+ CustomNumericUpDownDPIAdvE.BorderColor = Color.Blue;
+ CustomNumericUpDownDPIAdvE.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDPIAdvE.Location = new Point(506, 33);
+ CustomNumericUpDownDPIAdvE.Maximum = new decimal(new int[] { 70000, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvE.Name = "CustomNumericUpDownDPIAdvE";
+ CustomNumericUpDownDPIAdvE.Size = new Size(53, 23);
+ CustomNumericUpDownDPIAdvE.TabIndex = 10;
+ CustomNumericUpDownDPIAdvE.Value = new decimal(new int[] { 40, 0, 0, 0 });
//
// CustomCheckBoxDPIAdvE
//
- this.CustomCheckBoxDPIAdvE.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvE.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvE.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvE.Checked = true;
- this.CustomCheckBoxDPIAdvE.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvE.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvE.Location = new System.Drawing.Point(470, 35);
- this.CustomCheckBoxDPIAdvE.Name = "CustomCheckBoxDPIAdvE";
- this.CustomCheckBoxDPIAdvE.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvE.Size = new System.Drawing.Size(32, 17);
- this.CustomCheckBoxDPIAdvE.TabIndex = 9;
- this.CustomCheckBoxDPIAdvE.Text = "-e";
- this.CustomCheckBoxDPIAdvE.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvE.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvE.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvE.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvE.Checked = true;
+ CustomCheckBoxDPIAdvE.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvE.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvE.Location = new Point(470, 35);
+ CustomCheckBoxDPIAdvE.Name = "CustomCheckBoxDPIAdvE";
+ CustomCheckBoxDPIAdvE.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvE.Size = new Size(32, 17);
+ CustomCheckBoxDPIAdvE.TabIndex = 9;
+ CustomCheckBoxDPIAdvE.Text = "-e";
+ CustomCheckBoxDPIAdvE.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvN
//
- this.CustomCheckBoxDPIAdvN.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvN.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvN.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvN.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvN.Location = new System.Drawing.Point(320, 35);
- this.CustomCheckBoxDPIAdvN.Name = "CustomCheckBoxDPIAdvN";
- this.CustomCheckBoxDPIAdvN.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvN.Size = new System.Drawing.Size(32, 17);
- this.CustomCheckBoxDPIAdvN.TabIndex = 8;
- this.CustomCheckBoxDPIAdvN.Text = "-n";
- this.CustomCheckBoxDPIAdvN.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvN.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvN.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvN.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvN.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvN.Location = new Point(320, 35);
+ CustomCheckBoxDPIAdvN.Name = "CustomCheckBoxDPIAdvN";
+ CustomCheckBoxDPIAdvN.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvN.Size = new Size(32, 17);
+ CustomCheckBoxDPIAdvN.TabIndex = 8;
+ CustomCheckBoxDPIAdvN.Text = "-n";
+ CustomCheckBoxDPIAdvN.UseVisualStyleBackColor = false;
//
// CustomNumericUpDownDPIAdvK
//
- this.CustomNumericUpDownDPIAdvK.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDPIAdvK.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDPIAdvK.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDPIAdvK.Location = new System.Drawing.Point(201, 33);
- this.CustomNumericUpDownDPIAdvK.Maximum = new decimal(new int[] {
- 10000,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvK.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvK.Name = "CustomNumericUpDownDPIAdvK";
- this.CustomNumericUpDownDPIAdvK.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownDPIAdvK.TabIndex = 7;
- this.CustomNumericUpDownDPIAdvK.Value = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDPIAdvK.BackColor = Color.DimGray;
+ CustomNumericUpDownDPIAdvK.BorderColor = Color.Blue;
+ CustomNumericUpDownDPIAdvK.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDPIAdvK.Location = new Point(201, 33);
+ CustomNumericUpDownDPIAdvK.Maximum = new decimal(new int[] { 10000, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvK.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvK.Name = "CustomNumericUpDownDPIAdvK";
+ CustomNumericUpDownDPIAdvK.Size = new Size(53, 23);
+ CustomNumericUpDownDPIAdvK.TabIndex = 7;
+ CustomNumericUpDownDPIAdvK.Value = new decimal(new int[] { 2, 0, 0, 0 });
//
// CustomCheckBoxDPIAdvK
//
- this.CustomCheckBoxDPIAdvK.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvK.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvK.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvK.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvK.Location = new System.Drawing.Point(165, 35);
- this.CustomCheckBoxDPIAdvK.Name = "CustomCheckBoxDPIAdvK";
- this.CustomCheckBoxDPIAdvK.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvK.Size = new System.Drawing.Size(32, 17);
- this.CustomCheckBoxDPIAdvK.TabIndex = 6;
- this.CustomCheckBoxDPIAdvK.Text = "-k";
- this.CustomCheckBoxDPIAdvK.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvK.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvK.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvK.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvK.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvK.Location = new Point(165, 35);
+ CustomCheckBoxDPIAdvK.Name = "CustomCheckBoxDPIAdvK";
+ CustomCheckBoxDPIAdvK.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvK.Size = new Size(32, 17);
+ CustomCheckBoxDPIAdvK.TabIndex = 6;
+ CustomCheckBoxDPIAdvK.Text = "-k";
+ CustomCheckBoxDPIAdvK.UseVisualStyleBackColor = false;
//
// CustomNumericUpDownDPIAdvF
//
- this.CustomNumericUpDownDPIAdvF.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownDPIAdvF.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownDPIAdvF.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownDPIAdvF.Location = new System.Drawing.Point(38, 33);
- this.CustomNumericUpDownDPIAdvF.Maximum = new decimal(new int[] {
- 70000,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownDPIAdvF.Name = "CustomNumericUpDownDPIAdvF";
- this.CustomNumericUpDownDPIAdvF.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownDPIAdvF.TabIndex = 5;
- this.CustomNumericUpDownDPIAdvF.Value = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
+ CustomNumericUpDownDPIAdvF.BackColor = Color.DimGray;
+ CustomNumericUpDownDPIAdvF.BorderColor = Color.Blue;
+ CustomNumericUpDownDPIAdvF.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownDPIAdvF.Location = new Point(38, 33);
+ CustomNumericUpDownDPIAdvF.Maximum = new decimal(new int[] { 70000, 0, 0, 0 });
+ CustomNumericUpDownDPIAdvF.Name = "CustomNumericUpDownDPIAdvF";
+ CustomNumericUpDownDPIAdvF.Size = new Size(53, 23);
+ CustomNumericUpDownDPIAdvF.TabIndex = 5;
+ CustomNumericUpDownDPIAdvF.Value = new decimal(new int[] { 2, 0, 0, 0 });
//
// CustomCheckBoxDPIAdvF
//
- this.CustomCheckBoxDPIAdvF.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvF.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvF.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvF.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvF.Location = new System.Drawing.Point(5, 35);
- this.CustomCheckBoxDPIAdvF.Name = "CustomCheckBoxDPIAdvF";
- this.CustomCheckBoxDPIAdvF.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvF.Size = new System.Drawing.Size(29, 17);
- this.CustomCheckBoxDPIAdvF.TabIndex = 4;
- this.CustomCheckBoxDPIAdvF.Text = "-f";
- this.CustomCheckBoxDPIAdvF.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvF.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvF.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvF.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvF.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvF.Location = new Point(5, 35);
+ CustomCheckBoxDPIAdvF.Name = "CustomCheckBoxDPIAdvF";
+ CustomCheckBoxDPIAdvF.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvF.Size = new Size(29, 17);
+ CustomCheckBoxDPIAdvF.TabIndex = 4;
+ CustomCheckBoxDPIAdvF.Text = "-f";
+ CustomCheckBoxDPIAdvF.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvM
//
- this.CustomCheckBoxDPIAdvM.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvM.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvM.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvM.Checked = true;
- this.CustomCheckBoxDPIAdvM.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvM.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvM.Location = new System.Drawing.Point(470, 5);
- this.CustomCheckBoxDPIAdvM.Name = "CustomCheckBoxDPIAdvM";
- this.CustomCheckBoxDPIAdvM.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvM.Size = new System.Drawing.Size(36, 17);
- this.CustomCheckBoxDPIAdvM.TabIndex = 3;
- this.CustomCheckBoxDPIAdvM.Text = "-m";
- this.CustomCheckBoxDPIAdvM.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvM.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvM.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvM.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvM.Checked = true;
+ CustomCheckBoxDPIAdvM.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvM.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvM.Location = new Point(470, 5);
+ CustomCheckBoxDPIAdvM.Name = "CustomCheckBoxDPIAdvM";
+ CustomCheckBoxDPIAdvM.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvM.Size = new Size(36, 17);
+ CustomCheckBoxDPIAdvM.TabIndex = 3;
+ CustomCheckBoxDPIAdvM.Text = "-m";
+ CustomCheckBoxDPIAdvM.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvS
//
- this.CustomCheckBoxDPIAdvS.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvS.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvS.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvS.Checked = true;
- this.CustomCheckBoxDPIAdvS.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvS.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvS.Location = new System.Drawing.Point(320, 5);
- this.CustomCheckBoxDPIAdvS.Name = "CustomCheckBoxDPIAdvS";
- this.CustomCheckBoxDPIAdvS.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvS.Size = new System.Drawing.Size(31, 17);
- this.CustomCheckBoxDPIAdvS.TabIndex = 2;
- this.CustomCheckBoxDPIAdvS.Text = "-s";
- this.CustomCheckBoxDPIAdvS.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvS.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvS.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvS.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvS.Checked = true;
+ CustomCheckBoxDPIAdvS.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvS.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvS.Location = new Point(320, 5);
+ CustomCheckBoxDPIAdvS.Name = "CustomCheckBoxDPIAdvS";
+ CustomCheckBoxDPIAdvS.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvS.Size = new Size(31, 17);
+ CustomCheckBoxDPIAdvS.TabIndex = 2;
+ CustomCheckBoxDPIAdvS.Text = "-s";
+ CustomCheckBoxDPIAdvS.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvR
//
- this.CustomCheckBoxDPIAdvR.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvR.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvR.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvR.Checked = true;
- this.CustomCheckBoxDPIAdvR.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvR.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvR.Location = new System.Drawing.Point(165, 5);
- this.CustomCheckBoxDPIAdvR.Name = "CustomCheckBoxDPIAdvR";
- this.CustomCheckBoxDPIAdvR.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvR.Size = new System.Drawing.Size(30, 17);
- this.CustomCheckBoxDPIAdvR.TabIndex = 1;
- this.CustomCheckBoxDPIAdvR.Text = "-r";
- this.CustomCheckBoxDPIAdvR.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvR.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvR.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvR.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvR.Checked = true;
+ CustomCheckBoxDPIAdvR.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvR.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvR.Location = new Point(165, 5);
+ CustomCheckBoxDPIAdvR.Name = "CustomCheckBoxDPIAdvR";
+ CustomCheckBoxDPIAdvR.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvR.Size = new Size(30, 17);
+ CustomCheckBoxDPIAdvR.TabIndex = 1;
+ CustomCheckBoxDPIAdvR.Text = "-r";
+ CustomCheckBoxDPIAdvR.UseVisualStyleBackColor = false;
//
// CustomCheckBoxDPIAdvP
//
- this.CustomCheckBoxDPIAdvP.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxDPIAdvP.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvP.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxDPIAdvP.Checked = true;
- this.CustomCheckBoxDPIAdvP.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxDPIAdvP.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxDPIAdvP.Location = new System.Drawing.Point(5, 5);
- this.CustomCheckBoxDPIAdvP.Name = "CustomCheckBoxDPIAdvP";
- this.CustomCheckBoxDPIAdvP.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxDPIAdvP.Size = new System.Drawing.Size(33, 17);
- this.CustomCheckBoxDPIAdvP.TabIndex = 0;
- this.CustomCheckBoxDPIAdvP.Text = "-p";
- this.CustomCheckBoxDPIAdvP.UseVisualStyleBackColor = false;
+ CustomCheckBoxDPIAdvP.BackColor = Color.DimGray;
+ CustomCheckBoxDPIAdvP.BorderColor = Color.Blue;
+ CustomCheckBoxDPIAdvP.CheckColor = Color.Blue;
+ CustomCheckBoxDPIAdvP.Checked = true;
+ CustomCheckBoxDPIAdvP.CheckState = CheckState.Checked;
+ CustomCheckBoxDPIAdvP.ForeColor = Color.White;
+ CustomCheckBoxDPIAdvP.Location = new Point(5, 5);
+ CustomCheckBoxDPIAdvP.Name = "CustomCheckBoxDPIAdvP";
+ CustomCheckBoxDPIAdvP.SelectionColor = Color.LightBlue;
+ CustomCheckBoxDPIAdvP.Size = new Size(33, 17);
+ CustomCheckBoxDPIAdvP.TabIndex = 0;
+ CustomCheckBoxDPIAdvP.Text = "-p";
+ CustomCheckBoxDPIAdvP.UseVisualStyleBackColor = false;
//
// TabPageTools
//
- this.TabPageTools.BackColor = System.Drawing.Color.Transparent;
- this.TabPageTools.Controls.Add(this.CustomButtonToolsStampGenerator);
- this.TabPageTools.Controls.Add(this.CustomButtonToolsStampReader);
- this.TabPageTools.Controls.Add(this.CustomButtonToolsDnsLookup);
- this.TabPageTools.Controls.Add(this.CustomButtonToolsIpScanner);
- this.TabPageTools.Location = new System.Drawing.Point(4, 25);
- this.TabPageTools.Name = "TabPageTools";
- this.TabPageTools.Size = new System.Drawing.Size(692, 371);
- this.TabPageTools.TabIndex = 3;
- this.TabPageTools.Tag = 1;
- this.TabPageTools.Text = "Tools";
+ TabPageTools.BackColor = Color.Transparent;
+ TabPageTools.Controls.Add(CustomButtonToolsDnsScanner);
+ TabPageTools.Controls.Add(CustomButtonToolsStampGenerator);
+ TabPageTools.Controls.Add(CustomButtonToolsStampReader);
+ TabPageTools.Controls.Add(CustomButtonToolsDnsLookup);
+ TabPageTools.Controls.Add(CustomButtonToolsIpScanner);
+ TabPageTools.Location = new Point(4, 25);
+ TabPageTools.Name = "TabPageTools";
+ TabPageTools.Size = new Size(692, 371);
+ TabPageTools.TabIndex = 3;
+ TabPageTools.Tag = 1;
+ TabPageTools.Text = "Tools";
+ //
+ // CustomButtonToolsDnsScanner
+ //
+ CustomButtonToolsDnsScanner.BorderColor = Color.Blue;
+ CustomButtonToolsDnsScanner.FlatStyle = FlatStyle.Flat;
+ CustomButtonToolsDnsScanner.Location = new Point(50, 50);
+ CustomButtonToolsDnsScanner.Name = "CustomButtonToolsDnsScanner";
+ CustomButtonToolsDnsScanner.RoundedCorners = 5;
+ CustomButtonToolsDnsScanner.SelectionColor = Color.LightBlue;
+ CustomButtonToolsDnsScanner.Size = new Size(110, 27);
+ CustomButtonToolsDnsScanner.TabIndex = 4;
+ CustomButtonToolsDnsScanner.Text = "DNS Scanner";
+ CustomButtonToolsDnsScanner.UseVisualStyleBackColor = true;
+ CustomButtonToolsDnsScanner.Click += CustomButtonToolsDnsScanner_Click;
//
// CustomButtonToolsStampGenerator
//
- this.CustomButtonToolsStampGenerator.AutoSize = true;
- this.CustomButtonToolsStampGenerator.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonToolsStampGenerator.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonToolsStampGenerator.Location = new System.Drawing.Point(50, 200);
- this.CustomButtonToolsStampGenerator.Name = "CustomButtonToolsStampGenerator";
- this.CustomButtonToolsStampGenerator.RoundedCorners = 5;
- this.CustomButtonToolsStampGenerator.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonToolsStampGenerator.Size = new System.Drawing.Size(108, 27);
- this.CustomButtonToolsStampGenerator.TabIndex = 3;
- this.CustomButtonToolsStampGenerator.Text = "Stamp Generator";
- this.CustomButtonToolsStampGenerator.UseVisualStyleBackColor = true;
- this.CustomButtonToolsStampGenerator.Click += new System.EventHandler(this.CustomButtonToolsStampGenerator_Click);
+ CustomButtonToolsStampGenerator.BorderColor = Color.Blue;
+ CustomButtonToolsStampGenerator.FlatStyle = FlatStyle.Flat;
+ CustomButtonToolsStampGenerator.Location = new Point(50, 200);
+ CustomButtonToolsStampGenerator.Name = "CustomButtonToolsStampGenerator";
+ CustomButtonToolsStampGenerator.RoundedCorners = 5;
+ CustomButtonToolsStampGenerator.SelectionColor = Color.LightBlue;
+ CustomButtonToolsStampGenerator.Size = new Size(110, 27);
+ CustomButtonToolsStampGenerator.TabIndex = 3;
+ CustomButtonToolsStampGenerator.Text = "Stamp Generator";
+ CustomButtonToolsStampGenerator.UseVisualStyleBackColor = true;
+ CustomButtonToolsStampGenerator.Click += CustomButtonToolsStampGenerator_Click;
//
// CustomButtonToolsStampReader
//
- this.CustomButtonToolsStampReader.AutoSize = true;
- this.CustomButtonToolsStampReader.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonToolsStampReader.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonToolsStampReader.Location = new System.Drawing.Point(50, 150);
- this.CustomButtonToolsStampReader.Name = "CustomButtonToolsStampReader";
- this.CustomButtonToolsStampReader.RoundedCorners = 5;
- this.CustomButtonToolsStampReader.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonToolsStampReader.Size = new System.Drawing.Size(92, 27);
- this.CustomButtonToolsStampReader.TabIndex = 2;
- this.CustomButtonToolsStampReader.Text = "Stamp Reader";
- this.CustomButtonToolsStampReader.UseVisualStyleBackColor = true;
- this.CustomButtonToolsStampReader.Click += new System.EventHandler(this.CustomButtonToolsStampReader_Click);
+ CustomButtonToolsStampReader.BorderColor = Color.Blue;
+ CustomButtonToolsStampReader.FlatStyle = FlatStyle.Flat;
+ CustomButtonToolsStampReader.Location = new Point(50, 150);
+ CustomButtonToolsStampReader.Name = "CustomButtonToolsStampReader";
+ CustomButtonToolsStampReader.RoundedCorners = 5;
+ CustomButtonToolsStampReader.SelectionColor = Color.LightBlue;
+ CustomButtonToolsStampReader.Size = new Size(110, 27);
+ CustomButtonToolsStampReader.TabIndex = 2;
+ CustomButtonToolsStampReader.Text = "Stamp Reader";
+ CustomButtonToolsStampReader.UseVisualStyleBackColor = true;
+ CustomButtonToolsStampReader.Click += CustomButtonToolsStampReader_Click;
//
// CustomButtonToolsDnsLookup
//
- this.CustomButtonToolsDnsLookup.AutoSize = true;
- this.CustomButtonToolsDnsLookup.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonToolsDnsLookup.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonToolsDnsLookup.Location = new System.Drawing.Point(50, 100);
- this.CustomButtonToolsDnsLookup.Name = "CustomButtonToolsDnsLookup";
- this.CustomButtonToolsDnsLookup.RoundedCorners = 5;
- this.CustomButtonToolsDnsLookup.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonToolsDnsLookup.Size = new System.Drawing.Size(85, 27);
- this.CustomButtonToolsDnsLookup.TabIndex = 1;
- this.CustomButtonToolsDnsLookup.Text = "DNS Lookup";
- this.CustomButtonToolsDnsLookup.UseVisualStyleBackColor = true;
- this.CustomButtonToolsDnsLookup.Click += new System.EventHandler(this.CustomButtonToolsDnsLookup_Click);
+ CustomButtonToolsDnsLookup.BorderColor = Color.Blue;
+ CustomButtonToolsDnsLookup.FlatStyle = FlatStyle.Flat;
+ CustomButtonToolsDnsLookup.Location = new Point(50, 100);
+ CustomButtonToolsDnsLookup.Name = "CustomButtonToolsDnsLookup";
+ CustomButtonToolsDnsLookup.RoundedCorners = 5;
+ CustomButtonToolsDnsLookup.SelectionColor = Color.LightBlue;
+ CustomButtonToolsDnsLookup.Size = new Size(110, 27);
+ CustomButtonToolsDnsLookup.TabIndex = 1;
+ CustomButtonToolsDnsLookup.Text = "DNS Lookup";
+ CustomButtonToolsDnsLookup.UseVisualStyleBackColor = true;
+ CustomButtonToolsDnsLookup.Click += CustomButtonToolsDnsLookup_Click;
//
// CustomButtonToolsIpScanner
//
- this.CustomButtonToolsIpScanner.AutoSize = true;
- this.CustomButtonToolsIpScanner.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonToolsIpScanner.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonToolsIpScanner.Location = new System.Drawing.Point(50, 50);
- this.CustomButtonToolsIpScanner.Name = "CustomButtonToolsIpScanner";
- this.CustomButtonToolsIpScanner.RoundedCorners = 5;
- this.CustomButtonToolsIpScanner.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonToolsIpScanner.Size = new System.Drawing.Size(107, 27);
- this.CustomButtonToolsIpScanner.TabIndex = 0;
- this.CustomButtonToolsIpScanner.Text = "Clean IP Scanner";
- this.CustomButtonToolsIpScanner.UseVisualStyleBackColor = true;
- this.CustomButtonToolsIpScanner.Click += new System.EventHandler(this.CustomButtonToolsIpScanner_Click);
+ CustomButtonToolsIpScanner.BorderColor = Color.Blue;
+ CustomButtonToolsIpScanner.FlatStyle = FlatStyle.Flat;
+ CustomButtonToolsIpScanner.Location = new Point(50, 250);
+ CustomButtonToolsIpScanner.Name = "CustomButtonToolsIpScanner";
+ CustomButtonToolsIpScanner.RoundedCorners = 5;
+ CustomButtonToolsIpScanner.SelectionColor = Color.LightBlue;
+ CustomButtonToolsIpScanner.Size = new Size(110, 27);
+ CustomButtonToolsIpScanner.TabIndex = 0;
+ CustomButtonToolsIpScanner.Text = "Clean IP Scanner";
+ CustomButtonToolsIpScanner.UseVisualStyleBackColor = true;
+ CustomButtonToolsIpScanner.Click += CustomButtonToolsIpScanner_Click;
//
// TabPageSettings
//
- this.TabPageSettings.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettings.Controls.Add(this.CustomTabControlSettings);
- this.TabPageSettings.Location = new System.Drawing.Point(4, 25);
- this.TabPageSettings.Name = "TabPageSettings";
- this.TabPageSettings.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettings.Size = new System.Drawing.Size(692, 371);
- this.TabPageSettings.TabIndex = 1;
- this.TabPageSettings.Tag = 2;
- this.TabPageSettings.Text = "Settings";
+ TabPageSettings.BackColor = Color.Transparent;
+ TabPageSettings.Controls.Add(CustomTabControlSettings);
+ TabPageSettings.Location = new Point(4, 25);
+ TabPageSettings.Name = "TabPageSettings";
+ TabPageSettings.Padding = new Padding(3);
+ TabPageSettings.Size = new Size(692, 371);
+ TabPageSettings.TabIndex = 1;
+ TabPageSettings.Tag = 2;
+ TabPageSettings.Text = "Settings";
//
// CustomTabControlSettings
//
- this.CustomTabControlSettings.Alignment = System.Windows.Forms.TabAlignment.Left;
- this.CustomTabControlSettings.BorderColor = System.Drawing.Color.Blue;
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsWorkingMode);
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsCheck);
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsConnect);
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsSetUnsetDNS);
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsShare);
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsFakeProxy);
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsCPU);
- this.CustomTabControlSettings.Controls.Add(this.TabPageSettingsOthers);
- this.CustomTabControlSettings.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomTabControlSettings.HideTabHeader = false;
- this.CustomTabControlSettings.ItemSize = new System.Drawing.Size(30, 90);
- this.CustomTabControlSettings.Location = new System.Drawing.Point(3, 3);
- this.CustomTabControlSettings.Margin = new System.Windows.Forms.Padding(0);
- this.CustomTabControlSettings.Multiline = true;
- this.CustomTabControlSettings.Name = "CustomTabControlSettings";
- this.CustomTabControlSettings.RightToLeft = System.Windows.Forms.RightToLeft.No;
- this.CustomTabControlSettings.SelectedIndex = 0;
- this.CustomTabControlSettings.Size = new System.Drawing.Size(686, 365);
- this.CustomTabControlSettings.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
- this.CustomTabControlSettings.TabIndex = 10;
- this.CustomTabControlSettings.Tag = 0;
+ CustomTabControlSettings.Alignment = TabAlignment.Left;
+ CustomTabControlSettings.BorderColor = Color.Blue;
+ CustomTabControlSettings.Controls.Add(TabPageSettingsWorkingMode);
+ CustomTabControlSettings.Controls.Add(TabPageSettingsCheck);
+ CustomTabControlSettings.Controls.Add(TabPageSettingsConnect);
+ CustomTabControlSettings.Controls.Add(TabPageSettingsSetUnsetDNS);
+ CustomTabControlSettings.Controls.Add(TabPageSettingsShare);
+ CustomTabControlSettings.Controls.Add(TabPageSettingsFakeProxy);
+ CustomTabControlSettings.Controls.Add(TabPageSettingsCPU);
+ CustomTabControlSettings.Controls.Add(TabPageSettingsOthers);
+ CustomTabControlSettings.Dock = DockStyle.Fill;
+ CustomTabControlSettings.HideTabHeader = false;
+ CustomTabControlSettings.ItemSize = new Size(30, 90);
+ CustomTabControlSettings.Location = new Point(3, 3);
+ CustomTabControlSettings.Margin = new Padding(0);
+ CustomTabControlSettings.Multiline = true;
+ CustomTabControlSettings.Name = "CustomTabControlSettings";
+ CustomTabControlSettings.RightToLeft = RightToLeft.No;
+ CustomTabControlSettings.SelectedIndex = 0;
+ CustomTabControlSettings.Size = new Size(686, 365);
+ CustomTabControlSettings.SizeMode = TabSizeMode.Fixed;
+ CustomTabControlSettings.TabIndex = 10;
+ CustomTabControlSettings.Tag = 7;
//
// TabPageSettingsWorkingMode
//
- this.TabPageSettingsWorkingMode.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsWorkingMode.Controls.Add(this.CustomNumericUpDownSettingWorkingModeSetDohPort);
- this.TabPageSettingsWorkingMode.Controls.Add(this.CustomLabelSettingWorkingModeSetDohPort);
- this.TabPageSettingsWorkingMode.Controls.Add(this.CustomButtonSettingUninstallCertificate);
- this.TabPageSettingsWorkingMode.Controls.Add(this.CustomLabelSettingInfoWorkingMode2);
- this.TabPageSettingsWorkingMode.Controls.Add(this.CustomRadioButtonSettingWorkingModeDNSandDoH);
- this.TabPageSettingsWorkingMode.Controls.Add(this.CustomRadioButtonSettingWorkingModeDNS);
- this.TabPageSettingsWorkingMode.Controls.Add(this.CustomLabelSettingInfoWorkingMode1);
- this.TabPageSettingsWorkingMode.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsWorkingMode.Name = "TabPageSettingsWorkingMode";
- this.TabPageSettingsWorkingMode.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsWorkingMode.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsWorkingMode.TabIndex = 0;
- this.TabPageSettingsWorkingMode.Tag = 0;
- this.TabPageSettingsWorkingMode.Text = "Working mode";
+ TabPageSettingsWorkingMode.BackColor = Color.Transparent;
+ TabPageSettingsWorkingMode.Controls.Add(CustomNumericUpDownSettingWorkingModeSetDohPort);
+ TabPageSettingsWorkingMode.Controls.Add(CustomLabelSettingWorkingModeSetDohPort);
+ TabPageSettingsWorkingMode.Controls.Add(CustomButtonSettingUninstallCertificate);
+ TabPageSettingsWorkingMode.Controls.Add(CustomLabelSettingInfoWorkingMode2);
+ TabPageSettingsWorkingMode.Controls.Add(CustomRadioButtonSettingWorkingModeDNSandDoH);
+ TabPageSettingsWorkingMode.Controls.Add(CustomRadioButtonSettingWorkingModeDNS);
+ TabPageSettingsWorkingMode.Controls.Add(CustomLabelSettingInfoWorkingMode1);
+ TabPageSettingsWorkingMode.Location = new Point(94, 4);
+ TabPageSettingsWorkingMode.Name = "TabPageSettingsWorkingMode";
+ TabPageSettingsWorkingMode.Padding = new Padding(3);
+ TabPageSettingsWorkingMode.Size = new Size(588, 357);
+ TabPageSettingsWorkingMode.TabIndex = 0;
+ TabPageSettingsWorkingMode.Tag = 0;
+ TabPageSettingsWorkingMode.Text = "Working mode";
//
// CustomNumericUpDownSettingWorkingModeSetDohPort
//
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.Location = new System.Drawing.Point(179, 178);
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.Name = "CustomNumericUpDownSettingWorkingModeSetDohPort";
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.TabIndex = 6;
- this.CustomNumericUpDownSettingWorkingModeSetDohPort.Value = new decimal(new int[] {
- 443,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingWorkingModeSetDohPort.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingWorkingModeSetDohPort.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingWorkingModeSetDohPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingWorkingModeSetDohPort.Location = new Point(179, 178);
+ CustomNumericUpDownSettingWorkingModeSetDohPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownSettingWorkingModeSetDohPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingWorkingModeSetDohPort.Name = "CustomNumericUpDownSettingWorkingModeSetDohPort";
+ CustomNumericUpDownSettingWorkingModeSetDohPort.Size = new Size(53, 23);
+ CustomNumericUpDownSettingWorkingModeSetDohPort.TabIndex = 6;
+ CustomNumericUpDownSettingWorkingModeSetDohPort.Value = new decimal(new int[] { 443, 0, 0, 0 });
//
// CustomLabelSettingWorkingModeSetDohPort
//
- this.CustomLabelSettingWorkingModeSetDohPort.AutoSize = true;
- this.CustomLabelSettingWorkingModeSetDohPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingWorkingModeSetDohPort.Border = false;
- this.CustomLabelSettingWorkingModeSetDohPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingWorkingModeSetDohPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingWorkingModeSetDohPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingWorkingModeSetDohPort.Location = new System.Drawing.Point(65, 180);
- this.CustomLabelSettingWorkingModeSetDohPort.Name = "CustomLabelSettingWorkingModeSetDohPort";
- this.CustomLabelSettingWorkingModeSetDohPort.RoundedCorners = 0;
- this.CustomLabelSettingWorkingModeSetDohPort.Size = new System.Drawing.Size(106, 15);
- this.CustomLabelSettingWorkingModeSetDohPort.TabIndex = 5;
- this.CustomLabelSettingWorkingModeSetDohPort.Text = "Set local DoH port:";
+ CustomLabelSettingWorkingModeSetDohPort.AutoSize = true;
+ CustomLabelSettingWorkingModeSetDohPort.BackColor = Color.DimGray;
+ CustomLabelSettingWorkingModeSetDohPort.Border = false;
+ CustomLabelSettingWorkingModeSetDohPort.BorderColor = Color.Blue;
+ CustomLabelSettingWorkingModeSetDohPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingWorkingModeSetDohPort.ForeColor = Color.White;
+ CustomLabelSettingWorkingModeSetDohPort.Location = new Point(65, 180);
+ CustomLabelSettingWorkingModeSetDohPort.Name = "CustomLabelSettingWorkingModeSetDohPort";
+ CustomLabelSettingWorkingModeSetDohPort.RoundedCorners = 0;
+ CustomLabelSettingWorkingModeSetDohPort.Size = new Size(106, 15);
+ CustomLabelSettingWorkingModeSetDohPort.TabIndex = 5;
+ CustomLabelSettingWorkingModeSetDohPort.Text = "Set local DoH port:";
//
// CustomButtonSettingUninstallCertificate
//
- this.CustomButtonSettingUninstallCertificate.AutoSize = true;
- this.CustomButtonSettingUninstallCertificate.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonSettingUninstallCertificate.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonSettingUninstallCertificate.Location = new System.Drawing.Point(50, 220);
- this.CustomButtonSettingUninstallCertificate.Name = "CustomButtonSettingUninstallCertificate";
- this.CustomButtonSettingUninstallCertificate.RoundedCorners = 5;
- this.CustomButtonSettingUninstallCertificate.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonSettingUninstallCertificate.Size = new System.Drawing.Size(120, 27);
- this.CustomButtonSettingUninstallCertificate.TabIndex = 4;
- this.CustomButtonSettingUninstallCertificate.Text = "Uninstall certificate";
- this.CustomButtonSettingUninstallCertificate.UseVisualStyleBackColor = true;
- this.CustomButtonSettingUninstallCertificate.Click += new System.EventHandler(this.CustomButtonSettingUninstallCertificate_Click);
+ CustomButtonSettingUninstallCertificate.BorderColor = Color.Blue;
+ CustomButtonSettingUninstallCertificate.FlatStyle = FlatStyle.Flat;
+ CustomButtonSettingUninstallCertificate.Location = new Point(50, 220);
+ CustomButtonSettingUninstallCertificate.Name = "CustomButtonSettingUninstallCertificate";
+ CustomButtonSettingUninstallCertificate.RoundedCorners = 5;
+ CustomButtonSettingUninstallCertificate.SelectionColor = Color.LightBlue;
+ CustomButtonSettingUninstallCertificate.Size = new Size(120, 27);
+ CustomButtonSettingUninstallCertificate.TabIndex = 4;
+ CustomButtonSettingUninstallCertificate.Text = "Uninstall certificate";
+ CustomButtonSettingUninstallCertificate.UseVisualStyleBackColor = true;
+ CustomButtonSettingUninstallCertificate.Click += CustomButtonSettingUninstallCertificate_Click;
//
// CustomLabelSettingInfoWorkingMode2
//
- this.CustomLabelSettingInfoWorkingMode2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomLabelSettingInfoWorkingMode2.AutoSize = true;
- this.CustomLabelSettingInfoWorkingMode2.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingInfoWorkingMode2.Border = false;
- this.CustomLabelSettingInfoWorkingMode2.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingInfoWorkingMode2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingInfoWorkingMode2.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingInfoWorkingMode2.Location = new System.Drawing.Point(50, 334);
- this.CustomLabelSettingInfoWorkingMode2.Name = "CustomLabelSettingInfoWorkingMode2";
- this.CustomLabelSettingInfoWorkingMode2.RoundedCorners = 0;
- this.CustomLabelSettingInfoWorkingMode2.Size = new System.Drawing.Size(262, 15);
- this.CustomLabelSettingInfoWorkingMode2.TabIndex = 3;
- this.CustomLabelSettingInfoWorkingMode2.Text = "* Reconnect is require for changes to take effect.";
+ CustomLabelSettingInfoWorkingMode2.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomLabelSettingInfoWorkingMode2.AutoSize = true;
+ CustomLabelSettingInfoWorkingMode2.BackColor = Color.DimGray;
+ CustomLabelSettingInfoWorkingMode2.Border = false;
+ CustomLabelSettingInfoWorkingMode2.BorderColor = Color.Blue;
+ CustomLabelSettingInfoWorkingMode2.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingInfoWorkingMode2.ForeColor = Color.White;
+ CustomLabelSettingInfoWorkingMode2.Location = new Point(50, 334);
+ CustomLabelSettingInfoWorkingMode2.Name = "CustomLabelSettingInfoWorkingMode2";
+ CustomLabelSettingInfoWorkingMode2.RoundedCorners = 0;
+ CustomLabelSettingInfoWorkingMode2.Size = new Size(262, 15);
+ CustomLabelSettingInfoWorkingMode2.TabIndex = 3;
+ CustomLabelSettingInfoWorkingMode2.Text = "* Reconnect is require for changes to take effect.";
//
// CustomRadioButtonSettingWorkingModeDNSandDoH
//
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.Location = new System.Drawing.Point(50, 145);
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.Name = "CustomRadioButtonSettingWorkingModeDNSandDoH";
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.Size = new System.Drawing.Size(234, 17);
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.TabIndex = 2;
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.Text = "Legacy DNS + DNS-Over-HTTPS Server";
- this.CustomRadioButtonSettingWorkingModeDNSandDoH.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingWorkingModeDNSandDoH.BackColor = Color.DimGray;
+ CustomRadioButtonSettingWorkingModeDNSandDoH.BorderColor = Color.Blue;
+ CustomRadioButtonSettingWorkingModeDNSandDoH.CheckColor = Color.Blue;
+ CustomRadioButtonSettingWorkingModeDNSandDoH.ForeColor = Color.White;
+ CustomRadioButtonSettingWorkingModeDNSandDoH.Location = new Point(50, 145);
+ CustomRadioButtonSettingWorkingModeDNSandDoH.Name = "CustomRadioButtonSettingWorkingModeDNSandDoH";
+ CustomRadioButtonSettingWorkingModeDNSandDoH.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingWorkingModeDNSandDoH.Size = new Size(234, 17);
+ CustomRadioButtonSettingWorkingModeDNSandDoH.TabIndex = 2;
+ CustomRadioButtonSettingWorkingModeDNSandDoH.Text = "Legacy DNS + DNS-Over-HTTPS Server";
+ CustomRadioButtonSettingWorkingModeDNSandDoH.UseVisualStyleBackColor = false;
//
// CustomRadioButtonSettingWorkingModeDNS
//
- this.CustomRadioButtonSettingWorkingModeDNS.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingWorkingModeDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingWorkingModeDNS.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingWorkingModeDNS.Checked = true;
- this.CustomRadioButtonSettingWorkingModeDNS.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingWorkingModeDNS.Location = new System.Drawing.Point(50, 100);
- this.CustomRadioButtonSettingWorkingModeDNS.Name = "CustomRadioButtonSettingWorkingModeDNS";
- this.CustomRadioButtonSettingWorkingModeDNS.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingWorkingModeDNS.Size = new System.Drawing.Size(123, 17);
- this.CustomRadioButtonSettingWorkingModeDNS.TabIndex = 1;
- this.CustomRadioButtonSettingWorkingModeDNS.TabStop = true;
- this.CustomRadioButtonSettingWorkingModeDNS.Text = "Legacy DNS Server";
- this.CustomRadioButtonSettingWorkingModeDNS.UseVisualStyleBackColor = false;
- this.CustomRadioButtonSettingWorkingModeDNS.CheckedChanged += new System.EventHandler(this.SecureDNSClient_CheckedChanged);
+ CustomRadioButtonSettingWorkingModeDNS.BackColor = Color.DimGray;
+ CustomRadioButtonSettingWorkingModeDNS.BorderColor = Color.Blue;
+ CustomRadioButtonSettingWorkingModeDNS.CheckColor = Color.Blue;
+ CustomRadioButtonSettingWorkingModeDNS.Checked = true;
+ CustomRadioButtonSettingWorkingModeDNS.ForeColor = Color.White;
+ CustomRadioButtonSettingWorkingModeDNS.Location = new Point(50, 100);
+ CustomRadioButtonSettingWorkingModeDNS.Name = "CustomRadioButtonSettingWorkingModeDNS";
+ CustomRadioButtonSettingWorkingModeDNS.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingWorkingModeDNS.Size = new Size(123, 17);
+ CustomRadioButtonSettingWorkingModeDNS.TabIndex = 1;
+ CustomRadioButtonSettingWorkingModeDNS.TabStop = true;
+ CustomRadioButtonSettingWorkingModeDNS.Text = "Legacy DNS Server";
+ CustomRadioButtonSettingWorkingModeDNS.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingWorkingModeDNS.CheckedChanged += SecureDNSClient_CheckedChanged;
//
// CustomLabelSettingInfoWorkingMode1
//
- this.CustomLabelSettingInfoWorkingMode1.AutoSize = true;
- this.CustomLabelSettingInfoWorkingMode1.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingInfoWorkingMode1.Border = false;
- this.CustomLabelSettingInfoWorkingMode1.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingInfoWorkingMode1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingInfoWorkingMode1.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingInfoWorkingMode1.Location = new System.Drawing.Point(50, 35);
- this.CustomLabelSettingInfoWorkingMode1.Name = "CustomLabelSettingInfoWorkingMode1";
- this.CustomLabelSettingInfoWorkingMode1.RoundedCorners = 0;
- this.CustomLabelSettingInfoWorkingMode1.Size = new System.Drawing.Size(394, 30);
- this.CustomLabelSettingInfoWorkingMode1.TabIndex = 0;
- this.CustomLabelSettingInfoWorkingMode1.Text = "Legacy DNS Server: You can set and unset DNS easily.\r\nDNS Over HTTPS Server: You " +
- "need to install certificate and set it manually.";
+ CustomLabelSettingInfoWorkingMode1.AutoSize = true;
+ CustomLabelSettingInfoWorkingMode1.BackColor = Color.DimGray;
+ CustomLabelSettingInfoWorkingMode1.Border = false;
+ CustomLabelSettingInfoWorkingMode1.BorderColor = Color.Blue;
+ CustomLabelSettingInfoWorkingMode1.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingInfoWorkingMode1.ForeColor = Color.White;
+ CustomLabelSettingInfoWorkingMode1.Location = new Point(50, 35);
+ CustomLabelSettingInfoWorkingMode1.Name = "CustomLabelSettingInfoWorkingMode1";
+ CustomLabelSettingInfoWorkingMode1.RoundedCorners = 0;
+ CustomLabelSettingInfoWorkingMode1.Size = new Size(394, 30);
+ CustomLabelSettingInfoWorkingMode1.TabIndex = 0;
+ CustomLabelSettingInfoWorkingMode1.Text = "Legacy DNS Server: You can set and unset DNS easily.\r\nDNS Over HTTPS Server: You need to install certificate and set it manually.";
//
// TabPageSettingsCheck
//
- this.TabPageSettingsCheck.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsCheck.Controls.Add(this.CustomGroupBoxSettingCheckDnsProtocol);
- this.TabPageSettingsCheck.Controls.Add(this.CustomGroupBoxSettingCheckSDNS);
- this.TabPageSettingsCheck.Controls.Add(this.CustomTextBoxSettingCheckDPIHost);
- this.TabPageSettingsCheck.Controls.Add(this.CustomLabelSettingCheckDPIInfo);
- this.TabPageSettingsCheck.Controls.Add(this.CustomLabelSettingCheckTimeout);
- this.TabPageSettingsCheck.Controls.Add(this.CustomNumericUpDownSettingCheckTimeout);
- this.TabPageSettingsCheck.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsCheck.Name = "TabPageSettingsCheck";
- this.TabPageSettingsCheck.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsCheck.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsCheck.TabIndex = 3;
- this.TabPageSettingsCheck.Tag = 1;
- this.TabPageSettingsCheck.Text = "Check";
+ TabPageSettingsCheck.BackColor = Color.Transparent;
+ TabPageSettingsCheck.Controls.Add(CustomGroupBoxSettingCheckDnsProtocol);
+ TabPageSettingsCheck.Controls.Add(CustomGroupBoxSettingCheckSDNS);
+ TabPageSettingsCheck.Controls.Add(CustomTextBoxSettingCheckDPIHost);
+ TabPageSettingsCheck.Controls.Add(CustomLabelSettingCheckDPIInfo);
+ TabPageSettingsCheck.Controls.Add(CustomLabelSettingCheckTimeout);
+ TabPageSettingsCheck.Controls.Add(CustomNumericUpDownSettingCheckTimeout);
+ TabPageSettingsCheck.Location = new Point(94, 4);
+ TabPageSettingsCheck.Name = "TabPageSettingsCheck";
+ TabPageSettingsCheck.Padding = new Padding(3);
+ TabPageSettingsCheck.Size = new Size(588, 357);
+ TabPageSettingsCheck.TabIndex = 3;
+ TabPageSettingsCheck.Tag = 1;
+ TabPageSettingsCheck.Text = "Check";
//
// CustomGroupBoxSettingCheckDnsProtocol
//
- this.CustomGroupBoxSettingCheckDnsProtocol.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomGroupBoxSettingCheckDnsProtocol.BorderColor = System.Drawing.Color.Blue;
- this.CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(this.CustomCheckBoxSettingProtocolPlainDNS);
- this.CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(this.CustomCheckBoxSettingProtocolDoQ);
- this.CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(this.CustomCheckBoxSettingProtocolDNSCryptRelay);
- this.CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(this.CustomCheckBoxSettingProtocolDNSCrypt);
- this.CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(this.CustomCheckBoxSettingProtocolTLS);
- this.CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(this.CustomCheckBoxSettingProtocolDoH);
- this.CustomGroupBoxSettingCheckDnsProtocol.Location = new System.Drawing.Point(4, 105);
- this.CustomGroupBoxSettingCheckDnsProtocol.Name = "CustomGroupBoxSettingCheckDnsProtocol";
- this.CustomGroupBoxSettingCheckDnsProtocol.Size = new System.Drawing.Size(580, 87);
- this.CustomGroupBoxSettingCheckDnsProtocol.TabIndex = 13;
- this.CustomGroupBoxSettingCheckDnsProtocol.TabStop = false;
- this.CustomGroupBoxSettingCheckDnsProtocol.Text = "Select protocol";
+ CustomGroupBoxSettingCheckDnsProtocol.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ CustomGroupBoxSettingCheckDnsProtocol.BorderColor = Color.Blue;
+ CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(CustomCheckBoxSettingProtocolPlainDNS);
+ CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(CustomCheckBoxSettingProtocolDoQ);
+ CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(CustomCheckBoxSettingProtocolDNSCryptRelay);
+ CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(CustomCheckBoxSettingProtocolDNSCrypt);
+ CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(CustomCheckBoxSettingProtocolTLS);
+ CustomGroupBoxSettingCheckDnsProtocol.Controls.Add(CustomCheckBoxSettingProtocolDoH);
+ CustomGroupBoxSettingCheckDnsProtocol.Location = new Point(4, 105);
+ CustomGroupBoxSettingCheckDnsProtocol.Name = "CustomGroupBoxSettingCheckDnsProtocol";
+ CustomGroupBoxSettingCheckDnsProtocol.Size = new Size(580, 87);
+ CustomGroupBoxSettingCheckDnsProtocol.TabIndex = 13;
+ CustomGroupBoxSettingCheckDnsProtocol.TabStop = false;
+ CustomGroupBoxSettingCheckDnsProtocol.Text = "Select protocol";
//
// CustomCheckBoxSettingProtocolPlainDNS
//
- this.CustomCheckBoxSettingProtocolPlainDNS.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingProtocolPlainDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolPlainDNS.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolPlainDNS.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingProtocolPlainDNS.Location = new System.Drawing.Point(420, 55);
- this.CustomCheckBoxSettingProtocolPlainDNS.Name = "CustomCheckBoxSettingProtocolPlainDNS";
- this.CustomCheckBoxSettingProtocolPlainDNS.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingProtocolPlainDNS.Size = new System.Drawing.Size(75, 17);
- this.CustomCheckBoxSettingProtocolPlainDNS.TabIndex = 5;
- this.CustomCheckBoxSettingProtocolPlainDNS.Text = "Plain DNS";
- this.CustomCheckBoxSettingProtocolPlainDNS.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingProtocolPlainDNS.BackColor = Color.DimGray;
+ CustomCheckBoxSettingProtocolPlainDNS.BorderColor = Color.Blue;
+ CustomCheckBoxSettingProtocolPlainDNS.CheckColor = Color.Blue;
+ CustomCheckBoxSettingProtocolPlainDNS.ForeColor = Color.White;
+ CustomCheckBoxSettingProtocolPlainDNS.Location = new Point(420, 55);
+ CustomCheckBoxSettingProtocolPlainDNS.Name = "CustomCheckBoxSettingProtocolPlainDNS";
+ CustomCheckBoxSettingProtocolPlainDNS.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingProtocolPlainDNS.Size = new Size(75, 17);
+ CustomCheckBoxSettingProtocolPlainDNS.TabIndex = 5;
+ CustomCheckBoxSettingProtocolPlainDNS.Text = "Plain DNS";
+ CustomCheckBoxSettingProtocolPlainDNS.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingProtocolDoQ
//
- this.CustomCheckBoxSettingProtocolDoQ.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingProtocolDoQ.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDoQ.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDoQ.Checked = true;
- this.CustomCheckBoxSettingProtocolDoQ.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingProtocolDoQ.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingProtocolDoQ.Location = new System.Drawing.Point(230, 55);
- this.CustomCheckBoxSettingProtocolDoQ.Name = "CustomCheckBoxSettingProtocolDoQ";
- this.CustomCheckBoxSettingProtocolDoQ.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingProtocolDoQ.Size = new System.Drawing.Size(106, 17);
- this.CustomCheckBoxSettingProtocolDoQ.TabIndex = 4;
- this.CustomCheckBoxSettingProtocolDoQ.Text = "DNS-Over-Quic";
- this.CustomCheckBoxSettingProtocolDoQ.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingProtocolDoQ.BackColor = Color.DimGray;
+ CustomCheckBoxSettingProtocolDoQ.BorderColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDoQ.CheckColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDoQ.Checked = true;
+ CustomCheckBoxSettingProtocolDoQ.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingProtocolDoQ.ForeColor = Color.White;
+ CustomCheckBoxSettingProtocolDoQ.Location = new Point(230, 55);
+ CustomCheckBoxSettingProtocolDoQ.Name = "CustomCheckBoxSettingProtocolDoQ";
+ CustomCheckBoxSettingProtocolDoQ.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingProtocolDoQ.Size = new Size(106, 17);
+ CustomCheckBoxSettingProtocolDoQ.TabIndex = 4;
+ CustomCheckBoxSettingProtocolDoQ.Text = "DNS-Over-Quic";
+ CustomCheckBoxSettingProtocolDoQ.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingProtocolDNSCryptRelay
//
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.Checked = true;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.Location = new System.Drawing.Point(15, 55);
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.Name = "CustomCheckBoxSettingProtocolDNSCryptRelay";
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.Size = new System.Drawing.Size(107, 17);
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.TabIndex = 3;
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.Text = "DNSCrypt Relay";
- this.CustomCheckBoxSettingProtocolDNSCryptRelay.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.BackColor = Color.DimGray;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.BorderColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.CheckColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.Checked = true;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.ForeColor = Color.White;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.Location = new Point(15, 55);
+ CustomCheckBoxSettingProtocolDNSCryptRelay.Name = "CustomCheckBoxSettingProtocolDNSCryptRelay";
+ CustomCheckBoxSettingProtocolDNSCryptRelay.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.Size = new Size(107, 17);
+ CustomCheckBoxSettingProtocolDNSCryptRelay.TabIndex = 3;
+ CustomCheckBoxSettingProtocolDNSCryptRelay.Text = "DNSCrypt Relay";
+ CustomCheckBoxSettingProtocolDNSCryptRelay.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingProtocolDNSCrypt
//
- this.CustomCheckBoxSettingProtocolDNSCrypt.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingProtocolDNSCrypt.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDNSCrypt.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDNSCrypt.Checked = true;
- this.CustomCheckBoxSettingProtocolDNSCrypt.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingProtocolDNSCrypt.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingProtocolDNSCrypt.Location = new System.Drawing.Point(420, 25);
- this.CustomCheckBoxSettingProtocolDNSCrypt.Name = "CustomCheckBoxSettingProtocolDNSCrypt";
- this.CustomCheckBoxSettingProtocolDNSCrypt.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingProtocolDNSCrypt.Size = new System.Drawing.Size(74, 17);
- this.CustomCheckBoxSettingProtocolDNSCrypt.TabIndex = 2;
- this.CustomCheckBoxSettingProtocolDNSCrypt.Text = "DNSCrypt";
- this.CustomCheckBoxSettingProtocolDNSCrypt.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingProtocolDNSCrypt.BackColor = Color.DimGray;
+ CustomCheckBoxSettingProtocolDNSCrypt.BorderColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDNSCrypt.CheckColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDNSCrypt.Checked = true;
+ CustomCheckBoxSettingProtocolDNSCrypt.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingProtocolDNSCrypt.ForeColor = Color.White;
+ CustomCheckBoxSettingProtocolDNSCrypt.Location = new Point(420, 25);
+ CustomCheckBoxSettingProtocolDNSCrypt.Name = "CustomCheckBoxSettingProtocolDNSCrypt";
+ CustomCheckBoxSettingProtocolDNSCrypt.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingProtocolDNSCrypt.Size = new Size(74, 17);
+ CustomCheckBoxSettingProtocolDNSCrypt.TabIndex = 2;
+ CustomCheckBoxSettingProtocolDNSCrypt.Text = "DNSCrypt";
+ CustomCheckBoxSettingProtocolDNSCrypt.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingProtocolTLS
//
- this.CustomCheckBoxSettingProtocolTLS.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingProtocolTLS.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolTLS.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolTLS.Checked = true;
- this.CustomCheckBoxSettingProtocolTLS.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingProtocolTLS.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingProtocolTLS.Location = new System.Drawing.Point(230, 25);
- this.CustomCheckBoxSettingProtocolTLS.Name = "CustomCheckBoxSettingProtocolTLS";
- this.CustomCheckBoxSettingProtocolTLS.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingProtocolTLS.Size = new System.Drawing.Size(100, 17);
- this.CustomCheckBoxSettingProtocolTLS.TabIndex = 1;
- this.CustomCheckBoxSettingProtocolTLS.Text = "DNS-Over-TLS";
- this.CustomCheckBoxSettingProtocolTLS.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingProtocolTLS.BackColor = Color.DimGray;
+ CustomCheckBoxSettingProtocolTLS.BorderColor = Color.Blue;
+ CustomCheckBoxSettingProtocolTLS.CheckColor = Color.Blue;
+ CustomCheckBoxSettingProtocolTLS.Checked = true;
+ CustomCheckBoxSettingProtocolTLS.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingProtocolTLS.ForeColor = Color.White;
+ CustomCheckBoxSettingProtocolTLS.Location = new Point(230, 25);
+ CustomCheckBoxSettingProtocolTLS.Name = "CustomCheckBoxSettingProtocolTLS";
+ CustomCheckBoxSettingProtocolTLS.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingProtocolTLS.Size = new Size(100, 17);
+ CustomCheckBoxSettingProtocolTLS.TabIndex = 1;
+ CustomCheckBoxSettingProtocolTLS.Text = "DNS-Over-TLS";
+ CustomCheckBoxSettingProtocolTLS.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingProtocolDoH
//
- this.CustomCheckBoxSettingProtocolDoH.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingProtocolDoH.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDoH.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProtocolDoH.Checked = true;
- this.CustomCheckBoxSettingProtocolDoH.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingProtocolDoH.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingProtocolDoH.Location = new System.Drawing.Point(15, 25);
- this.CustomCheckBoxSettingProtocolDoH.Name = "CustomCheckBoxSettingProtocolDoH";
- this.CustomCheckBoxSettingProtocolDoH.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingProtocolDoH.Size = new System.Drawing.Size(116, 17);
- this.CustomCheckBoxSettingProtocolDoH.TabIndex = 0;
- this.CustomCheckBoxSettingProtocolDoH.Text = "DNS-Over-HTTPS";
- this.CustomCheckBoxSettingProtocolDoH.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingProtocolDoH.BackColor = Color.DimGray;
+ CustomCheckBoxSettingProtocolDoH.BorderColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDoH.CheckColor = Color.Blue;
+ CustomCheckBoxSettingProtocolDoH.Checked = true;
+ CustomCheckBoxSettingProtocolDoH.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingProtocolDoH.ForeColor = Color.White;
+ CustomCheckBoxSettingProtocolDoH.Location = new Point(15, 25);
+ CustomCheckBoxSettingProtocolDoH.Name = "CustomCheckBoxSettingProtocolDoH";
+ CustomCheckBoxSettingProtocolDoH.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingProtocolDoH.Size = new Size(116, 17);
+ CustomCheckBoxSettingProtocolDoH.TabIndex = 0;
+ CustomCheckBoxSettingProtocolDoH.Text = "DNS-Over-HTTPS";
+ CustomCheckBoxSettingProtocolDoH.UseVisualStyleBackColor = false;
//
// CustomGroupBoxSettingCheckSDNS
//
- this.CustomGroupBoxSettingCheckSDNS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomGroupBoxSettingCheckSDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomGroupBoxSettingCheckSDNS.Controls.Add(this.CustomCheckBoxSettingSdnsNoFilter);
- this.CustomGroupBoxSettingCheckSDNS.Controls.Add(this.CustomCheckBoxSettingSdnsNoLog);
- this.CustomGroupBoxSettingCheckSDNS.Controls.Add(this.CustomCheckBoxSettingSdnsDNSSec);
- this.CustomGroupBoxSettingCheckSDNS.Location = new System.Drawing.Point(4, 196);
- this.CustomGroupBoxSettingCheckSDNS.Margin = new System.Windows.Forms.Padding(1);
- this.CustomGroupBoxSettingCheckSDNS.Name = "CustomGroupBoxSettingCheckSDNS";
- this.CustomGroupBoxSettingCheckSDNS.Size = new System.Drawing.Size(580, 65);
- this.CustomGroupBoxSettingCheckSDNS.TabIndex = 11;
- this.CustomGroupBoxSettingCheckSDNS.TabStop = false;
- this.CustomGroupBoxSettingCheckSDNS.Text = "sdns:// servers must have";
+ CustomGroupBoxSettingCheckSDNS.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
+ CustomGroupBoxSettingCheckSDNS.BorderColor = Color.Blue;
+ CustomGroupBoxSettingCheckSDNS.Controls.Add(CustomCheckBoxSettingSdnsNoFilter);
+ CustomGroupBoxSettingCheckSDNS.Controls.Add(CustomCheckBoxSettingSdnsNoLog);
+ CustomGroupBoxSettingCheckSDNS.Controls.Add(CustomCheckBoxSettingSdnsDNSSec);
+ CustomGroupBoxSettingCheckSDNS.Location = new Point(4, 196);
+ CustomGroupBoxSettingCheckSDNS.Margin = new Padding(1);
+ CustomGroupBoxSettingCheckSDNS.Name = "CustomGroupBoxSettingCheckSDNS";
+ CustomGroupBoxSettingCheckSDNS.Size = new Size(580, 65);
+ CustomGroupBoxSettingCheckSDNS.TabIndex = 11;
+ CustomGroupBoxSettingCheckSDNS.TabStop = false;
+ CustomGroupBoxSettingCheckSDNS.Text = "sdns:// servers must have";
//
// CustomCheckBoxSettingSdnsNoFilter
//
- this.CustomCheckBoxSettingSdnsNoFilter.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingSdnsNoFilter.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingSdnsNoFilter.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingSdnsNoFilter.Checked = true;
- this.CustomCheckBoxSettingSdnsNoFilter.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingSdnsNoFilter.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingSdnsNoFilter.Location = new System.Drawing.Point(420, 28);
- this.CustomCheckBoxSettingSdnsNoFilter.Name = "CustomCheckBoxSettingSdnsNoFilter";
- this.CustomCheckBoxSettingSdnsNoFilter.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingSdnsNoFilter.Size = new System.Drawing.Size(67, 17);
- this.CustomCheckBoxSettingSdnsNoFilter.TabIndex = 2;
- this.CustomCheckBoxSettingSdnsNoFilter.Text = "No Filter";
- this.CustomCheckBoxSettingSdnsNoFilter.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingSdnsNoFilter.BackColor = Color.DimGray;
+ CustomCheckBoxSettingSdnsNoFilter.BorderColor = Color.Blue;
+ CustomCheckBoxSettingSdnsNoFilter.CheckColor = Color.Blue;
+ CustomCheckBoxSettingSdnsNoFilter.Checked = true;
+ CustomCheckBoxSettingSdnsNoFilter.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingSdnsNoFilter.ForeColor = Color.White;
+ CustomCheckBoxSettingSdnsNoFilter.Location = new Point(420, 28);
+ CustomCheckBoxSettingSdnsNoFilter.Name = "CustomCheckBoxSettingSdnsNoFilter";
+ CustomCheckBoxSettingSdnsNoFilter.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingSdnsNoFilter.Size = new Size(67, 17);
+ CustomCheckBoxSettingSdnsNoFilter.TabIndex = 2;
+ CustomCheckBoxSettingSdnsNoFilter.Text = "No Filter";
+ CustomCheckBoxSettingSdnsNoFilter.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingSdnsNoLog
//
- this.CustomCheckBoxSettingSdnsNoLog.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingSdnsNoLog.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingSdnsNoLog.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingSdnsNoLog.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingSdnsNoLog.Location = new System.Drawing.Point(230, 28);
- this.CustomCheckBoxSettingSdnsNoLog.Name = "CustomCheckBoxSettingSdnsNoLog";
- this.CustomCheckBoxSettingSdnsNoLog.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingSdnsNoLog.Size = new System.Drawing.Size(61, 17);
- this.CustomCheckBoxSettingSdnsNoLog.TabIndex = 1;
- this.CustomCheckBoxSettingSdnsNoLog.Text = "No Log";
- this.CustomCheckBoxSettingSdnsNoLog.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingSdnsNoLog.BackColor = Color.DimGray;
+ CustomCheckBoxSettingSdnsNoLog.BorderColor = Color.Blue;
+ CustomCheckBoxSettingSdnsNoLog.CheckColor = Color.Blue;
+ CustomCheckBoxSettingSdnsNoLog.ForeColor = Color.White;
+ CustomCheckBoxSettingSdnsNoLog.Location = new Point(230, 28);
+ CustomCheckBoxSettingSdnsNoLog.Name = "CustomCheckBoxSettingSdnsNoLog";
+ CustomCheckBoxSettingSdnsNoLog.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingSdnsNoLog.Size = new Size(61, 17);
+ CustomCheckBoxSettingSdnsNoLog.TabIndex = 1;
+ CustomCheckBoxSettingSdnsNoLog.Text = "No Log";
+ CustomCheckBoxSettingSdnsNoLog.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingSdnsDNSSec
//
- this.CustomCheckBoxSettingSdnsDNSSec.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingSdnsDNSSec.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingSdnsDNSSec.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingSdnsDNSSec.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingSdnsDNSSec.Location = new System.Drawing.Point(15, 28);
- this.CustomCheckBoxSettingSdnsDNSSec.Name = "CustomCheckBoxSettingSdnsDNSSec";
- this.CustomCheckBoxSettingSdnsDNSSec.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingSdnsDNSSec.Size = new System.Drawing.Size(111, 17);
- this.CustomCheckBoxSettingSdnsDNSSec.TabIndex = 0;
- this.CustomCheckBoxSettingSdnsDNSSec.Text = "DNSSec Enabled";
- this.CustomCheckBoxSettingSdnsDNSSec.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingSdnsDNSSec.BackColor = Color.DimGray;
+ CustomCheckBoxSettingSdnsDNSSec.BorderColor = Color.Blue;
+ CustomCheckBoxSettingSdnsDNSSec.CheckColor = Color.Blue;
+ CustomCheckBoxSettingSdnsDNSSec.ForeColor = Color.White;
+ CustomCheckBoxSettingSdnsDNSSec.Location = new Point(15, 28);
+ CustomCheckBoxSettingSdnsDNSSec.Name = "CustomCheckBoxSettingSdnsDNSSec";
+ CustomCheckBoxSettingSdnsDNSSec.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingSdnsDNSSec.Size = new Size(111, 17);
+ CustomCheckBoxSettingSdnsDNSSec.TabIndex = 0;
+ CustomCheckBoxSettingSdnsDNSSec.Text = "DNSSec Enabled";
+ CustomCheckBoxSettingSdnsDNSSec.UseVisualStyleBackColor = false;
//
// CustomTextBoxSettingCheckDPIHost
//
- this.CustomTextBoxSettingCheckDPIHost.AcceptsReturn = false;
- this.CustomTextBoxSettingCheckDPIHost.AcceptsTab = false;
- this.CustomTextBoxSettingCheckDPIHost.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingCheckDPIHost.Border = true;
- this.CustomTextBoxSettingCheckDPIHost.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingCheckDPIHost.BorderSize = 1;
- this.CustomTextBoxSettingCheckDPIHost.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingCheckDPIHost.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingCheckDPIHost.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingCheckDPIHost.HideSelection = true;
- this.CustomTextBoxSettingCheckDPIHost.Location = new System.Drawing.Point(274, 63);
- this.CustomTextBoxSettingCheckDPIHost.MaxLength = 32767;
- this.CustomTextBoxSettingCheckDPIHost.Multiline = false;
- this.CustomTextBoxSettingCheckDPIHost.Name = "CustomTextBoxSettingCheckDPIHost";
- this.CustomTextBoxSettingCheckDPIHost.ReadOnly = false;
- this.CustomTextBoxSettingCheckDPIHost.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingCheckDPIHost.ShortcutsEnabled = true;
- this.CustomTextBoxSettingCheckDPIHost.Size = new System.Drawing.Size(143, 23);
- this.CustomTextBoxSettingCheckDPIHost.TabIndex = 0;
- this.CustomTextBoxSettingCheckDPIHost.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingCheckDPIHost.Texts = "www.youtube.com";
- this.CustomTextBoxSettingCheckDPIHost.UnderlinedStyle = true;
- this.CustomTextBoxSettingCheckDPIHost.UsePasswordChar = false;
- this.CustomTextBoxSettingCheckDPIHost.WordWrap = true;
+ CustomTextBoxSettingCheckDPIHost.AcceptsReturn = false;
+ CustomTextBoxSettingCheckDPIHost.AcceptsTab = false;
+ CustomTextBoxSettingCheckDPIHost.BackColor = Color.DimGray;
+ CustomTextBoxSettingCheckDPIHost.Border = true;
+ CustomTextBoxSettingCheckDPIHost.BorderColor = Color.Blue;
+ CustomTextBoxSettingCheckDPIHost.BorderSize = 1;
+ CustomTextBoxSettingCheckDPIHost.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingCheckDPIHost.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingCheckDPIHost.ForeColor = Color.White;
+ CustomTextBoxSettingCheckDPIHost.HideSelection = true;
+ CustomTextBoxSettingCheckDPIHost.Location = new Point(274, 63);
+ CustomTextBoxSettingCheckDPIHost.MaxLength = 32767;
+ CustomTextBoxSettingCheckDPIHost.Multiline = false;
+ CustomTextBoxSettingCheckDPIHost.Name = "CustomTextBoxSettingCheckDPIHost";
+ CustomTextBoxSettingCheckDPIHost.ReadOnly = false;
+ CustomTextBoxSettingCheckDPIHost.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingCheckDPIHost.ShortcutsEnabled = true;
+ CustomTextBoxSettingCheckDPIHost.Size = new Size(143, 23);
+ CustomTextBoxSettingCheckDPIHost.TabIndex = 0;
+ CustomTextBoxSettingCheckDPIHost.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingCheckDPIHost.Texts = "www.youtube.com";
+ CustomTextBoxSettingCheckDPIHost.UnderlinedStyle = true;
+ CustomTextBoxSettingCheckDPIHost.UsePasswordChar = false;
+ CustomTextBoxSettingCheckDPIHost.WordWrap = true;
//
// CustomLabelSettingCheckDPIInfo
//
- this.CustomLabelSettingCheckDPIInfo.AutoSize = true;
- this.CustomLabelSettingCheckDPIInfo.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingCheckDPIInfo.Border = false;
- this.CustomLabelSettingCheckDPIInfo.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingCheckDPIInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingCheckDPIInfo.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingCheckDPIInfo.Location = new System.Drawing.Point(15, 65);
- this.CustomLabelSettingCheckDPIInfo.Name = "CustomLabelSettingCheckDPIInfo";
- this.CustomLabelSettingCheckDPIInfo.RoundedCorners = 0;
- this.CustomLabelSettingCheckDPIInfo.Size = new System.Drawing.Size(257, 15);
- this.CustomLabelSettingCheckDPIInfo.TabIndex = 10;
- this.CustomLabelSettingCheckDPIInfo.Text = "A DNS based blocked website to check. https://";
+ CustomLabelSettingCheckDPIInfo.AutoSize = true;
+ CustomLabelSettingCheckDPIInfo.BackColor = Color.DimGray;
+ CustomLabelSettingCheckDPIInfo.Border = false;
+ CustomLabelSettingCheckDPIInfo.BorderColor = Color.Blue;
+ CustomLabelSettingCheckDPIInfo.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingCheckDPIInfo.ForeColor = Color.White;
+ CustomLabelSettingCheckDPIInfo.Location = new Point(15, 65);
+ CustomLabelSettingCheckDPIInfo.Name = "CustomLabelSettingCheckDPIInfo";
+ CustomLabelSettingCheckDPIInfo.RoundedCorners = 0;
+ CustomLabelSettingCheckDPIInfo.Size = new Size(257, 15);
+ CustomLabelSettingCheckDPIInfo.TabIndex = 10;
+ CustomLabelSettingCheckDPIInfo.Text = "A DNS based blocked website to check. https://";
//
// CustomLabelSettingCheckTimeout
//
- this.CustomLabelSettingCheckTimeout.AutoSize = true;
- this.CustomLabelSettingCheckTimeout.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingCheckTimeout.Border = false;
- this.CustomLabelSettingCheckTimeout.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingCheckTimeout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingCheckTimeout.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingCheckTimeout.Location = new System.Drawing.Point(15, 25);
- this.CustomLabelSettingCheckTimeout.Name = "CustomLabelSettingCheckTimeout";
- this.CustomLabelSettingCheckTimeout.RoundedCorners = 0;
- this.CustomLabelSettingCheckTimeout.Size = new System.Drawing.Size(142, 15);
- this.CustomLabelSettingCheckTimeout.TabIndex = 2;
- this.CustomLabelSettingCheckTimeout.Text = "Check timeout (seconds):";
+ CustomLabelSettingCheckTimeout.AutoSize = true;
+ CustomLabelSettingCheckTimeout.BackColor = Color.DimGray;
+ CustomLabelSettingCheckTimeout.Border = false;
+ CustomLabelSettingCheckTimeout.BorderColor = Color.Blue;
+ CustomLabelSettingCheckTimeout.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingCheckTimeout.ForeColor = Color.White;
+ CustomLabelSettingCheckTimeout.Location = new Point(15, 25);
+ CustomLabelSettingCheckTimeout.Name = "CustomLabelSettingCheckTimeout";
+ CustomLabelSettingCheckTimeout.RoundedCorners = 0;
+ CustomLabelSettingCheckTimeout.Size = new Size(142, 15);
+ CustomLabelSettingCheckTimeout.TabIndex = 2;
+ CustomLabelSettingCheckTimeout.Text = "Check timeout (seconds):";
//
// CustomNumericUpDownSettingCheckTimeout
//
- this.CustomNumericUpDownSettingCheckTimeout.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingCheckTimeout.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingCheckTimeout.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingCheckTimeout.DecimalPlaces = 1;
- this.CustomNumericUpDownSettingCheckTimeout.Increment = new decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.CustomNumericUpDownSettingCheckTimeout.Location = new System.Drawing.Point(160, 23);
- this.CustomNumericUpDownSettingCheckTimeout.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingCheckTimeout.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 65536});
- this.CustomNumericUpDownSettingCheckTimeout.Name = "CustomNumericUpDownSettingCheckTimeout";
- this.CustomNumericUpDownSettingCheckTimeout.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownSettingCheckTimeout.TabIndex = 3;
- this.CustomNumericUpDownSettingCheckTimeout.Value = new decimal(new int[] {
- 5,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingCheckTimeout.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingCheckTimeout.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingCheckTimeout.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingCheckTimeout.DecimalPlaces = 1;
+ CustomNumericUpDownSettingCheckTimeout.Increment = new decimal(new int[] { 1, 0, 0, 65536 });
+ CustomNumericUpDownSettingCheckTimeout.Location = new Point(160, 23);
+ CustomNumericUpDownSettingCheckTimeout.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
+ CustomNumericUpDownSettingCheckTimeout.Minimum = new decimal(new int[] { 1, 0, 0, 65536 });
+ CustomNumericUpDownSettingCheckTimeout.Name = "CustomNumericUpDownSettingCheckTimeout";
+ CustomNumericUpDownSettingCheckTimeout.Size = new Size(45, 23);
+ CustomNumericUpDownSettingCheckTimeout.TabIndex = 3;
+ CustomNumericUpDownSettingCheckTimeout.Value = new decimal(new int[] { 5, 0, 0, 0 });
//
// TabPageSettingsConnect
//
- this.TabPageSettingsConnect.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsConnect.Controls.Add(this.CustomCheckBoxSettingEnableCache);
- this.TabPageSettingsConnect.Controls.Add(this.CustomNumericUpDownSettingCamouflageDnsPort);
- this.TabPageSettingsConnect.Controls.Add(this.CustomLabelSettingCamouflageDnsPort);
- this.TabPageSettingsConnect.Controls.Add(this.CustomNumericUpDownSettingMaxServers);
- this.TabPageSettingsConnect.Controls.Add(this.CustomLabelSettingMaxServers);
- this.TabPageSettingsConnect.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsConnect.Name = "TabPageSettingsConnect";
- this.TabPageSettingsConnect.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsConnect.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsConnect.TabIndex = 4;
- this.TabPageSettingsConnect.Tag = 2;
- this.TabPageSettingsConnect.Text = "Connect";
+ TabPageSettingsConnect.BackColor = Color.Transparent;
+ TabPageSettingsConnect.Controls.Add(CustomCheckBoxSettingEnableCache);
+ TabPageSettingsConnect.Controls.Add(CustomNumericUpDownSettingCamouflageDnsPort);
+ TabPageSettingsConnect.Controls.Add(CustomLabelSettingCamouflageDnsPort);
+ TabPageSettingsConnect.Controls.Add(CustomNumericUpDownSettingMaxServers);
+ TabPageSettingsConnect.Controls.Add(CustomLabelSettingMaxServers);
+ TabPageSettingsConnect.Location = new Point(94, 4);
+ TabPageSettingsConnect.Name = "TabPageSettingsConnect";
+ TabPageSettingsConnect.Padding = new Padding(3);
+ TabPageSettingsConnect.Size = new Size(588, 357);
+ TabPageSettingsConnect.TabIndex = 4;
+ TabPageSettingsConnect.Tag = 2;
+ TabPageSettingsConnect.Text = "Connect";
//
// CustomCheckBoxSettingEnableCache
//
- this.CustomCheckBoxSettingEnableCache.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingEnableCache.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingEnableCache.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingEnableCache.Checked = true;
- this.CustomCheckBoxSettingEnableCache.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingEnableCache.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingEnableCache.Location = new System.Drawing.Point(50, 50);
- this.CustomCheckBoxSettingEnableCache.Name = "CustomCheckBoxSettingEnableCache";
- this.CustomCheckBoxSettingEnableCache.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingEnableCache.Size = new System.Drawing.Size(119, 17);
- this.CustomCheckBoxSettingEnableCache.TabIndex = 17;
- this.CustomCheckBoxSettingEnableCache.Text = "Enable DNS cache";
- this.CustomCheckBoxSettingEnableCache.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingEnableCache.BackColor = Color.DimGray;
+ CustomCheckBoxSettingEnableCache.BorderColor = Color.Blue;
+ CustomCheckBoxSettingEnableCache.CheckColor = Color.Blue;
+ CustomCheckBoxSettingEnableCache.Checked = true;
+ CustomCheckBoxSettingEnableCache.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingEnableCache.ForeColor = Color.White;
+ CustomCheckBoxSettingEnableCache.Location = new Point(50, 50);
+ CustomCheckBoxSettingEnableCache.Name = "CustomCheckBoxSettingEnableCache";
+ CustomCheckBoxSettingEnableCache.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingEnableCache.Size = new Size(119, 17);
+ CustomCheckBoxSettingEnableCache.TabIndex = 17;
+ CustomCheckBoxSettingEnableCache.Text = "Enable DNS cache";
+ CustomCheckBoxSettingEnableCache.UseVisualStyleBackColor = false;
//
// CustomNumericUpDownSettingCamouflageDnsPort
//
- this.CustomNumericUpDownSettingCamouflageDnsPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingCamouflageDnsPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingCamouflageDnsPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingCamouflageDnsPort.Location = new System.Drawing.Point(225, 148);
- this.CustomNumericUpDownSettingCamouflageDnsPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingCamouflageDnsPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingCamouflageDnsPort.Name = "CustomNumericUpDownSettingCamouflageDnsPort";
- this.CustomNumericUpDownSettingCamouflageDnsPort.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownSettingCamouflageDnsPort.TabIndex = 16;
- this.CustomNumericUpDownSettingCamouflageDnsPort.Value = new decimal(new int[] {
- 5380,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingCamouflageDnsPort.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingCamouflageDnsPort.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingCamouflageDnsPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingCamouflageDnsPort.Location = new Point(225, 148);
+ CustomNumericUpDownSettingCamouflageDnsPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownSettingCamouflageDnsPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingCamouflageDnsPort.Name = "CustomNumericUpDownSettingCamouflageDnsPort";
+ CustomNumericUpDownSettingCamouflageDnsPort.Size = new Size(53, 23);
+ CustomNumericUpDownSettingCamouflageDnsPort.TabIndex = 16;
+ CustomNumericUpDownSettingCamouflageDnsPort.Value = new decimal(new int[] { 5380, 0, 0, 0 });
//
// CustomLabelSettingCamouflageDnsPort
//
- this.CustomLabelSettingCamouflageDnsPort.AutoSize = true;
- this.CustomLabelSettingCamouflageDnsPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingCamouflageDnsPort.Border = false;
- this.CustomLabelSettingCamouflageDnsPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingCamouflageDnsPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingCamouflageDnsPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingCamouflageDnsPort.Location = new System.Drawing.Point(50, 150);
- this.CustomLabelSettingCamouflageDnsPort.Name = "CustomLabelSettingCamouflageDnsPort";
- this.CustomLabelSettingCamouflageDnsPort.RoundedCorners = 0;
- this.CustomLabelSettingCamouflageDnsPort.Size = new System.Drawing.Size(160, 15);
- this.CustomLabelSettingCamouflageDnsPort.TabIndex = 15;
- this.CustomLabelSettingCamouflageDnsPort.Text = "Camouflage DNS server port:";
+ CustomLabelSettingCamouflageDnsPort.AutoSize = true;
+ CustomLabelSettingCamouflageDnsPort.BackColor = Color.DimGray;
+ CustomLabelSettingCamouflageDnsPort.Border = false;
+ CustomLabelSettingCamouflageDnsPort.BorderColor = Color.Blue;
+ CustomLabelSettingCamouflageDnsPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingCamouflageDnsPort.ForeColor = Color.White;
+ CustomLabelSettingCamouflageDnsPort.Location = new Point(50, 150);
+ CustomLabelSettingCamouflageDnsPort.Name = "CustomLabelSettingCamouflageDnsPort";
+ CustomLabelSettingCamouflageDnsPort.RoundedCorners = 0;
+ CustomLabelSettingCamouflageDnsPort.Size = new Size(160, 15);
+ CustomLabelSettingCamouflageDnsPort.TabIndex = 15;
+ CustomLabelSettingCamouflageDnsPort.Text = "Camouflage DNS server port:";
//
// CustomNumericUpDownSettingMaxServers
//
- this.CustomNumericUpDownSettingMaxServers.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingMaxServers.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingMaxServers.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingMaxServers.Location = new System.Drawing.Point(275, 98);
- this.CustomNumericUpDownSettingMaxServers.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingMaxServers.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingMaxServers.Name = "CustomNumericUpDownSettingMaxServers";
- this.CustomNumericUpDownSettingMaxServers.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownSettingMaxServers.TabIndex = 7;
- this.CustomNumericUpDownSettingMaxServers.Value = new decimal(new int[] {
- 5,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingMaxServers.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingMaxServers.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingMaxServers.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingMaxServers.Location = new Point(275, 98);
+ CustomNumericUpDownSettingMaxServers.Maximum = new decimal(new int[] { 10, 0, 0, 0 });
+ CustomNumericUpDownSettingMaxServers.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingMaxServers.Name = "CustomNumericUpDownSettingMaxServers";
+ CustomNumericUpDownSettingMaxServers.Size = new Size(45, 23);
+ CustomNumericUpDownSettingMaxServers.TabIndex = 7;
+ CustomNumericUpDownSettingMaxServers.Value = new decimal(new int[] { 5, 0, 0, 0 });
//
// CustomLabelSettingMaxServers
//
- this.CustomLabelSettingMaxServers.AutoSize = true;
- this.CustomLabelSettingMaxServers.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingMaxServers.Border = false;
- this.CustomLabelSettingMaxServers.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingMaxServers.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingMaxServers.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingMaxServers.Location = new System.Drawing.Point(50, 100);
- this.CustomLabelSettingMaxServers.Name = "CustomLabelSettingMaxServers";
- this.CustomLabelSettingMaxServers.RoundedCorners = 0;
- this.CustomLabelSettingMaxServers.Size = new System.Drawing.Size(223, 15);
- this.CustomLabelSettingMaxServers.TabIndex = 6;
- this.CustomLabelSettingMaxServers.Text = "Maximum number of servers to connect:";
+ CustomLabelSettingMaxServers.AutoSize = true;
+ CustomLabelSettingMaxServers.BackColor = Color.DimGray;
+ CustomLabelSettingMaxServers.Border = false;
+ CustomLabelSettingMaxServers.BorderColor = Color.Blue;
+ CustomLabelSettingMaxServers.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingMaxServers.ForeColor = Color.White;
+ CustomLabelSettingMaxServers.Location = new Point(50, 100);
+ CustomLabelSettingMaxServers.Name = "CustomLabelSettingMaxServers";
+ CustomLabelSettingMaxServers.RoundedCorners = 0;
+ CustomLabelSettingMaxServers.Size = new Size(223, 15);
+ CustomLabelSettingMaxServers.TabIndex = 6;
+ CustomLabelSettingMaxServers.Text = "Maximum number of servers to connect:";
//
// TabPageSettingsSetUnsetDNS
//
- this.TabPageSettingsSetUnsetDNS.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsSetUnsetDNS.Controls.Add(this.CustomTextBoxSettingUnsetDns2);
- this.TabPageSettingsSetUnsetDNS.Controls.Add(this.CustomTextBoxSettingUnsetDns1);
- this.TabPageSettingsSetUnsetDNS.Controls.Add(this.CustomLabelSettingUnsetDns2);
- this.TabPageSettingsSetUnsetDNS.Controls.Add(this.CustomLabelSettingUnsetDns1);
- this.TabPageSettingsSetUnsetDNS.Controls.Add(this.CustomRadioButtonSettingUnsetDnsToStatic);
- this.TabPageSettingsSetUnsetDNS.Controls.Add(this.CustomRadioButtonSettingUnsetDnsToDhcp);
- this.TabPageSettingsSetUnsetDNS.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsSetUnsetDNS.Name = "TabPageSettingsSetUnsetDNS";
- this.TabPageSettingsSetUnsetDNS.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsSetUnsetDNS.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsSetUnsetDNS.TabIndex = 5;
- this.TabPageSettingsSetUnsetDNS.Tag = 3;
- this.TabPageSettingsSetUnsetDNS.Text = "Set/Unset DNS";
+ TabPageSettingsSetUnsetDNS.BackColor = Color.Transparent;
+ TabPageSettingsSetUnsetDNS.Controls.Add(CustomTextBoxSettingUnsetDns2);
+ TabPageSettingsSetUnsetDNS.Controls.Add(CustomTextBoxSettingUnsetDns1);
+ TabPageSettingsSetUnsetDNS.Controls.Add(CustomLabelSettingUnsetDns2);
+ TabPageSettingsSetUnsetDNS.Controls.Add(CustomLabelSettingUnsetDns1);
+ TabPageSettingsSetUnsetDNS.Controls.Add(CustomRadioButtonSettingUnsetDnsToStatic);
+ TabPageSettingsSetUnsetDNS.Controls.Add(CustomRadioButtonSettingUnsetDnsToDhcp);
+ TabPageSettingsSetUnsetDNS.Location = new Point(94, 4);
+ TabPageSettingsSetUnsetDNS.Name = "TabPageSettingsSetUnsetDNS";
+ TabPageSettingsSetUnsetDNS.Padding = new Padding(3);
+ TabPageSettingsSetUnsetDNS.Size = new Size(588, 357);
+ TabPageSettingsSetUnsetDNS.TabIndex = 5;
+ TabPageSettingsSetUnsetDNS.Tag = 3;
+ TabPageSettingsSetUnsetDNS.Text = "Set/Unset DNS";
//
// CustomTextBoxSettingUnsetDns2
//
- this.CustomTextBoxSettingUnsetDns2.AcceptsReturn = false;
- this.CustomTextBoxSettingUnsetDns2.AcceptsTab = false;
- this.CustomTextBoxSettingUnsetDns2.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingUnsetDns2.Border = true;
- this.CustomTextBoxSettingUnsetDns2.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingUnsetDns2.BorderSize = 1;
- this.CustomTextBoxSettingUnsetDns2.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingUnsetDns2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingUnsetDns2.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingUnsetDns2.HideSelection = true;
- this.CustomTextBoxSettingUnsetDns2.Location = new System.Drawing.Point(180, 138);
- this.CustomTextBoxSettingUnsetDns2.MaxLength = 32767;
- this.CustomTextBoxSettingUnsetDns2.Multiline = false;
- this.CustomTextBoxSettingUnsetDns2.Name = "CustomTextBoxSettingUnsetDns2";
- this.CustomTextBoxSettingUnsetDns2.ReadOnly = false;
- this.CustomTextBoxSettingUnsetDns2.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingUnsetDns2.ShortcutsEnabled = true;
- this.CustomTextBoxSettingUnsetDns2.Size = new System.Drawing.Size(95, 23);
- this.CustomTextBoxSettingUnsetDns2.TabIndex = 0;
- this.CustomTextBoxSettingUnsetDns2.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingUnsetDns2.Texts = "8.8.4.4";
- this.CustomTextBoxSettingUnsetDns2.UnderlinedStyle = true;
- this.CustomTextBoxSettingUnsetDns2.UsePasswordChar = false;
- this.CustomTextBoxSettingUnsetDns2.WordWrap = true;
+ CustomTextBoxSettingUnsetDns2.AcceptsReturn = false;
+ CustomTextBoxSettingUnsetDns2.AcceptsTab = false;
+ CustomTextBoxSettingUnsetDns2.BackColor = Color.DimGray;
+ CustomTextBoxSettingUnsetDns2.Border = true;
+ CustomTextBoxSettingUnsetDns2.BorderColor = Color.Blue;
+ CustomTextBoxSettingUnsetDns2.BorderSize = 1;
+ CustomTextBoxSettingUnsetDns2.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingUnsetDns2.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingUnsetDns2.ForeColor = Color.White;
+ CustomTextBoxSettingUnsetDns2.HideSelection = true;
+ CustomTextBoxSettingUnsetDns2.Location = new Point(180, 138);
+ CustomTextBoxSettingUnsetDns2.MaxLength = 32767;
+ CustomTextBoxSettingUnsetDns2.Multiline = false;
+ CustomTextBoxSettingUnsetDns2.Name = "CustomTextBoxSettingUnsetDns2";
+ CustomTextBoxSettingUnsetDns2.ReadOnly = false;
+ CustomTextBoxSettingUnsetDns2.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingUnsetDns2.ShortcutsEnabled = true;
+ CustomTextBoxSettingUnsetDns2.Size = new Size(95, 23);
+ CustomTextBoxSettingUnsetDns2.TabIndex = 0;
+ CustomTextBoxSettingUnsetDns2.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingUnsetDns2.Texts = "8.8.4.4";
+ CustomTextBoxSettingUnsetDns2.UnderlinedStyle = true;
+ CustomTextBoxSettingUnsetDns2.UsePasswordChar = false;
+ CustomTextBoxSettingUnsetDns2.WordWrap = true;
//
// CustomTextBoxSettingUnsetDns1
//
- this.CustomTextBoxSettingUnsetDns1.AcceptsReturn = false;
- this.CustomTextBoxSettingUnsetDns1.AcceptsTab = false;
- this.CustomTextBoxSettingUnsetDns1.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingUnsetDns1.Border = true;
- this.CustomTextBoxSettingUnsetDns1.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingUnsetDns1.BorderSize = 1;
- this.CustomTextBoxSettingUnsetDns1.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingUnsetDns1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingUnsetDns1.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingUnsetDns1.HideSelection = true;
- this.CustomTextBoxSettingUnsetDns1.Location = new System.Drawing.Point(180, 103);
- this.CustomTextBoxSettingUnsetDns1.MaxLength = 32767;
- this.CustomTextBoxSettingUnsetDns1.Multiline = false;
- this.CustomTextBoxSettingUnsetDns1.Name = "CustomTextBoxSettingUnsetDns1";
- this.CustomTextBoxSettingUnsetDns1.ReadOnly = false;
- this.CustomTextBoxSettingUnsetDns1.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingUnsetDns1.ShortcutsEnabled = true;
- this.CustomTextBoxSettingUnsetDns1.Size = new System.Drawing.Size(95, 23);
- this.CustomTextBoxSettingUnsetDns1.TabIndex = 0;
- this.CustomTextBoxSettingUnsetDns1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingUnsetDns1.Texts = "8.8.8.8";
- this.CustomTextBoxSettingUnsetDns1.UnderlinedStyle = true;
- this.CustomTextBoxSettingUnsetDns1.UsePasswordChar = false;
- this.CustomTextBoxSettingUnsetDns1.WordWrap = true;
+ CustomTextBoxSettingUnsetDns1.AcceptsReturn = false;
+ CustomTextBoxSettingUnsetDns1.AcceptsTab = false;
+ CustomTextBoxSettingUnsetDns1.BackColor = Color.DimGray;
+ CustomTextBoxSettingUnsetDns1.Border = true;
+ CustomTextBoxSettingUnsetDns1.BorderColor = Color.Blue;
+ CustomTextBoxSettingUnsetDns1.BorderSize = 1;
+ CustomTextBoxSettingUnsetDns1.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingUnsetDns1.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingUnsetDns1.ForeColor = Color.White;
+ CustomTextBoxSettingUnsetDns1.HideSelection = true;
+ CustomTextBoxSettingUnsetDns1.Location = new Point(180, 103);
+ CustomTextBoxSettingUnsetDns1.MaxLength = 32767;
+ CustomTextBoxSettingUnsetDns1.Multiline = false;
+ CustomTextBoxSettingUnsetDns1.Name = "CustomTextBoxSettingUnsetDns1";
+ CustomTextBoxSettingUnsetDns1.ReadOnly = false;
+ CustomTextBoxSettingUnsetDns1.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingUnsetDns1.ShortcutsEnabled = true;
+ CustomTextBoxSettingUnsetDns1.Size = new Size(95, 23);
+ CustomTextBoxSettingUnsetDns1.TabIndex = 0;
+ CustomTextBoxSettingUnsetDns1.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingUnsetDns1.Texts = "8.8.8.8";
+ CustomTextBoxSettingUnsetDns1.UnderlinedStyle = true;
+ CustomTextBoxSettingUnsetDns1.UsePasswordChar = false;
+ CustomTextBoxSettingUnsetDns1.WordWrap = true;
//
// CustomLabelSettingUnsetDns2
//
- this.CustomLabelSettingUnsetDns2.AutoSize = true;
- this.CustomLabelSettingUnsetDns2.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingUnsetDns2.Border = false;
- this.CustomLabelSettingUnsetDns2.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingUnsetDns2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingUnsetDns2.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingUnsetDns2.Location = new System.Drawing.Point(110, 140);
- this.CustomLabelSettingUnsetDns2.Name = "CustomLabelSettingUnsetDns2";
- this.CustomLabelSettingUnsetDns2.RoundedCorners = 0;
- this.CustomLabelSettingUnsetDns2.Size = new System.Drawing.Size(65, 15);
- this.CustomLabelSettingUnsetDns2.TabIndex = 3;
- this.CustomLabelSettingUnsetDns2.Text = "Secondary:";
+ CustomLabelSettingUnsetDns2.AutoSize = true;
+ CustomLabelSettingUnsetDns2.BackColor = Color.DimGray;
+ CustomLabelSettingUnsetDns2.Border = false;
+ CustomLabelSettingUnsetDns2.BorderColor = Color.Blue;
+ CustomLabelSettingUnsetDns2.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingUnsetDns2.ForeColor = Color.White;
+ CustomLabelSettingUnsetDns2.Location = new Point(110, 140);
+ CustomLabelSettingUnsetDns2.Name = "CustomLabelSettingUnsetDns2";
+ CustomLabelSettingUnsetDns2.RoundedCorners = 0;
+ CustomLabelSettingUnsetDns2.Size = new Size(65, 15);
+ CustomLabelSettingUnsetDns2.TabIndex = 3;
+ CustomLabelSettingUnsetDns2.Text = "Secondary:";
//
// CustomLabelSettingUnsetDns1
//
- this.CustomLabelSettingUnsetDns1.AutoSize = true;
- this.CustomLabelSettingUnsetDns1.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingUnsetDns1.Border = false;
- this.CustomLabelSettingUnsetDns1.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingUnsetDns1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingUnsetDns1.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingUnsetDns1.Location = new System.Drawing.Point(110, 105);
- this.CustomLabelSettingUnsetDns1.Name = "CustomLabelSettingUnsetDns1";
- this.CustomLabelSettingUnsetDns1.RoundedCorners = 0;
- this.CustomLabelSettingUnsetDns1.Size = new System.Drawing.Size(51, 15);
- this.CustomLabelSettingUnsetDns1.TabIndex = 2;
- this.CustomLabelSettingUnsetDns1.Text = "Primary:";
+ CustomLabelSettingUnsetDns1.AutoSize = true;
+ CustomLabelSettingUnsetDns1.BackColor = Color.DimGray;
+ CustomLabelSettingUnsetDns1.Border = false;
+ CustomLabelSettingUnsetDns1.BorderColor = Color.Blue;
+ CustomLabelSettingUnsetDns1.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingUnsetDns1.ForeColor = Color.White;
+ CustomLabelSettingUnsetDns1.Location = new Point(110, 105);
+ CustomLabelSettingUnsetDns1.Name = "CustomLabelSettingUnsetDns1";
+ CustomLabelSettingUnsetDns1.RoundedCorners = 0;
+ CustomLabelSettingUnsetDns1.Size = new Size(51, 15);
+ CustomLabelSettingUnsetDns1.TabIndex = 2;
+ CustomLabelSettingUnsetDns1.Text = "Primary:";
//
// CustomRadioButtonSettingUnsetDnsToStatic
//
- this.CustomRadioButtonSettingUnsetDnsToStatic.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingUnsetDnsToStatic.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingUnsetDnsToStatic.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingUnsetDnsToStatic.Checked = true;
- this.CustomRadioButtonSettingUnsetDnsToStatic.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingUnsetDnsToStatic.Location = new System.Drawing.Point(50, 70);
- this.CustomRadioButtonSettingUnsetDnsToStatic.Name = "CustomRadioButtonSettingUnsetDnsToStatic";
- this.CustomRadioButtonSettingUnsetDnsToStatic.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingUnsetDnsToStatic.Size = new System.Drawing.Size(131, 17);
- this.CustomRadioButtonSettingUnsetDnsToStatic.TabIndex = 1;
- this.CustomRadioButtonSettingUnsetDnsToStatic.TabStop = true;
- this.CustomRadioButtonSettingUnsetDnsToStatic.Text = "Unset DNS to Static.";
- this.CustomRadioButtonSettingUnsetDnsToStatic.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingUnsetDnsToStatic.BackColor = Color.DimGray;
+ CustomRadioButtonSettingUnsetDnsToStatic.BorderColor = Color.Blue;
+ CustomRadioButtonSettingUnsetDnsToStatic.CheckColor = Color.Blue;
+ CustomRadioButtonSettingUnsetDnsToStatic.Checked = true;
+ CustomRadioButtonSettingUnsetDnsToStatic.ForeColor = Color.White;
+ CustomRadioButtonSettingUnsetDnsToStatic.Location = new Point(50, 70);
+ CustomRadioButtonSettingUnsetDnsToStatic.Name = "CustomRadioButtonSettingUnsetDnsToStatic";
+ CustomRadioButtonSettingUnsetDnsToStatic.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingUnsetDnsToStatic.Size = new Size(131, 17);
+ CustomRadioButtonSettingUnsetDnsToStatic.TabIndex = 1;
+ CustomRadioButtonSettingUnsetDnsToStatic.TabStop = true;
+ CustomRadioButtonSettingUnsetDnsToStatic.Text = "Unset DNS to Static.";
+ CustomRadioButtonSettingUnsetDnsToStatic.UseVisualStyleBackColor = false;
//
// CustomRadioButtonSettingUnsetDnsToDhcp
//
- this.CustomRadioButtonSettingUnsetDnsToDhcp.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingUnsetDnsToDhcp.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingUnsetDnsToDhcp.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingUnsetDnsToDhcp.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingUnsetDnsToDhcp.Location = new System.Drawing.Point(50, 35);
- this.CustomRadioButtonSettingUnsetDnsToDhcp.Name = "CustomRadioButtonSettingUnsetDnsToDhcp";
- this.CustomRadioButtonSettingUnsetDnsToDhcp.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingUnsetDnsToDhcp.Size = new System.Drawing.Size(130, 17);
- this.CustomRadioButtonSettingUnsetDnsToDhcp.TabIndex = 0;
- this.CustomRadioButtonSettingUnsetDnsToDhcp.Text = "Unset DNS to DHCP";
- this.CustomRadioButtonSettingUnsetDnsToDhcp.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingUnsetDnsToDhcp.BackColor = Color.DimGray;
+ CustomRadioButtonSettingUnsetDnsToDhcp.BorderColor = Color.Blue;
+ CustomRadioButtonSettingUnsetDnsToDhcp.CheckColor = Color.Blue;
+ CustomRadioButtonSettingUnsetDnsToDhcp.ForeColor = Color.White;
+ CustomRadioButtonSettingUnsetDnsToDhcp.Location = new Point(50, 35);
+ CustomRadioButtonSettingUnsetDnsToDhcp.Name = "CustomRadioButtonSettingUnsetDnsToDhcp";
+ CustomRadioButtonSettingUnsetDnsToDhcp.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingUnsetDnsToDhcp.Size = new Size(130, 17);
+ CustomRadioButtonSettingUnsetDnsToDhcp.TabIndex = 0;
+ CustomRadioButtonSettingUnsetDnsToDhcp.Text = "Unset DNS to DHCP";
+ CustomRadioButtonSettingUnsetDnsToDhcp.UseVisualStyleBackColor = false;
//
// TabPageSettingsShare
//
- this.TabPageSettingsShare.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsShare.Controls.Add(this.CustomTabControlSettingHttpProxy);
- this.TabPageSettingsShare.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsShare.Name = "TabPageSettingsShare";
- this.TabPageSettingsShare.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsShare.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsShare.TabIndex = 6;
- this.TabPageSettingsShare.Tag = 4;
- this.TabPageSettingsShare.Text = "Share";
+ TabPageSettingsShare.BackColor = Color.Transparent;
+ TabPageSettingsShare.Controls.Add(CustomTabControlSettingHttpProxy);
+ TabPageSettingsShare.Location = new Point(94, 4);
+ TabPageSettingsShare.Name = "TabPageSettingsShare";
+ TabPageSettingsShare.Padding = new Padding(3);
+ TabPageSettingsShare.Size = new Size(588, 357);
+ TabPageSettingsShare.TabIndex = 6;
+ TabPageSettingsShare.Tag = 4;
+ TabPageSettingsShare.Text = "Share";
//
// CustomTabControlSettingHttpProxy
//
- this.CustomTabControlSettingHttpProxy.BorderColor = System.Drawing.Color.Blue;
- this.CustomTabControlSettingHttpProxy.Controls.Add(this.TabPageSettingHttpProxyBasic);
- this.CustomTabControlSettingHttpProxy.Controls.Add(this.TabPageSettingHttpProxyAdvanced);
- this.CustomTabControlSettingHttpProxy.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomTabControlSettingHttpProxy.HideTabHeader = false;
- this.CustomTabControlSettingHttpProxy.Location = new System.Drawing.Point(3, 3);
- this.CustomTabControlSettingHttpProxy.Name = "CustomTabControlSettingHttpProxy";
- this.CustomTabControlSettingHttpProxy.SelectedIndex = 0;
- this.CustomTabControlSettingHttpProxy.Size = new System.Drawing.Size(582, 351);
- this.CustomTabControlSettingHttpProxy.TabIndex = 49;
- this.CustomTabControlSettingHttpProxy.Tag = 1;
+ CustomTabControlSettingHttpProxy.BorderColor = Color.Blue;
+ CustomTabControlSettingHttpProxy.Controls.Add(TabPageSettingHttpProxyBasic);
+ CustomTabControlSettingHttpProxy.Controls.Add(TabPageSettingHttpProxyAdvanced);
+ CustomTabControlSettingHttpProxy.Dock = DockStyle.Fill;
+ CustomTabControlSettingHttpProxy.HideTabHeader = false;
+ CustomTabControlSettingHttpProxy.Location = new Point(3, 3);
+ CustomTabControlSettingHttpProxy.Name = "CustomTabControlSettingHttpProxy";
+ CustomTabControlSettingHttpProxy.SelectedIndex = 0;
+ CustomTabControlSettingHttpProxy.Size = new Size(582, 351);
+ CustomTabControlSettingHttpProxy.TabIndex = 49;
+ CustomTabControlSettingHttpProxy.Tag = 0;
//
// TabPageSettingHttpProxyBasic
//
- this.TabPageSettingHttpProxyBasic.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomLabelSettingHTTPProxyKillRequestTimeout);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomNumericUpDownSettingHTTPProxyUpstreamPort);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomTextBoxSettingHTTPProxyUpstreamHost);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomLabelSettingHTTPProxyUpstreamPort);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomLabelSettingHTTPProxyUpstreamHost);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomComboBoxSettingHttpProxyUpstreamMode);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomCheckBoxSettingHTTPProxyUpstream);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomLabelSettingHTTPProxyPort);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomCheckBoxSettingProxyBlockPort80);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomLabelSettingHTTPProxyHandleRequests);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomNumericUpDownSettingHTTPProxyPort);
- this.TabPageSettingHttpProxyBasic.Controls.Add(this.CustomNumericUpDownSettingHTTPProxyHandleRequests);
- this.TabPageSettingHttpProxyBasic.Location = new System.Drawing.Point(4, 25);
- this.TabPageSettingHttpProxyBasic.Name = "TabPageSettingHttpProxyBasic";
- this.TabPageSettingHttpProxyBasic.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingHttpProxyBasic.Size = new System.Drawing.Size(574, 322);
- this.TabPageSettingHttpProxyBasic.TabIndex = 0;
- this.TabPageSettingHttpProxyBasic.Tag = 0;
- this.TabPageSettingHttpProxyBasic.Text = "Basic";
+ TabPageSettingHttpProxyBasic.BackColor = Color.Transparent;
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomNumericUpDownSettingHTTPProxyKillRequestTimeout);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomLabelSettingHTTPProxyKillRequestTimeout);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomNumericUpDownSettingHTTPProxyUpstreamPort);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomTextBoxSettingHTTPProxyUpstreamHost);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomLabelSettingHTTPProxyUpstreamPort);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomLabelSettingHTTPProxyUpstreamHost);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomComboBoxSettingHttpProxyUpstreamMode);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomCheckBoxSettingHTTPProxyUpstream);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomLabelSettingHTTPProxyPort);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomCheckBoxSettingProxyBlockPort80);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomLabelSettingHTTPProxyHandleRequests);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomNumericUpDownSettingHTTPProxyPort);
+ TabPageSettingHttpProxyBasic.Controls.Add(CustomNumericUpDownSettingHTTPProxyHandleRequests);
+ TabPageSettingHttpProxyBasic.Location = new Point(4, 25);
+ TabPageSettingHttpProxyBasic.Name = "TabPageSettingHttpProxyBasic";
+ TabPageSettingHttpProxyBasic.Padding = new Padding(3);
+ TabPageSettingHttpProxyBasic.Size = new Size(574, 322);
+ TabPageSettingHttpProxyBasic.TabIndex = 0;
+ TabPageSettingHttpProxyBasic.Tag = 0;
+ TabPageSettingHttpProxyBasic.Text = "Basic";
//
// CustomNumericUpDownSettingHTTPProxyKillRequestTimeout
//
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Location = new System.Drawing.Point(172, 63);
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Maximum = new decimal(new int[] {
- 300,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Minimum = new decimal(new int[] {
- 5,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Name = "CustomNumericUpDownSettingHTTPProxyKillRequestTimeout";
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Size = new System.Drawing.Size(55, 23);
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.TabIndex = 56;
- this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Value = new decimal(new int[] {
- 20,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Location = new Point(172, 63);
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Maximum = new decimal(new int[] { 300, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Minimum = new decimal(new int[] { 5, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Name = "CustomNumericUpDownSettingHTTPProxyKillRequestTimeout";
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Size = new Size(55, 23);
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.TabIndex = 56;
+ CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Value = new decimal(new int[] { 20, 0, 0, 0 });
//
// CustomLabelSettingHTTPProxyKillRequestTimeout
//
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.AutoSize = true;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.Border = false;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.Location = new System.Drawing.Point(6, 65);
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.Name = "CustomLabelSettingHTTPProxyKillRequestTimeout";
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.Size = new System.Drawing.Size(158, 15);
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.TabIndex = 55;
- this.CustomLabelSettingHTTPProxyKillRequestTimeout.Text = "Kill request on timeout (sec):";
+ CustomLabelSettingHTTPProxyKillRequestTimeout.AutoSize = true;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.Border = false;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.Location = new Point(6, 65);
+ CustomLabelSettingHTTPProxyKillRequestTimeout.Name = "CustomLabelSettingHTTPProxyKillRequestTimeout";
+ CustomLabelSettingHTTPProxyKillRequestTimeout.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.Size = new Size(158, 15);
+ CustomLabelSettingHTTPProxyKillRequestTimeout.TabIndex = 55;
+ CustomLabelSettingHTTPProxyKillRequestTimeout.Text = "Kill request on timeout (sec):";
//
// CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs
//
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Checked = true;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Location = new System.Drawing.Point(25, 135);
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Name = "CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs";
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Size = new System.Drawing.Size(159, 17);
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.TabIndex = 53;
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Text = "Apply only to blocked IPs";
- this.CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.BackColor = Color.DimGray;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.BorderColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.CheckColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Checked = true;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.ForeColor = Color.White;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Location = new Point(25, 135);
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Name = "CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs";
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Size = new Size(159, 17);
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.TabIndex = 53;
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Text = "Apply only to blocked IPs";
+ CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.UseVisualStyleBackColor = false;
//
// CustomNumericUpDownSettingHTTPProxyUpstreamPort
//
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.Location = new System.Drawing.Point(370, 165);
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.Name = "CustomNumericUpDownSettingHTTPProxyUpstreamPort";
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.Size = new System.Drawing.Size(55, 23);
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.TabIndex = 51;
- this.CustomNumericUpDownSettingHTTPProxyUpstreamPort.Value = new decimal(new int[] {
- 1090,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.Location = new Point(370, 165);
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.Name = "CustomNumericUpDownSettingHTTPProxyUpstreamPort";
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.Size = new Size(55, 23);
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.TabIndex = 51;
+ CustomNumericUpDownSettingHTTPProxyUpstreamPort.Value = new decimal(new int[] { 1090, 0, 0, 0 });
//
// CustomTextBoxSettingHTTPProxyUpstreamHost
//
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.AcceptsReturn = false;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.AcceptsTab = false;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.Border = true;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.BorderSize = 1;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.HideSelection = true;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.Location = new System.Drawing.Point(156, 165);
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.MaxLength = 32767;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.Multiline = false;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.Name = "CustomTextBoxSettingHTTPProxyUpstreamHost";
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.ReadOnly = false;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.ShortcutsEnabled = true;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.Size = new System.Drawing.Size(150, 23);
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.TabIndex = 0;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.Texts = "127.0.0.1";
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.UnderlinedStyle = true;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.UsePasswordChar = false;
- this.CustomTextBoxSettingHTTPProxyUpstreamHost.WordWrap = true;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.AcceptsReturn = false;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.AcceptsTab = false;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.BackColor = Color.DimGray;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.Border = true;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.BorderColor = Color.Blue;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.BorderSize = 1;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingHTTPProxyUpstreamHost.ForeColor = Color.White;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.HideSelection = true;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.Location = new Point(156, 165);
+ CustomTextBoxSettingHTTPProxyUpstreamHost.MaxLength = 32767;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.Multiline = false;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.Name = "CustomTextBoxSettingHTTPProxyUpstreamHost";
+ CustomTextBoxSettingHTTPProxyUpstreamHost.ReadOnly = false;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.ShortcutsEnabled = true;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.Size = new Size(150, 23);
+ CustomTextBoxSettingHTTPProxyUpstreamHost.TabIndex = 0;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.Texts = "127.0.0.1";
+ CustomTextBoxSettingHTTPProxyUpstreamHost.UnderlinedStyle = true;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.UsePasswordChar = false;
+ CustomTextBoxSettingHTTPProxyUpstreamHost.WordWrap = true;
//
// CustomLabelSettingHTTPProxyUpstreamPort
//
- this.CustomLabelSettingHTTPProxyUpstreamPort.AutoSize = true;
- this.CustomLabelSettingHTTPProxyUpstreamPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyUpstreamPort.Border = false;
- this.CustomLabelSettingHTTPProxyUpstreamPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyUpstreamPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyUpstreamPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyUpstreamPort.Location = new System.Drawing.Point(330, 168);
- this.CustomLabelSettingHTTPProxyUpstreamPort.Name = "CustomLabelSettingHTTPProxyUpstreamPort";
- this.CustomLabelSettingHTTPProxyUpstreamPort.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyUpstreamPort.Size = new System.Drawing.Size(32, 15);
- this.CustomLabelSettingHTTPProxyUpstreamPort.TabIndex = 49;
- this.CustomLabelSettingHTTPProxyUpstreamPort.Text = "Port:";
+ CustomLabelSettingHTTPProxyUpstreamPort.AutoSize = true;
+ CustomLabelSettingHTTPProxyUpstreamPort.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyUpstreamPort.Border = false;
+ CustomLabelSettingHTTPProxyUpstreamPort.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyUpstreamPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyUpstreamPort.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyUpstreamPort.Location = new Point(330, 168);
+ CustomLabelSettingHTTPProxyUpstreamPort.Name = "CustomLabelSettingHTTPProxyUpstreamPort";
+ CustomLabelSettingHTTPProxyUpstreamPort.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyUpstreamPort.Size = new Size(32, 15);
+ CustomLabelSettingHTTPProxyUpstreamPort.TabIndex = 49;
+ CustomLabelSettingHTTPProxyUpstreamPort.Text = "Port:";
//
// CustomLabelSettingHTTPProxyUpstreamHost
//
- this.CustomLabelSettingHTTPProxyUpstreamHost.AutoSize = true;
- this.CustomLabelSettingHTTPProxyUpstreamHost.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyUpstreamHost.Border = false;
- this.CustomLabelSettingHTTPProxyUpstreamHost.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyUpstreamHost.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyUpstreamHost.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyUpstreamHost.Location = new System.Drawing.Point(113, 168);
- this.CustomLabelSettingHTTPProxyUpstreamHost.Name = "CustomLabelSettingHTTPProxyUpstreamHost";
- this.CustomLabelSettingHTTPProxyUpstreamHost.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyUpstreamHost.Size = new System.Drawing.Size(35, 15);
- this.CustomLabelSettingHTTPProxyUpstreamHost.TabIndex = 48;
- this.CustomLabelSettingHTTPProxyUpstreamHost.Text = "Host:";
+ CustomLabelSettingHTTPProxyUpstreamHost.AutoSize = true;
+ CustomLabelSettingHTTPProxyUpstreamHost.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyUpstreamHost.Border = false;
+ CustomLabelSettingHTTPProxyUpstreamHost.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyUpstreamHost.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyUpstreamHost.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyUpstreamHost.Location = new Point(113, 168);
+ CustomLabelSettingHTTPProxyUpstreamHost.Name = "CustomLabelSettingHTTPProxyUpstreamHost";
+ CustomLabelSettingHTTPProxyUpstreamHost.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyUpstreamHost.Size = new Size(35, 15);
+ CustomLabelSettingHTTPProxyUpstreamHost.TabIndex = 48;
+ CustomLabelSettingHTTPProxyUpstreamHost.Text = "Host:";
//
// CustomComboBoxSettingHttpProxyUpstreamMode
//
- this.CustomComboBoxSettingHttpProxyUpstreamMode.BackColor = System.Drawing.Color.DimGray;
- this.CustomComboBoxSettingHttpProxyUpstreamMode.BorderColor = System.Drawing.Color.Blue;
- this.CustomComboBoxSettingHttpProxyUpstreamMode.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
- this.CustomComboBoxSettingHttpProxyUpstreamMode.ForeColor = System.Drawing.Color.White;
- this.CustomComboBoxSettingHttpProxyUpstreamMode.FormattingEnabled = true;
- this.CustomComboBoxSettingHttpProxyUpstreamMode.ItemHeight = 17;
- this.CustomComboBoxSettingHttpProxyUpstreamMode.Items.AddRange(new object[] {
- "HTTP",
- "SOCKS5"});
- this.CustomComboBoxSettingHttpProxyUpstreamMode.Location = new System.Drawing.Point(25, 165);
- this.CustomComboBoxSettingHttpProxyUpstreamMode.Name = "CustomComboBoxSettingHttpProxyUpstreamMode";
- this.CustomComboBoxSettingHttpProxyUpstreamMode.SelectionColor = System.Drawing.Color.DodgerBlue;
- this.CustomComboBoxSettingHttpProxyUpstreamMode.Size = new System.Drawing.Size(70, 23);
- this.CustomComboBoxSettingHttpProxyUpstreamMode.TabIndex = 47;
+ CustomComboBoxSettingHttpProxyUpstreamMode.BackColor = Color.DimGray;
+ CustomComboBoxSettingHttpProxyUpstreamMode.BorderColor = Color.Blue;
+ CustomComboBoxSettingHttpProxyUpstreamMode.DrawMode = DrawMode.OwnerDrawVariable;
+ CustomComboBoxSettingHttpProxyUpstreamMode.ForeColor = Color.White;
+ CustomComboBoxSettingHttpProxyUpstreamMode.FormattingEnabled = true;
+ CustomComboBoxSettingHttpProxyUpstreamMode.ItemHeight = 17;
+ CustomComboBoxSettingHttpProxyUpstreamMode.Items.AddRange(new object[] { "HTTP", "SOCKS5" });
+ CustomComboBoxSettingHttpProxyUpstreamMode.Location = new Point(25, 165);
+ CustomComboBoxSettingHttpProxyUpstreamMode.Name = "CustomComboBoxSettingHttpProxyUpstreamMode";
+ CustomComboBoxSettingHttpProxyUpstreamMode.SelectionColor = Color.DodgerBlue;
+ CustomComboBoxSettingHttpProxyUpstreamMode.Size = new Size(70, 23);
+ CustomComboBoxSettingHttpProxyUpstreamMode.TabIndex = 47;
//
// CustomCheckBoxSettingHTTPProxyUpstream
//
- this.CustomCheckBoxSettingHTTPProxyUpstream.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingHTTPProxyUpstream.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyUpstream.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyUpstream.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingHTTPProxyUpstream.Location = new System.Drawing.Point(6, 105);
- this.CustomCheckBoxSettingHTTPProxyUpstream.Name = "CustomCheckBoxSettingHTTPProxyUpstream";
- this.CustomCheckBoxSettingHTTPProxyUpstream.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingHTTPProxyUpstream.Size = new System.Drawing.Size(129, 17);
- this.CustomCheckBoxSettingHTTPProxyUpstream.TabIndex = 46;
- this.CustomCheckBoxSettingHTTPProxyUpstream.Text = "Use upstream proxy";
- this.CustomCheckBoxSettingHTTPProxyUpstream.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingHTTPProxyUpstream.BackColor = Color.DimGray;
+ CustomCheckBoxSettingHTTPProxyUpstream.BorderColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyUpstream.CheckColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyUpstream.ForeColor = Color.White;
+ CustomCheckBoxSettingHTTPProxyUpstream.Location = new Point(6, 105);
+ CustomCheckBoxSettingHTTPProxyUpstream.Name = "CustomCheckBoxSettingHTTPProxyUpstream";
+ CustomCheckBoxSettingHTTPProxyUpstream.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingHTTPProxyUpstream.Size = new Size(129, 17);
+ CustomCheckBoxSettingHTTPProxyUpstream.TabIndex = 46;
+ CustomCheckBoxSettingHTTPProxyUpstream.Text = "Use upstream proxy";
+ CustomCheckBoxSettingHTTPProxyUpstream.UseVisualStyleBackColor = false;
//
// CustomLabelSettingHTTPProxyPort
//
- this.CustomLabelSettingHTTPProxyPort.AutoSize = true;
- this.CustomLabelSettingHTTPProxyPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyPort.Border = false;
- this.CustomLabelSettingHTTPProxyPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyPort.Location = new System.Drawing.Point(6, 25);
- this.CustomLabelSettingHTTPProxyPort.Name = "CustomLabelSettingHTTPProxyPort";
- this.CustomLabelSettingHTTPProxyPort.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyPort.Size = new System.Drawing.Size(99, 15);
- this.CustomLabelSettingHTTPProxyPort.TabIndex = 42;
- this.CustomLabelSettingHTTPProxyPort.Text = "HTTP Proxy. Port:";
+ CustomLabelSettingHTTPProxyPort.AutoSize = true;
+ CustomLabelSettingHTTPProxyPort.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyPort.Border = false;
+ CustomLabelSettingHTTPProxyPort.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyPort.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyPort.Location = new Point(6, 25);
+ CustomLabelSettingHTTPProxyPort.Name = "CustomLabelSettingHTTPProxyPort";
+ CustomLabelSettingHTTPProxyPort.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyPort.Size = new Size(99, 15);
+ CustomLabelSettingHTTPProxyPort.TabIndex = 42;
+ CustomLabelSettingHTTPProxyPort.Text = "HTTP Proxy. Port:";
//
// CustomCheckBoxSettingProxyBlockPort80
//
- this.CustomCheckBoxSettingProxyBlockPort80.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingProxyBlockPort80.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProxyBlockPort80.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingProxyBlockPort80.Checked = true;
- this.CustomCheckBoxSettingProxyBlockPort80.CheckState = System.Windows.Forms.CheckState.Checked;
- this.CustomCheckBoxSettingProxyBlockPort80.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingProxyBlockPort80.Location = new System.Drawing.Point(390, 25);
- this.CustomCheckBoxSettingProxyBlockPort80.Name = "CustomCheckBoxSettingProxyBlockPort80";
- this.CustomCheckBoxSettingProxyBlockPort80.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingProxyBlockPort80.Size = new System.Drawing.Size(93, 17);
- this.CustomCheckBoxSettingProxyBlockPort80.TabIndex = 45;
- this.CustomCheckBoxSettingProxyBlockPort80.Text = "Block port 80";
- this.CustomCheckBoxSettingProxyBlockPort80.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingProxyBlockPort80.BackColor = Color.DimGray;
+ CustomCheckBoxSettingProxyBlockPort80.BorderColor = Color.Blue;
+ CustomCheckBoxSettingProxyBlockPort80.CheckColor = Color.Blue;
+ CustomCheckBoxSettingProxyBlockPort80.Checked = true;
+ CustomCheckBoxSettingProxyBlockPort80.CheckState = CheckState.Checked;
+ CustomCheckBoxSettingProxyBlockPort80.ForeColor = Color.White;
+ CustomCheckBoxSettingProxyBlockPort80.Location = new Point(390, 25);
+ CustomCheckBoxSettingProxyBlockPort80.Name = "CustomCheckBoxSettingProxyBlockPort80";
+ CustomCheckBoxSettingProxyBlockPort80.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingProxyBlockPort80.Size = new Size(93, 17);
+ CustomCheckBoxSettingProxyBlockPort80.TabIndex = 45;
+ CustomCheckBoxSettingProxyBlockPort80.Text = "Block port 80";
+ CustomCheckBoxSettingProxyBlockPort80.UseVisualStyleBackColor = false;
//
// CustomLabelSettingHTTPProxyHandleRequests
//
- this.CustomLabelSettingHTTPProxyHandleRequests.AutoSize = true;
- this.CustomLabelSettingHTTPProxyHandleRequests.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyHandleRequests.Border = false;
- this.CustomLabelSettingHTTPProxyHandleRequests.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyHandleRequests.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyHandleRequests.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyHandleRequests.Location = new System.Drawing.Point(190, 25);
- this.CustomLabelSettingHTTPProxyHandleRequests.Name = "CustomLabelSettingHTTPProxyHandleRequests";
- this.CustomLabelSettingHTTPProxyHandleRequests.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyHandleRequests.Size = new System.Drawing.Size(95, 15);
- this.CustomLabelSettingHTTPProxyHandleRequests.TabIndex = 43;
- this.CustomLabelSettingHTTPProxyHandleRequests.Text = "Handle requests:";
+ CustomLabelSettingHTTPProxyHandleRequests.AutoSize = true;
+ CustomLabelSettingHTTPProxyHandleRequests.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyHandleRequests.Border = false;
+ CustomLabelSettingHTTPProxyHandleRequests.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyHandleRequests.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyHandleRequests.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyHandleRequests.Location = new Point(190, 25);
+ CustomLabelSettingHTTPProxyHandleRequests.Name = "CustomLabelSettingHTTPProxyHandleRequests";
+ CustomLabelSettingHTTPProxyHandleRequests.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyHandleRequests.Size = new Size(95, 15);
+ CustomLabelSettingHTTPProxyHandleRequests.TabIndex = 43;
+ CustomLabelSettingHTTPProxyHandleRequests.Text = "Handle requests:";
//
// CustomNumericUpDownSettingHTTPProxyPort
//
- this.CustomNumericUpDownSettingHTTPProxyPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingHTTPProxyPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingHTTPProxyPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingHTTPProxyPort.Location = new System.Drawing.Point(113, 23);
- this.CustomNumericUpDownSettingHTTPProxyPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyPort.Name = "CustomNumericUpDownSettingHTTPProxyPort";
- this.CustomNumericUpDownSettingHTTPProxyPort.Size = new System.Drawing.Size(55, 23);
- this.CustomNumericUpDownSettingHTTPProxyPort.TabIndex = 41;
- this.CustomNumericUpDownSettingHTTPProxyPort.Value = new decimal(new int[] {
- 8080,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingHTTPProxyPort.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingHTTPProxyPort.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingHTTPProxyPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingHTTPProxyPort.Location = new Point(113, 23);
+ CustomNumericUpDownSettingHTTPProxyPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyPort.Name = "CustomNumericUpDownSettingHTTPProxyPort";
+ CustomNumericUpDownSettingHTTPProxyPort.Size = new Size(55, 23);
+ CustomNumericUpDownSettingHTTPProxyPort.TabIndex = 41;
+ CustomNumericUpDownSettingHTTPProxyPort.Value = new decimal(new int[] { 8080, 0, 0, 0 });
//
// CustomNumericUpDownSettingHTTPProxyHandleRequests
//
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.Location = new System.Drawing.Point(297, 23);
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.Maximum = new decimal(new int[] {
- 50000,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.Minimum = new decimal(new int[] {
- 200,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.Name = "CustomNumericUpDownSettingHTTPProxyHandleRequests";
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.Size = new System.Drawing.Size(55, 23);
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.TabIndex = 44;
- this.CustomNumericUpDownSettingHTTPProxyHandleRequests.Value = new decimal(new int[] {
- 2000,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.Location = new Point(297, 23);
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.Maximum = new decimal(new int[] { 50000, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.Minimum = new decimal(new int[] { 200, 0, 0, 0 });
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.Name = "CustomNumericUpDownSettingHTTPProxyHandleRequests";
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.Size = new Size(55, 23);
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.TabIndex = 44;
+ CustomNumericUpDownSettingHTTPProxyHandleRequests.Value = new decimal(new int[] { 2000, 0, 0, 0 });
//
// TabPageSettingHttpProxyAdvanced
//
- this.TabPageSettingHttpProxyAdvanced.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomButtonSettingHTTPProxyDontBypass);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomLabelSettingHTTPProxyDontBypass);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomCheckBoxSettingHTTPProxyEnableDontBypass);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.customLabel1);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomButtonSettingHTTPProxyBlackWhiteList);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomLabelSettingHTTPProxyBlackWhiteList);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomCheckBoxSettingHTTPProxyCfCleanIP);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomLabelSettingShareSeparator2);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomTextBoxSettingHTTPProxyCfCleanIP);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomLabelSettingShareSeparator1);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomLabelSettingHTTPProxyFakeDNS);
- this.TabPageSettingHttpProxyAdvanced.Controls.Add(this.CustomButtonSettingHTTPProxyFakeDNS);
- this.TabPageSettingHttpProxyAdvanced.Location = new System.Drawing.Point(4, 25);
- this.TabPageSettingHttpProxyAdvanced.Name = "TabPageSettingHttpProxyAdvanced";
- this.TabPageSettingHttpProxyAdvanced.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingHttpProxyAdvanced.Size = new System.Drawing.Size(574, 322);
- this.TabPageSettingHttpProxyAdvanced.TabIndex = 1;
- this.TabPageSettingHttpProxyAdvanced.Tag = 1;
- this.TabPageSettingHttpProxyAdvanced.Text = "Advanced";
+ TabPageSettingHttpProxyAdvanced.BackColor = Color.Transparent;
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomButtonSettingHTTPProxyDontBypass);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomLabelSettingHTTPProxyDontBypass);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomCheckBoxSettingHTTPProxyEnableDontBypass);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(customLabel1);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomButtonSettingHTTPProxyBlackWhiteList);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomCheckBoxSettingHTTPProxyEnableFakeProxy);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomLabelSettingHTTPProxyBlackWhiteList);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomCheckBoxSettingHTTPProxyCfCleanIP);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomLabelSettingShareSeparator2);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomTextBoxSettingHTTPProxyCfCleanIP);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomCheckBoxSettingHTTPProxyEnableFakeDNS);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomLabelSettingShareSeparator1);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomLabelSettingHTTPProxyFakeDNS);
+ TabPageSettingHttpProxyAdvanced.Controls.Add(CustomButtonSettingHTTPProxyFakeDNS);
+ TabPageSettingHttpProxyAdvanced.Location = new Point(4, 25);
+ TabPageSettingHttpProxyAdvanced.Name = "TabPageSettingHttpProxyAdvanced";
+ TabPageSettingHttpProxyAdvanced.Padding = new Padding(3);
+ TabPageSettingHttpProxyAdvanced.Size = new Size(574, 322);
+ TabPageSettingHttpProxyAdvanced.TabIndex = 1;
+ TabPageSettingHttpProxyAdvanced.Tag = 1;
+ TabPageSettingHttpProxyAdvanced.Text = "Advanced";
//
// CustomButtonSettingHTTPProxyDontBypass
//
- this.CustomButtonSettingHTTPProxyDontBypass.AutoSize = true;
- this.CustomButtonSettingHTTPProxyDontBypass.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonSettingHTTPProxyDontBypass.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonSettingHTTPProxyDontBypass.Location = new System.Drawing.Point(210, 258);
- this.CustomButtonSettingHTTPProxyDontBypass.Name = "CustomButtonSettingHTTPProxyDontBypass";
- this.CustomButtonSettingHTTPProxyDontBypass.RoundedCorners = 5;
- this.CustomButtonSettingHTTPProxyDontBypass.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonSettingHTTPProxyDontBypass.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonSettingHTTPProxyDontBypass.TabIndex = 16;
- this.CustomButtonSettingHTTPProxyDontBypass.Text = "Edit List";
- this.CustomButtonSettingHTTPProxyDontBypass.UseVisualStyleBackColor = true;
- this.CustomButtonSettingHTTPProxyDontBypass.Click += new System.EventHandler(this.CustomButtonSettingHTTPProxyDontBypass_Click);
+ CustomButtonSettingHTTPProxyDontBypass.AutoSize = true;
+ CustomButtonSettingHTTPProxyDontBypass.BorderColor = Color.Blue;
+ CustomButtonSettingHTTPProxyDontBypass.FlatStyle = FlatStyle.Flat;
+ CustomButtonSettingHTTPProxyDontBypass.Location = new Point(210, 258);
+ CustomButtonSettingHTTPProxyDontBypass.Name = "CustomButtonSettingHTTPProxyDontBypass";
+ CustomButtonSettingHTTPProxyDontBypass.RoundedCorners = 5;
+ CustomButtonSettingHTTPProxyDontBypass.SelectionColor = Color.LightBlue;
+ CustomButtonSettingHTTPProxyDontBypass.Size = new Size(75, 27);
+ CustomButtonSettingHTTPProxyDontBypass.TabIndex = 16;
+ CustomButtonSettingHTTPProxyDontBypass.Text = "Edit List";
+ CustomButtonSettingHTTPProxyDontBypass.UseVisualStyleBackColor = true;
+ CustomButtonSettingHTTPProxyDontBypass.Click += CustomButtonSettingHTTPProxyDontBypass_Click;
//
// CustomLabelSettingHTTPProxyDontBypass
//
- this.CustomLabelSettingHTTPProxyDontBypass.AutoSize = true;
- this.CustomLabelSettingHTTPProxyDontBypass.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyDontBypass.Border = false;
- this.CustomLabelSettingHTTPProxyDontBypass.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyDontBypass.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyDontBypass.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyDontBypass.Location = new System.Drawing.Point(22, 255);
- this.CustomLabelSettingHTTPProxyDontBypass.Name = "CustomLabelSettingHTTPProxyDontBypass";
- this.CustomLabelSettingHTTPProxyDontBypass.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyDontBypass.Size = new System.Drawing.Size(146, 30);
- this.CustomLabelSettingHTTPProxyDontBypass.TabIndex = 15;
- this.CustomLabelSettingHTTPProxyDontBypass.Text = "Each line one domain. e.g:\r\n stackoverflow.com";
+ CustomLabelSettingHTTPProxyDontBypass.AutoSize = true;
+ CustomLabelSettingHTTPProxyDontBypass.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyDontBypass.Border = false;
+ CustomLabelSettingHTTPProxyDontBypass.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyDontBypass.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyDontBypass.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyDontBypass.Location = new Point(22, 255);
+ CustomLabelSettingHTTPProxyDontBypass.Name = "CustomLabelSettingHTTPProxyDontBypass";
+ CustomLabelSettingHTTPProxyDontBypass.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyDontBypass.Size = new Size(146, 30);
+ CustomLabelSettingHTTPProxyDontBypass.TabIndex = 15;
+ CustomLabelSettingHTTPProxyDontBypass.Text = "Each line one domain. e.g:\r\n stackoverflow.com";
//
// CustomCheckBoxSettingHTTPProxyEnableDontBypass
//
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.Location = new System.Drawing.Point(6, 235);
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.Name = "CustomCheckBoxSettingHTTPProxyEnableDontBypass";
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.Size = new System.Drawing.Size(409, 17);
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.TabIndex = 14;
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.Text = "Enable Don\'t Bypass DPI List (Don\'t apply DPI Bypass to these domains)";
- this.CustomCheckBoxSettingHTTPProxyEnableDontBypass.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.BackColor = Color.DimGray;
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.BorderColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.CheckColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.ForeColor = Color.White;
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.Location = new Point(6, 235);
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.Name = "CustomCheckBoxSettingHTTPProxyEnableDontBypass";
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.Size = new Size(409, 17);
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.TabIndex = 14;
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.Text = "Enable Don't Bypass DPI List (Don't apply DPI Bypass to these domains)";
+ CustomCheckBoxSettingHTTPProxyEnableDontBypass.UseVisualStyleBackColor = false;
//
// customLabel1
//
- this.customLabel1.BackColor = System.Drawing.Color.DimGray;
- this.customLabel1.Border = true;
- this.customLabel1.BorderColor = System.Drawing.Color.Blue;
- this.customLabel1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.customLabel1.ForeColor = System.Drawing.Color.White;
- this.customLabel1.Location = new System.Drawing.Point(12, 225);
- this.customLabel1.Name = "customLabel1";
- this.customLabel1.RoundedCorners = 0;
- this.customLabel1.Size = new System.Drawing.Size(550, 1);
- this.customLabel1.TabIndex = 13;
+ customLabel1.BackColor = Color.DimGray;
+ customLabel1.Border = true;
+ customLabel1.BorderColor = Color.Blue;
+ customLabel1.FlatStyle = FlatStyle.Flat;
+ customLabel1.ForeColor = Color.White;
+ customLabel1.Location = new Point(12, 225);
+ customLabel1.Name = "customLabel1";
+ customLabel1.RoundedCorners = 0;
+ customLabel1.Size = new Size(550, 1);
+ customLabel1.TabIndex = 13;
//
// CustomButtonSettingHTTPProxyBlackWhiteList
//
- this.CustomButtonSettingHTTPProxyBlackWhiteList.AutoSize = true;
- this.CustomButtonSettingHTTPProxyBlackWhiteList.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonSettingHTTPProxyBlackWhiteList.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonSettingHTTPProxyBlackWhiteList.Location = new System.Drawing.Point(210, 179);
- this.CustomButtonSettingHTTPProxyBlackWhiteList.Name = "CustomButtonSettingHTTPProxyBlackWhiteList";
- this.CustomButtonSettingHTTPProxyBlackWhiteList.RoundedCorners = 5;
- this.CustomButtonSettingHTTPProxyBlackWhiteList.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonSettingHTTPProxyBlackWhiteList.Size = new System.Drawing.Size(91, 27);
- this.CustomButtonSettingHTTPProxyBlackWhiteList.TabIndex = 11;
- this.CustomButtonSettingHTTPProxyBlackWhiteList.Text = "Edit Black List";
- this.CustomButtonSettingHTTPProxyBlackWhiteList.UseVisualStyleBackColor = true;
- this.CustomButtonSettingHTTPProxyBlackWhiteList.Click += new System.EventHandler(this.CustomButtonSettingHTTPProxyBlackWhiteList_Click);
+ CustomButtonSettingHTTPProxyBlackWhiteList.AutoSize = true;
+ CustomButtonSettingHTTPProxyBlackWhiteList.BorderColor = Color.Blue;
+ CustomButtonSettingHTTPProxyBlackWhiteList.FlatStyle = FlatStyle.Flat;
+ CustomButtonSettingHTTPProxyBlackWhiteList.Location = new Point(210, 179);
+ CustomButtonSettingHTTPProxyBlackWhiteList.Name = "CustomButtonSettingHTTPProxyBlackWhiteList";
+ CustomButtonSettingHTTPProxyBlackWhiteList.RoundedCorners = 5;
+ CustomButtonSettingHTTPProxyBlackWhiteList.SelectionColor = Color.LightBlue;
+ CustomButtonSettingHTTPProxyBlackWhiteList.Size = new Size(91, 27);
+ CustomButtonSettingHTTPProxyBlackWhiteList.TabIndex = 11;
+ CustomButtonSettingHTTPProxyBlackWhiteList.Text = "Edit Black List";
+ CustomButtonSettingHTTPProxyBlackWhiteList.UseVisualStyleBackColor = true;
+ CustomButtonSettingHTTPProxyBlackWhiteList.Click += CustomButtonSettingHTTPProxyBlackWhiteList_Click;
//
// CustomCheckBoxSettingHTTPProxyEnableFakeProxy
//
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Location = new System.Drawing.Point(6, 15);
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Name = "CustomCheckBoxSettingHTTPProxyEnableFakeProxy";
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Size = new System.Drawing.Size(119, 17);
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.TabIndex = 0;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Text = "Enable Fake Proxy";
- this.CustomCheckBoxSettingHTTPProxyEnableFakeProxy.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.BackColor = Color.DimGray;
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.BorderColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.CheckColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.ForeColor = Color.White;
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Location = new Point(6, 15);
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Name = "CustomCheckBoxSettingHTTPProxyEnableFakeProxy";
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Size = new Size(119, 17);
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.TabIndex = 0;
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Text = "Enable Fake Proxy";
+ CustomCheckBoxSettingHTTPProxyEnableFakeProxy.UseVisualStyleBackColor = false;
//
// CustomLabelSettingHTTPProxyBlackWhiteList
//
- this.CustomLabelSettingHTTPProxyBlackWhiteList.AutoSize = true;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.Border = false;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.Location = new System.Drawing.Point(22, 185);
- this.CustomLabelSettingHTTPProxyBlackWhiteList.Name = "CustomLabelSettingHTTPProxyBlackWhiteList";
- this.CustomLabelSettingHTTPProxyBlackWhiteList.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.Size = new System.Drawing.Size(146, 30);
- this.CustomLabelSettingHTTPProxyBlackWhiteList.TabIndex = 10;
- this.CustomLabelSettingHTTPProxyBlackWhiteList.Text = "Each line one domain. e.g:\r\n google.com";
+ CustomLabelSettingHTTPProxyBlackWhiteList.AutoSize = true;
+ CustomLabelSettingHTTPProxyBlackWhiteList.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyBlackWhiteList.Border = false;
+ CustomLabelSettingHTTPProxyBlackWhiteList.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyBlackWhiteList.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyBlackWhiteList.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyBlackWhiteList.Location = new Point(22, 185);
+ CustomLabelSettingHTTPProxyBlackWhiteList.Name = "CustomLabelSettingHTTPProxyBlackWhiteList";
+ CustomLabelSettingHTTPProxyBlackWhiteList.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyBlackWhiteList.Size = new Size(146, 30);
+ CustomLabelSettingHTTPProxyBlackWhiteList.TabIndex = 10;
+ CustomLabelSettingHTTPProxyBlackWhiteList.Text = "Each line one domain. e.g:\r\n google.com";
//
// CustomCheckBoxSettingHTTPProxyCfCleanIP
//
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.Location = new System.Drawing.Point(6, 45);
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.Name = "CustomCheckBoxSettingHTTPProxyCfCleanIP";
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.Size = new System.Drawing.Size(232, 17);
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.TabIndex = 1;
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.Text = "Redirect all Cloudflare IPs to a clean IP:";
- this.CustomCheckBoxSettingHTTPProxyCfCleanIP.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.BackColor = Color.DimGray;
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.BorderColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.CheckColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.ForeColor = Color.White;
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.Location = new Point(6, 45);
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.Name = "CustomCheckBoxSettingHTTPProxyCfCleanIP";
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.Size = new Size(232, 17);
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.TabIndex = 1;
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.Text = "Redirect all Cloudflare IPs to a clean IP:";
+ CustomCheckBoxSettingHTTPProxyCfCleanIP.UseVisualStyleBackColor = false;
//
// CustomLabelSettingShareSeparator2
//
- this.CustomLabelSettingShareSeparator2.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingShareSeparator2.Border = true;
- this.CustomLabelSettingShareSeparator2.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingShareSeparator2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingShareSeparator2.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingShareSeparator2.Location = new System.Drawing.Point(12, 154);
- this.CustomLabelSettingShareSeparator2.Name = "CustomLabelSettingShareSeparator2";
- this.CustomLabelSettingShareSeparator2.RoundedCorners = 0;
- this.CustomLabelSettingShareSeparator2.Size = new System.Drawing.Size(550, 1);
- this.CustomLabelSettingShareSeparator2.TabIndex = 9;
+ CustomLabelSettingShareSeparator2.BackColor = Color.DimGray;
+ CustomLabelSettingShareSeparator2.Border = true;
+ CustomLabelSettingShareSeparator2.BorderColor = Color.Blue;
+ CustomLabelSettingShareSeparator2.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingShareSeparator2.ForeColor = Color.White;
+ CustomLabelSettingShareSeparator2.Location = new Point(12, 154);
+ CustomLabelSettingShareSeparator2.Name = "CustomLabelSettingShareSeparator2";
+ CustomLabelSettingShareSeparator2.RoundedCorners = 0;
+ CustomLabelSettingShareSeparator2.Size = new Size(550, 1);
+ CustomLabelSettingShareSeparator2.TabIndex = 9;
//
// CustomTextBoxSettingHTTPProxyCfCleanIP
//
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.AcceptsReturn = false;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.AcceptsTab = false;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.Border = true;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.BorderSize = 1;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.HideSelection = true;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.Location = new System.Drawing.Point(244, 43);
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.MaxLength = 32767;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.Multiline = false;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.Name = "CustomTextBoxSettingHTTPProxyCfCleanIP";
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.ReadOnly = false;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.ShortcutsEnabled = true;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.Size = new System.Drawing.Size(95, 23);
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.TabIndex = 0;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.Texts = "104.18.145.170";
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.UnderlinedStyle = true;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.UsePasswordChar = false;
- this.CustomTextBoxSettingHTTPProxyCfCleanIP.WordWrap = true;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.AcceptsReturn = false;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.AcceptsTab = false;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.BackColor = Color.DimGray;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.Border = true;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.BorderColor = Color.Blue;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.BorderSize = 1;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingHTTPProxyCfCleanIP.ForeColor = Color.White;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.HideSelection = true;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.Location = new Point(244, 43);
+ CustomTextBoxSettingHTTPProxyCfCleanIP.MaxLength = 32767;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.Multiline = false;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.Name = "CustomTextBoxSettingHTTPProxyCfCleanIP";
+ CustomTextBoxSettingHTTPProxyCfCleanIP.ReadOnly = false;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.ShortcutsEnabled = true;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.Size = new Size(95, 23);
+ CustomTextBoxSettingHTTPProxyCfCleanIP.TabIndex = 0;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.Texts = "104.18.145.170";
+ CustomTextBoxSettingHTTPProxyCfCleanIP.UnderlinedStyle = true;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.UsePasswordChar = false;
+ CustomTextBoxSettingHTTPProxyCfCleanIP.WordWrap = true;
//
// CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList
//
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Location = new System.Drawing.Point(6, 165);
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Name = "CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList";
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Size = new System.Drawing.Size(110, 17);
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.TabIndex = 8;
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Text = "Enable Black List";
- this.CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.BackColor = Color.DimGray;
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.BorderColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.CheckColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.ForeColor = Color.White;
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Location = new Point(6, 165);
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Name = "CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList";
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Size = new Size(110, 17);
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.TabIndex = 8;
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Text = "Enable Black List";
+ CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.UseVisualStyleBackColor = false;
//
// CustomCheckBoxSettingHTTPProxyEnableFakeDNS
//
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Location = new System.Drawing.Point(6, 90);
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Name = "CustomCheckBoxSettingHTTPProxyEnableFakeDNS";
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Size = new System.Drawing.Size(113, 17);
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.TabIndex = 3;
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Text = "Enable Fake DNS";
- this.CustomCheckBoxSettingHTTPProxyEnableFakeDNS.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.BackColor = Color.DimGray;
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.BorderColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.CheckColor = Color.Blue;
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.ForeColor = Color.White;
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Location = new Point(6, 90);
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Name = "CustomCheckBoxSettingHTTPProxyEnableFakeDNS";
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Size = new Size(113, 17);
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.TabIndex = 3;
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Text = "Enable Fake DNS";
+ CustomCheckBoxSettingHTTPProxyEnableFakeDNS.UseVisualStyleBackColor = false;
//
// CustomLabelSettingShareSeparator1
//
- this.CustomLabelSettingShareSeparator1.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingShareSeparator1.Border = true;
- this.CustomLabelSettingShareSeparator1.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingShareSeparator1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingShareSeparator1.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingShareSeparator1.Location = new System.Drawing.Point(12, 75);
- this.CustomLabelSettingShareSeparator1.Name = "CustomLabelSettingShareSeparator1";
- this.CustomLabelSettingShareSeparator1.RoundedCorners = 0;
- this.CustomLabelSettingShareSeparator1.Size = new System.Drawing.Size(550, 1);
- this.CustomLabelSettingShareSeparator1.TabIndex = 6;
+ CustomLabelSettingShareSeparator1.BackColor = Color.DimGray;
+ CustomLabelSettingShareSeparator1.Border = true;
+ CustomLabelSettingShareSeparator1.BorderColor = Color.Blue;
+ CustomLabelSettingShareSeparator1.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingShareSeparator1.ForeColor = Color.White;
+ CustomLabelSettingShareSeparator1.Location = new Point(12, 75);
+ CustomLabelSettingShareSeparator1.Name = "CustomLabelSettingShareSeparator1";
+ CustomLabelSettingShareSeparator1.RoundedCorners = 0;
+ CustomLabelSettingShareSeparator1.Size = new Size(550, 1);
+ CustomLabelSettingShareSeparator1.TabIndex = 6;
//
// CustomLabelSettingHTTPProxyFakeDNS
//
- this.CustomLabelSettingHTTPProxyFakeDNS.AutoSize = true;
- this.CustomLabelSettingHTTPProxyFakeDNS.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingHTTPProxyFakeDNS.Border = false;
- this.CustomLabelSettingHTTPProxyFakeDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingHTTPProxyFakeDNS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingHTTPProxyFakeDNS.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingHTTPProxyFakeDNS.Location = new System.Drawing.Point(22, 110);
- this.CustomLabelSettingHTTPProxyFakeDNS.Name = "CustomLabelSettingHTTPProxyFakeDNS";
- this.CustomLabelSettingHTTPProxyFakeDNS.RoundedCorners = 0;
- this.CustomLabelSettingHTTPProxyFakeDNS.Size = new System.Drawing.Size(132, 30);
- this.CustomLabelSettingHTTPProxyFakeDNS.TabIndex = 4;
- this.CustomLabelSettingHTTPProxyFakeDNS.Text = "Each line one rule. e.g:\r\n dns.google.com|8.8.8.8";
+ CustomLabelSettingHTTPProxyFakeDNS.AutoSize = true;
+ CustomLabelSettingHTTPProxyFakeDNS.BackColor = Color.DimGray;
+ CustomLabelSettingHTTPProxyFakeDNS.Border = false;
+ CustomLabelSettingHTTPProxyFakeDNS.BorderColor = Color.Blue;
+ CustomLabelSettingHTTPProxyFakeDNS.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingHTTPProxyFakeDNS.ForeColor = Color.White;
+ CustomLabelSettingHTTPProxyFakeDNS.Location = new Point(22, 110);
+ CustomLabelSettingHTTPProxyFakeDNS.Name = "CustomLabelSettingHTTPProxyFakeDNS";
+ CustomLabelSettingHTTPProxyFakeDNS.RoundedCorners = 0;
+ CustomLabelSettingHTTPProxyFakeDNS.Size = new Size(132, 30);
+ CustomLabelSettingHTTPProxyFakeDNS.TabIndex = 4;
+ CustomLabelSettingHTTPProxyFakeDNS.Text = "Each line one rule. e.g:\r\n dns.google.com|8.8.8.8";
//
// CustomButtonSettingHTTPProxyFakeDNS
//
- this.CustomButtonSettingHTTPProxyFakeDNS.AutoSize = true;
- this.CustomButtonSettingHTTPProxyFakeDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonSettingHTTPProxyFakeDNS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonSettingHTTPProxyFakeDNS.Location = new System.Drawing.Point(210, 100);
- this.CustomButtonSettingHTTPProxyFakeDNS.Name = "CustomButtonSettingHTTPProxyFakeDNS";
- this.CustomButtonSettingHTTPProxyFakeDNS.RoundedCorners = 5;
- this.CustomButtonSettingHTTPProxyFakeDNS.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonSettingHTTPProxyFakeDNS.Size = new System.Drawing.Size(120, 27);
- this.CustomButtonSettingHTTPProxyFakeDNS.TabIndex = 5;
- this.CustomButtonSettingHTTPProxyFakeDNS.Text = "Edit Fake DNS rules";
- this.CustomButtonSettingHTTPProxyFakeDNS.UseVisualStyleBackColor = true;
- this.CustomButtonSettingHTTPProxyFakeDNS.Click += new System.EventHandler(this.CustomButtonSettingHTTPProxyFakeDNS_Click);
+ CustomButtonSettingHTTPProxyFakeDNS.AutoSize = true;
+ CustomButtonSettingHTTPProxyFakeDNS.BorderColor = Color.Blue;
+ CustomButtonSettingHTTPProxyFakeDNS.FlatStyle = FlatStyle.Flat;
+ CustomButtonSettingHTTPProxyFakeDNS.Location = new Point(210, 100);
+ CustomButtonSettingHTTPProxyFakeDNS.Name = "CustomButtonSettingHTTPProxyFakeDNS";
+ CustomButtonSettingHTTPProxyFakeDNS.RoundedCorners = 5;
+ CustomButtonSettingHTTPProxyFakeDNS.SelectionColor = Color.LightBlue;
+ CustomButtonSettingHTTPProxyFakeDNS.Size = new Size(120, 27);
+ CustomButtonSettingHTTPProxyFakeDNS.TabIndex = 5;
+ CustomButtonSettingHTTPProxyFakeDNS.Text = "Edit Fake DNS rules";
+ CustomButtonSettingHTTPProxyFakeDNS.UseVisualStyleBackColor = true;
+ CustomButtonSettingHTTPProxyFakeDNS.Click += CustomButtonSettingHTTPProxyFakeDNS_Click;
//
// TabPageSettingsFakeProxy
//
- this.TabPageSettingsFakeProxy.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsFakeProxy.Controls.Add(this.CustomTextBoxSettingFakeProxyDohCleanIP);
- this.TabPageSettingsFakeProxy.Controls.Add(this.CustomTextBoxSettingFakeProxyDohAddress);
- this.TabPageSettingsFakeProxy.Controls.Add(this.CustomLabelSettingFakeProxyDohCleanIP);
- this.TabPageSettingsFakeProxy.Controls.Add(this.CustomLabelSettingFakeProxyDohAddress);
- this.TabPageSettingsFakeProxy.Controls.Add(this.CustomLabelSettingFakeProxyInfo);
- this.TabPageSettingsFakeProxy.Controls.Add(this.CustomNumericUpDownSettingFakeProxyPort);
- this.TabPageSettingsFakeProxy.Controls.Add(this.CustomLabelSettingFakeProxyPort);
- this.TabPageSettingsFakeProxy.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsFakeProxy.Name = "TabPageSettingsFakeProxy";
- this.TabPageSettingsFakeProxy.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsFakeProxy.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsFakeProxy.TabIndex = 7;
- this.TabPageSettingsFakeProxy.Tag = 5;
- this.TabPageSettingsFakeProxy.Text = "Fake Proxy";
+ TabPageSettingsFakeProxy.BackColor = Color.Transparent;
+ TabPageSettingsFakeProxy.Controls.Add(CustomTextBoxSettingFakeProxyDohCleanIP);
+ TabPageSettingsFakeProxy.Controls.Add(CustomTextBoxSettingFakeProxyDohAddress);
+ TabPageSettingsFakeProxy.Controls.Add(CustomLabelSettingFakeProxyDohCleanIP);
+ TabPageSettingsFakeProxy.Controls.Add(CustomLabelSettingFakeProxyDohAddress);
+ TabPageSettingsFakeProxy.Controls.Add(CustomLabelSettingFakeProxyInfo);
+ TabPageSettingsFakeProxy.Controls.Add(CustomNumericUpDownSettingFakeProxyPort);
+ TabPageSettingsFakeProxy.Controls.Add(CustomLabelSettingFakeProxyPort);
+ TabPageSettingsFakeProxy.Location = new Point(94, 4);
+ TabPageSettingsFakeProxy.Name = "TabPageSettingsFakeProxy";
+ TabPageSettingsFakeProxy.Padding = new Padding(3);
+ TabPageSettingsFakeProxy.Size = new Size(588, 357);
+ TabPageSettingsFakeProxy.TabIndex = 7;
+ TabPageSettingsFakeProxy.Tag = 5;
+ TabPageSettingsFakeProxy.Text = "Fake Proxy";
//
// CustomTextBoxSettingFakeProxyDohCleanIP
//
- this.CustomTextBoxSettingFakeProxyDohCleanIP.AcceptsReturn = false;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.AcceptsTab = false;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.Border = true;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.BorderSize = 1;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingFakeProxyDohCleanIP.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.HideSelection = true;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.Location = new System.Drawing.Point(128, 148);
- this.CustomTextBoxSettingFakeProxyDohCleanIP.MaxLength = 32767;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.Multiline = false;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.Name = "CustomTextBoxSettingFakeProxyDohCleanIP";
- this.CustomTextBoxSettingFakeProxyDohCleanIP.ReadOnly = false;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.ShortcutsEnabled = true;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.Size = new System.Drawing.Size(95, 23);
- this.CustomTextBoxSettingFakeProxyDohCleanIP.TabIndex = 0;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.Texts = "104.16.132.229";
- this.CustomTextBoxSettingFakeProxyDohCleanIP.UnderlinedStyle = true;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.UsePasswordChar = false;
- this.CustomTextBoxSettingFakeProxyDohCleanIP.WordWrap = true;
+ CustomTextBoxSettingFakeProxyDohCleanIP.AcceptsReturn = false;
+ CustomTextBoxSettingFakeProxyDohCleanIP.AcceptsTab = false;
+ CustomTextBoxSettingFakeProxyDohCleanIP.BackColor = Color.DimGray;
+ CustomTextBoxSettingFakeProxyDohCleanIP.Border = true;
+ CustomTextBoxSettingFakeProxyDohCleanIP.BorderColor = Color.Blue;
+ CustomTextBoxSettingFakeProxyDohCleanIP.BorderSize = 1;
+ CustomTextBoxSettingFakeProxyDohCleanIP.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingFakeProxyDohCleanIP.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingFakeProxyDohCleanIP.ForeColor = Color.White;
+ CustomTextBoxSettingFakeProxyDohCleanIP.HideSelection = true;
+ CustomTextBoxSettingFakeProxyDohCleanIP.Location = new Point(128, 148);
+ CustomTextBoxSettingFakeProxyDohCleanIP.MaxLength = 32767;
+ CustomTextBoxSettingFakeProxyDohCleanIP.Multiline = false;
+ CustomTextBoxSettingFakeProxyDohCleanIP.Name = "CustomTextBoxSettingFakeProxyDohCleanIP";
+ CustomTextBoxSettingFakeProxyDohCleanIP.ReadOnly = false;
+ CustomTextBoxSettingFakeProxyDohCleanIP.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingFakeProxyDohCleanIP.ShortcutsEnabled = true;
+ CustomTextBoxSettingFakeProxyDohCleanIP.Size = new Size(95, 23);
+ CustomTextBoxSettingFakeProxyDohCleanIP.TabIndex = 0;
+ CustomTextBoxSettingFakeProxyDohCleanIP.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingFakeProxyDohCleanIP.Texts = "104.16.132.229";
+ CustomTextBoxSettingFakeProxyDohCleanIP.UnderlinedStyle = true;
+ CustomTextBoxSettingFakeProxyDohCleanIP.UsePasswordChar = false;
+ CustomTextBoxSettingFakeProxyDohCleanIP.WordWrap = true;
//
// CustomTextBoxSettingFakeProxyDohAddress
//
- this.CustomTextBoxSettingFakeProxyDohAddress.AcceptsReturn = false;
- this.CustomTextBoxSettingFakeProxyDohAddress.AcceptsTab = false;
- this.CustomTextBoxSettingFakeProxyDohAddress.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingFakeProxyDohAddress.Border = true;
- this.CustomTextBoxSettingFakeProxyDohAddress.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingFakeProxyDohAddress.BorderSize = 1;
- this.CustomTextBoxSettingFakeProxyDohAddress.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingFakeProxyDohAddress.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingFakeProxyDohAddress.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingFakeProxyDohAddress.HideSelection = true;
- this.CustomTextBoxSettingFakeProxyDohAddress.Location = new System.Drawing.Point(128, 98);
- this.CustomTextBoxSettingFakeProxyDohAddress.MaxLength = 32767;
- this.CustomTextBoxSettingFakeProxyDohAddress.Multiline = false;
- this.CustomTextBoxSettingFakeProxyDohAddress.Name = "CustomTextBoxSettingFakeProxyDohAddress";
- this.CustomTextBoxSettingFakeProxyDohAddress.ReadOnly = false;
- this.CustomTextBoxSettingFakeProxyDohAddress.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingFakeProxyDohAddress.ShortcutsEnabled = true;
- this.CustomTextBoxSettingFakeProxyDohAddress.Size = new System.Drawing.Size(250, 23);
- this.CustomTextBoxSettingFakeProxyDohAddress.TabIndex = 0;
- this.CustomTextBoxSettingFakeProxyDohAddress.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingFakeProxyDohAddress.Texts = "https://dns.cloudflare.com/dns-query";
- this.CustomTextBoxSettingFakeProxyDohAddress.UnderlinedStyle = true;
- this.CustomTextBoxSettingFakeProxyDohAddress.UsePasswordChar = false;
- this.CustomTextBoxSettingFakeProxyDohAddress.WordWrap = true;
+ CustomTextBoxSettingFakeProxyDohAddress.AcceptsReturn = false;
+ CustomTextBoxSettingFakeProxyDohAddress.AcceptsTab = false;
+ CustomTextBoxSettingFakeProxyDohAddress.BackColor = Color.DimGray;
+ CustomTextBoxSettingFakeProxyDohAddress.Border = true;
+ CustomTextBoxSettingFakeProxyDohAddress.BorderColor = Color.Blue;
+ CustomTextBoxSettingFakeProxyDohAddress.BorderSize = 1;
+ CustomTextBoxSettingFakeProxyDohAddress.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingFakeProxyDohAddress.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingFakeProxyDohAddress.ForeColor = Color.White;
+ CustomTextBoxSettingFakeProxyDohAddress.HideSelection = true;
+ CustomTextBoxSettingFakeProxyDohAddress.Location = new Point(128, 98);
+ CustomTextBoxSettingFakeProxyDohAddress.MaxLength = 32767;
+ CustomTextBoxSettingFakeProxyDohAddress.Multiline = false;
+ CustomTextBoxSettingFakeProxyDohAddress.Name = "CustomTextBoxSettingFakeProxyDohAddress";
+ CustomTextBoxSettingFakeProxyDohAddress.ReadOnly = false;
+ CustomTextBoxSettingFakeProxyDohAddress.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingFakeProxyDohAddress.ShortcutsEnabled = true;
+ CustomTextBoxSettingFakeProxyDohAddress.Size = new Size(250, 23);
+ CustomTextBoxSettingFakeProxyDohAddress.TabIndex = 0;
+ CustomTextBoxSettingFakeProxyDohAddress.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingFakeProxyDohAddress.Texts = "https://dns.cloudflare.com/dns-query";
+ CustomTextBoxSettingFakeProxyDohAddress.UnderlinedStyle = true;
+ CustomTextBoxSettingFakeProxyDohAddress.UsePasswordChar = false;
+ CustomTextBoxSettingFakeProxyDohAddress.WordWrap = true;
//
// CustomLabelSettingFakeProxyDohCleanIP
//
- this.CustomLabelSettingFakeProxyDohCleanIP.AutoSize = true;
- this.CustomLabelSettingFakeProxyDohCleanIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingFakeProxyDohCleanIP.Border = false;
- this.CustomLabelSettingFakeProxyDohCleanIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingFakeProxyDohCleanIP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingFakeProxyDohCleanIP.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingFakeProxyDohCleanIP.Location = new System.Drawing.Point(20, 150);
- this.CustomLabelSettingFakeProxyDohCleanIP.Name = "CustomLabelSettingFakeProxyDohCleanIP";
- this.CustomLabelSettingFakeProxyDohCleanIP.RoundedCorners = 0;
- this.CustomLabelSettingFakeProxyDohCleanIP.Size = new System.Drawing.Size(100, 15);
- this.CustomLabelSettingFakeProxyDohCleanIP.TabIndex = 50;
- this.CustomLabelSettingFakeProxyDohCleanIP.Text = "The DoH clean IP:";
+ CustomLabelSettingFakeProxyDohCleanIP.AutoSize = true;
+ CustomLabelSettingFakeProxyDohCleanIP.BackColor = Color.DimGray;
+ CustomLabelSettingFakeProxyDohCleanIP.Border = false;
+ CustomLabelSettingFakeProxyDohCleanIP.BorderColor = Color.Blue;
+ CustomLabelSettingFakeProxyDohCleanIP.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingFakeProxyDohCleanIP.ForeColor = Color.White;
+ CustomLabelSettingFakeProxyDohCleanIP.Location = new Point(20, 150);
+ CustomLabelSettingFakeProxyDohCleanIP.Name = "CustomLabelSettingFakeProxyDohCleanIP";
+ CustomLabelSettingFakeProxyDohCleanIP.RoundedCorners = 0;
+ CustomLabelSettingFakeProxyDohCleanIP.Size = new Size(100, 15);
+ CustomLabelSettingFakeProxyDohCleanIP.TabIndex = 50;
+ CustomLabelSettingFakeProxyDohCleanIP.Text = "The DoH clean IP:";
//
// CustomLabelSettingFakeProxyDohAddress
//
- this.CustomLabelSettingFakeProxyDohAddress.AutoSize = true;
- this.CustomLabelSettingFakeProxyDohAddress.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingFakeProxyDohAddress.Border = false;
- this.CustomLabelSettingFakeProxyDohAddress.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingFakeProxyDohAddress.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingFakeProxyDohAddress.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingFakeProxyDohAddress.Location = new System.Drawing.Point(20, 100);
- this.CustomLabelSettingFakeProxyDohAddress.Name = "CustomLabelSettingFakeProxyDohAddress";
- this.CustomLabelSettingFakeProxyDohAddress.RoundedCorners = 0;
- this.CustomLabelSettingFakeProxyDohAddress.Size = new System.Drawing.Size(88, 15);
- this.CustomLabelSettingFakeProxyDohAddress.TabIndex = 49;
- this.CustomLabelSettingFakeProxyDohAddress.Text = "A DoH address:";
+ CustomLabelSettingFakeProxyDohAddress.AutoSize = true;
+ CustomLabelSettingFakeProxyDohAddress.BackColor = Color.DimGray;
+ CustomLabelSettingFakeProxyDohAddress.Border = false;
+ CustomLabelSettingFakeProxyDohAddress.BorderColor = Color.Blue;
+ CustomLabelSettingFakeProxyDohAddress.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingFakeProxyDohAddress.ForeColor = Color.White;
+ CustomLabelSettingFakeProxyDohAddress.Location = new Point(20, 100);
+ CustomLabelSettingFakeProxyDohAddress.Name = "CustomLabelSettingFakeProxyDohAddress";
+ CustomLabelSettingFakeProxyDohAddress.RoundedCorners = 0;
+ CustomLabelSettingFakeProxyDohAddress.Size = new Size(88, 15);
+ CustomLabelSettingFakeProxyDohAddress.TabIndex = 49;
+ CustomLabelSettingFakeProxyDohAddress.Text = "A DoH address:";
//
// CustomLabelSettingFakeProxyInfo
//
- this.CustomLabelSettingFakeProxyInfo.AutoSize = true;
- this.CustomLabelSettingFakeProxyInfo.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingFakeProxyInfo.Border = false;
- this.CustomLabelSettingFakeProxyInfo.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingFakeProxyInfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingFakeProxyInfo.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomLabelSettingFakeProxyInfo.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingFakeProxyInfo.Location = new System.Drawing.Point(20, 10);
- this.CustomLabelSettingFakeProxyInfo.Name = "CustomLabelSettingFakeProxyInfo";
- this.CustomLabelSettingFakeProxyInfo.RoundedCorners = 0;
- this.CustomLabelSettingFakeProxyInfo.Size = new System.Drawing.Size(247, 21);
- this.CustomLabelSettingFakeProxyInfo.TabIndex = 48;
- this.CustomLabelSettingFakeProxyInfo.Text = "Fake Proxy is use to bypass a DoH.";
+ CustomLabelSettingFakeProxyInfo.AutoSize = true;
+ CustomLabelSettingFakeProxyInfo.BackColor = Color.DimGray;
+ CustomLabelSettingFakeProxyInfo.Border = false;
+ CustomLabelSettingFakeProxyInfo.BorderColor = Color.Blue;
+ CustomLabelSettingFakeProxyInfo.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingFakeProxyInfo.Font = new Font("Segoe UI", 12F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomLabelSettingFakeProxyInfo.ForeColor = Color.White;
+ CustomLabelSettingFakeProxyInfo.Location = new Point(20, 10);
+ CustomLabelSettingFakeProxyInfo.Name = "CustomLabelSettingFakeProxyInfo";
+ CustomLabelSettingFakeProxyInfo.RoundedCorners = 0;
+ CustomLabelSettingFakeProxyInfo.Size = new Size(247, 21);
+ CustomLabelSettingFakeProxyInfo.TabIndex = 48;
+ CustomLabelSettingFakeProxyInfo.Text = "Fake Proxy is use to bypass a DoH.";
//
// CustomNumericUpDownSettingFakeProxyPort
//
- this.CustomNumericUpDownSettingFakeProxyPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingFakeProxyPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingFakeProxyPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingFakeProxyPort.Location = new System.Drawing.Point(128, 48);
- this.CustomNumericUpDownSettingFakeProxyPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingFakeProxyPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingFakeProxyPort.Name = "CustomNumericUpDownSettingFakeProxyPort";
- this.CustomNumericUpDownSettingFakeProxyPort.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownSettingFakeProxyPort.TabIndex = 47;
- this.CustomNumericUpDownSettingFakeProxyPort.Value = new decimal(new int[] {
- 8070,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingFakeProxyPort.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingFakeProxyPort.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingFakeProxyPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingFakeProxyPort.Location = new Point(128, 48);
+ CustomNumericUpDownSettingFakeProxyPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownSettingFakeProxyPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingFakeProxyPort.Name = "CustomNumericUpDownSettingFakeProxyPort";
+ CustomNumericUpDownSettingFakeProxyPort.Size = new Size(53, 23);
+ CustomNumericUpDownSettingFakeProxyPort.TabIndex = 47;
+ CustomNumericUpDownSettingFakeProxyPort.Value = new decimal(new int[] { 8070, 0, 0, 0 });
//
// CustomLabelSettingFakeProxyPort
//
- this.CustomLabelSettingFakeProxyPort.AutoSize = true;
- this.CustomLabelSettingFakeProxyPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingFakeProxyPort.Border = false;
- this.CustomLabelSettingFakeProxyPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingFakeProxyPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingFakeProxyPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingFakeProxyPort.Location = new System.Drawing.Point(20, 50);
- this.CustomLabelSettingFakeProxyPort.Name = "CustomLabelSettingFakeProxyPort";
- this.CustomLabelSettingFakeProxyPort.RoundedCorners = 0;
- this.CustomLabelSettingFakeProxyPort.Size = new System.Drawing.Size(95, 15);
- this.CustomLabelSettingFakeProxyPort.TabIndex = 0;
- this.CustomLabelSettingFakeProxyPort.Text = "Fake Proxy. Port:";
+ CustomLabelSettingFakeProxyPort.AutoSize = true;
+ CustomLabelSettingFakeProxyPort.BackColor = Color.DimGray;
+ CustomLabelSettingFakeProxyPort.Border = false;
+ CustomLabelSettingFakeProxyPort.BorderColor = Color.Blue;
+ CustomLabelSettingFakeProxyPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingFakeProxyPort.ForeColor = Color.White;
+ CustomLabelSettingFakeProxyPort.Location = new Point(20, 50);
+ CustomLabelSettingFakeProxyPort.Name = "CustomLabelSettingFakeProxyPort";
+ CustomLabelSettingFakeProxyPort.RoundedCorners = 0;
+ CustomLabelSettingFakeProxyPort.Size = new Size(95, 15);
+ CustomLabelSettingFakeProxyPort.TabIndex = 0;
+ CustomLabelSettingFakeProxyPort.Text = "Fake Proxy. Port:";
//
// TabPageSettingsCPU
//
- this.TabPageSettingsCPU.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsCPU.Controls.Add(this.CustomNumericUpDownSettingCpuKillProxyRequests);
- this.TabPageSettingsCPU.Controls.Add(this.CustomLabelSettingCpuKillProxyRequests);
- this.TabPageSettingsCPU.Controls.Add(this.CustomRadioButtonSettingCPULow);
- this.TabPageSettingsCPU.Controls.Add(this.CustomRadioButtonSettingCPUBelowNormal);
- this.TabPageSettingsCPU.Controls.Add(this.CustomRadioButtonSettingCPUNormal);
- this.TabPageSettingsCPU.Controls.Add(this.CustomRadioButtonSettingCPUAboveNormal);
- this.TabPageSettingsCPU.Controls.Add(this.CustomRadioButtonSettingCPUHigh);
- this.TabPageSettingsCPU.Controls.Add(this.CustomLabelSettingInfoCPU);
- this.TabPageSettingsCPU.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsCPU.Name = "TabPageSettingsCPU";
- this.TabPageSettingsCPU.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsCPU.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsCPU.TabIndex = 1;
- this.TabPageSettingsCPU.Tag = 6;
- this.TabPageSettingsCPU.Text = "CPU";
+ TabPageSettingsCPU.BackColor = Color.Transparent;
+ TabPageSettingsCPU.Controls.Add(CustomNumericUpDownSettingCpuKillProxyRequests);
+ TabPageSettingsCPU.Controls.Add(CustomLabelSettingCpuKillProxyRequests);
+ TabPageSettingsCPU.Controls.Add(CustomRadioButtonSettingCPULow);
+ TabPageSettingsCPU.Controls.Add(CustomRadioButtonSettingCPUBelowNormal);
+ TabPageSettingsCPU.Controls.Add(CustomRadioButtonSettingCPUNormal);
+ TabPageSettingsCPU.Controls.Add(CustomRadioButtonSettingCPUAboveNormal);
+ TabPageSettingsCPU.Controls.Add(CustomRadioButtonSettingCPUHigh);
+ TabPageSettingsCPU.Controls.Add(CustomLabelSettingInfoCPU);
+ TabPageSettingsCPU.Location = new Point(94, 4);
+ TabPageSettingsCPU.Name = "TabPageSettingsCPU";
+ TabPageSettingsCPU.Padding = new Padding(3);
+ TabPageSettingsCPU.Size = new Size(588, 357);
+ TabPageSettingsCPU.TabIndex = 1;
+ TabPageSettingsCPU.Tag = 6;
+ TabPageSettingsCPU.Text = "CPU";
//
// CustomNumericUpDownSettingCpuKillProxyRequests
//
- this.CustomNumericUpDownSettingCpuKillProxyRequests.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingCpuKillProxyRequests.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingCpuKillProxyRequests.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingCpuKillProxyRequests.Location = new System.Drawing.Point(289, 228);
- this.CustomNumericUpDownSettingCpuKillProxyRequests.Maximum = new decimal(new int[] {
- 90,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingCpuKillProxyRequests.Minimum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingCpuKillProxyRequests.Name = "CustomNumericUpDownSettingCpuKillProxyRequests";
- this.CustomNumericUpDownSettingCpuKillProxyRequests.Size = new System.Drawing.Size(45, 23);
- this.CustomNumericUpDownSettingCpuKillProxyRequests.TabIndex = 7;
- this.CustomNumericUpDownSettingCpuKillProxyRequests.Value = new decimal(new int[] {
- 40,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingCpuKillProxyRequests.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingCpuKillProxyRequests.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingCpuKillProxyRequests.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingCpuKillProxyRequests.Location = new Point(289, 228);
+ CustomNumericUpDownSettingCpuKillProxyRequests.Maximum = new decimal(new int[] { 90, 0, 0, 0 });
+ CustomNumericUpDownSettingCpuKillProxyRequests.Minimum = new decimal(new int[] { 10, 0, 0, 0 });
+ CustomNumericUpDownSettingCpuKillProxyRequests.Name = "CustomNumericUpDownSettingCpuKillProxyRequests";
+ CustomNumericUpDownSettingCpuKillProxyRequests.Size = new Size(45, 23);
+ CustomNumericUpDownSettingCpuKillProxyRequests.TabIndex = 7;
+ CustomNumericUpDownSettingCpuKillProxyRequests.Value = new decimal(new int[] { 40, 0, 0, 0 });
//
// CustomLabelSettingCpuKillProxyRequests
//
- this.CustomLabelSettingCpuKillProxyRequests.AutoSize = true;
- this.CustomLabelSettingCpuKillProxyRequests.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingCpuKillProxyRequests.Border = false;
- this.CustomLabelSettingCpuKillProxyRequests.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingCpuKillProxyRequests.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingCpuKillProxyRequests.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingCpuKillProxyRequests.Location = new System.Drawing.Point(50, 230);
- this.CustomLabelSettingCpuKillProxyRequests.Name = "CustomLabelSettingCpuKillProxyRequests";
- this.CustomLabelSettingCpuKillProxyRequests.RoundedCorners = 0;
- this.CustomLabelSettingCpuKillProxyRequests.Size = new System.Drawing.Size(231, 15);
- this.CustomLabelSettingCpuKillProxyRequests.TabIndex = 6;
- this.CustomLabelSettingCpuKillProxyRequests.Text = "Kill Proxy requests when CPU is above (%):";
+ CustomLabelSettingCpuKillProxyRequests.AutoSize = true;
+ CustomLabelSettingCpuKillProxyRequests.BackColor = Color.DimGray;
+ CustomLabelSettingCpuKillProxyRequests.Border = false;
+ CustomLabelSettingCpuKillProxyRequests.BorderColor = Color.Blue;
+ CustomLabelSettingCpuKillProxyRequests.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingCpuKillProxyRequests.ForeColor = Color.White;
+ CustomLabelSettingCpuKillProxyRequests.Location = new Point(50, 230);
+ CustomLabelSettingCpuKillProxyRequests.Name = "CustomLabelSettingCpuKillProxyRequests";
+ CustomLabelSettingCpuKillProxyRequests.RoundedCorners = 0;
+ CustomLabelSettingCpuKillProxyRequests.Size = new Size(231, 15);
+ CustomLabelSettingCpuKillProxyRequests.TabIndex = 6;
+ CustomLabelSettingCpuKillProxyRequests.Text = "Kill Proxy requests when CPU is above (%):";
//
// CustomRadioButtonSettingCPULow
//
- this.CustomRadioButtonSettingCPULow.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingCPULow.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPULow.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPULow.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingCPULow.Location = new System.Drawing.Point(50, 180);
- this.CustomRadioButtonSettingCPULow.Name = "CustomRadioButtonSettingCPULow";
- this.CustomRadioButtonSettingCPULow.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingCPULow.Size = new System.Drawing.Size(42, 17);
- this.CustomRadioButtonSettingCPULow.TabIndex = 5;
- this.CustomRadioButtonSettingCPULow.Text = "Low";
- this.CustomRadioButtonSettingCPULow.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingCPULow.BackColor = Color.DimGray;
+ CustomRadioButtonSettingCPULow.BorderColor = Color.Blue;
+ CustomRadioButtonSettingCPULow.CheckColor = Color.Blue;
+ CustomRadioButtonSettingCPULow.ForeColor = Color.White;
+ CustomRadioButtonSettingCPULow.Location = new Point(50, 180);
+ CustomRadioButtonSettingCPULow.Name = "CustomRadioButtonSettingCPULow";
+ CustomRadioButtonSettingCPULow.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingCPULow.Size = new Size(42, 17);
+ CustomRadioButtonSettingCPULow.TabIndex = 5;
+ CustomRadioButtonSettingCPULow.Text = "Low";
+ CustomRadioButtonSettingCPULow.UseVisualStyleBackColor = false;
//
// CustomRadioButtonSettingCPUBelowNormal
//
- this.CustomRadioButtonSettingCPUBelowNormal.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingCPUBelowNormal.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUBelowNormal.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUBelowNormal.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingCPUBelowNormal.Location = new System.Drawing.Point(50, 155);
- this.CustomRadioButtonSettingCPUBelowNormal.Name = "CustomRadioButtonSettingCPUBelowNormal";
- this.CustomRadioButtonSettingCPUBelowNormal.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingCPUBelowNormal.Size = new System.Drawing.Size(95, 17);
- this.CustomRadioButtonSettingCPUBelowNormal.TabIndex = 4;
- this.CustomRadioButtonSettingCPUBelowNormal.Text = "Below normal";
- this.CustomRadioButtonSettingCPUBelowNormal.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingCPUBelowNormal.BackColor = Color.DimGray;
+ CustomRadioButtonSettingCPUBelowNormal.BorderColor = Color.Blue;
+ CustomRadioButtonSettingCPUBelowNormal.CheckColor = Color.Blue;
+ CustomRadioButtonSettingCPUBelowNormal.ForeColor = Color.White;
+ CustomRadioButtonSettingCPUBelowNormal.Location = new Point(50, 155);
+ CustomRadioButtonSettingCPUBelowNormal.Name = "CustomRadioButtonSettingCPUBelowNormal";
+ CustomRadioButtonSettingCPUBelowNormal.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingCPUBelowNormal.Size = new Size(95, 17);
+ CustomRadioButtonSettingCPUBelowNormal.TabIndex = 4;
+ CustomRadioButtonSettingCPUBelowNormal.Text = "Below normal";
+ CustomRadioButtonSettingCPUBelowNormal.UseVisualStyleBackColor = false;
//
// CustomRadioButtonSettingCPUNormal
//
- this.CustomRadioButtonSettingCPUNormal.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingCPUNormal.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUNormal.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUNormal.Checked = true;
- this.CustomRadioButtonSettingCPUNormal.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingCPUNormal.Location = new System.Drawing.Point(50, 130);
- this.CustomRadioButtonSettingCPUNormal.Name = "CustomRadioButtonSettingCPUNormal";
- this.CustomRadioButtonSettingCPUNormal.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingCPUNormal.Size = new System.Drawing.Size(61, 17);
- this.CustomRadioButtonSettingCPUNormal.TabIndex = 3;
- this.CustomRadioButtonSettingCPUNormal.TabStop = true;
- this.CustomRadioButtonSettingCPUNormal.Text = "Normal";
- this.CustomRadioButtonSettingCPUNormal.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingCPUNormal.BackColor = Color.DimGray;
+ CustomRadioButtonSettingCPUNormal.BorderColor = Color.Blue;
+ CustomRadioButtonSettingCPUNormal.CheckColor = Color.Blue;
+ CustomRadioButtonSettingCPUNormal.Checked = true;
+ CustomRadioButtonSettingCPUNormal.ForeColor = Color.White;
+ CustomRadioButtonSettingCPUNormal.Location = new Point(50, 130);
+ CustomRadioButtonSettingCPUNormal.Name = "CustomRadioButtonSettingCPUNormal";
+ CustomRadioButtonSettingCPUNormal.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingCPUNormal.Size = new Size(61, 17);
+ CustomRadioButtonSettingCPUNormal.TabIndex = 3;
+ CustomRadioButtonSettingCPUNormal.TabStop = true;
+ CustomRadioButtonSettingCPUNormal.Text = "Normal";
+ CustomRadioButtonSettingCPUNormal.UseVisualStyleBackColor = false;
//
// CustomRadioButtonSettingCPUAboveNormal
//
- this.CustomRadioButtonSettingCPUAboveNormal.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingCPUAboveNormal.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUAboveNormal.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUAboveNormal.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingCPUAboveNormal.Location = new System.Drawing.Point(50, 105);
- this.CustomRadioButtonSettingCPUAboveNormal.Name = "CustomRadioButtonSettingCPUAboveNormal";
- this.CustomRadioButtonSettingCPUAboveNormal.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingCPUAboveNormal.Size = new System.Drawing.Size(97, 17);
- this.CustomRadioButtonSettingCPUAboveNormal.TabIndex = 2;
- this.CustomRadioButtonSettingCPUAboveNormal.Text = "Above normal";
- this.CustomRadioButtonSettingCPUAboveNormal.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingCPUAboveNormal.BackColor = Color.DimGray;
+ CustomRadioButtonSettingCPUAboveNormal.BorderColor = Color.Blue;
+ CustomRadioButtonSettingCPUAboveNormal.CheckColor = Color.Blue;
+ CustomRadioButtonSettingCPUAboveNormal.ForeColor = Color.White;
+ CustomRadioButtonSettingCPUAboveNormal.Location = new Point(50, 105);
+ CustomRadioButtonSettingCPUAboveNormal.Name = "CustomRadioButtonSettingCPUAboveNormal";
+ CustomRadioButtonSettingCPUAboveNormal.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingCPUAboveNormal.Size = new Size(97, 17);
+ CustomRadioButtonSettingCPUAboveNormal.TabIndex = 2;
+ CustomRadioButtonSettingCPUAboveNormal.Text = "Above normal";
+ CustomRadioButtonSettingCPUAboveNormal.UseVisualStyleBackColor = false;
//
// CustomRadioButtonSettingCPUHigh
//
- this.CustomRadioButtonSettingCPUHigh.BackColor = System.Drawing.Color.DimGray;
- this.CustomRadioButtonSettingCPUHigh.BorderColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUHigh.CheckColor = System.Drawing.Color.Blue;
- this.CustomRadioButtonSettingCPUHigh.ForeColor = System.Drawing.Color.White;
- this.CustomRadioButtonSettingCPUHigh.Location = new System.Drawing.Point(50, 80);
- this.CustomRadioButtonSettingCPUHigh.Name = "CustomRadioButtonSettingCPUHigh";
- this.CustomRadioButtonSettingCPUHigh.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomRadioButtonSettingCPUHigh.Size = new System.Drawing.Size(47, 17);
- this.CustomRadioButtonSettingCPUHigh.TabIndex = 1;
- this.CustomRadioButtonSettingCPUHigh.Text = "High";
- this.CustomRadioButtonSettingCPUHigh.UseVisualStyleBackColor = false;
+ CustomRadioButtonSettingCPUHigh.BackColor = Color.DimGray;
+ CustomRadioButtonSettingCPUHigh.BorderColor = Color.Blue;
+ CustomRadioButtonSettingCPUHigh.CheckColor = Color.Blue;
+ CustomRadioButtonSettingCPUHigh.ForeColor = Color.White;
+ CustomRadioButtonSettingCPUHigh.Location = new Point(50, 80);
+ CustomRadioButtonSettingCPUHigh.Name = "CustomRadioButtonSettingCPUHigh";
+ CustomRadioButtonSettingCPUHigh.SelectionColor = Color.LightBlue;
+ CustomRadioButtonSettingCPUHigh.Size = new Size(47, 17);
+ CustomRadioButtonSettingCPUHigh.TabIndex = 1;
+ CustomRadioButtonSettingCPUHigh.Text = "High";
+ CustomRadioButtonSettingCPUHigh.UseVisualStyleBackColor = false;
//
// CustomLabelSettingInfoCPU
//
- this.CustomLabelSettingInfoCPU.AutoSize = true;
- this.CustomLabelSettingInfoCPU.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingInfoCPU.Border = false;
- this.CustomLabelSettingInfoCPU.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingInfoCPU.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingInfoCPU.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingInfoCPU.Location = new System.Drawing.Point(50, 35);
- this.CustomLabelSettingInfoCPU.Name = "CustomLabelSettingInfoCPU";
- this.CustomLabelSettingInfoCPU.RoundedCorners = 0;
- this.CustomLabelSettingInfoCPU.Size = new System.Drawing.Size(132, 15);
- this.CustomLabelSettingInfoCPU.TabIndex = 0;
- this.CustomLabelSettingInfoCPU.Text = "Set processing priorities";
+ CustomLabelSettingInfoCPU.AutoSize = true;
+ CustomLabelSettingInfoCPU.BackColor = Color.DimGray;
+ CustomLabelSettingInfoCPU.Border = false;
+ CustomLabelSettingInfoCPU.BorderColor = Color.Blue;
+ CustomLabelSettingInfoCPU.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingInfoCPU.ForeColor = Color.White;
+ CustomLabelSettingInfoCPU.Location = new Point(50, 35);
+ CustomLabelSettingInfoCPU.Name = "CustomLabelSettingInfoCPU";
+ CustomLabelSettingInfoCPU.RoundedCorners = 0;
+ CustomLabelSettingInfoCPU.Size = new Size(132, 15);
+ CustomLabelSettingInfoCPU.TabIndex = 0;
+ CustomLabelSettingInfoCPU.Text = "Set processing priorities";
//
// TabPageSettingsOthers
//
- this.TabPageSettingsOthers.BackColor = System.Drawing.Color.Transparent;
- this.TabPageSettingsOthers.Controls.Add(this.CustomNumericUpDownSettingFallbackDnsPort);
- this.TabPageSettingsOthers.Controls.Add(this.CustomLabelSettingFallbackDnsPort);
- this.TabPageSettingsOthers.Controls.Add(this.CustomTextBoxSettingFallbackDnsIP);
- this.TabPageSettingsOthers.Controls.Add(this.CustomLabelSettingFallbackDnsIP);
- this.TabPageSettingsOthers.Controls.Add(this.CustomNumericUpDownSettingBootstrapDnsPort);
- this.TabPageSettingsOthers.Controls.Add(this.CustomLabelSettingBootstrapDnsPort);
- this.TabPageSettingsOthers.Controls.Add(this.CustomButtonSettingRestoreDefault);
- this.TabPageSettingsOthers.Controls.Add(this.CustomCheckBoxSettingDisableAudioAlert);
- this.TabPageSettingsOthers.Controls.Add(this.CustomLabelSettingBootstrapDnsIP);
- this.TabPageSettingsOthers.Controls.Add(this.CustomCheckBoxSettingDontAskCertificate);
- this.TabPageSettingsOthers.Controls.Add(this.CustomTextBoxSettingBootstrapDnsIP);
- this.TabPageSettingsOthers.Location = new System.Drawing.Point(94, 4);
- this.TabPageSettingsOthers.Name = "TabPageSettingsOthers";
- this.TabPageSettingsOthers.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageSettingsOthers.Size = new System.Drawing.Size(588, 357);
- this.TabPageSettingsOthers.TabIndex = 2;
- this.TabPageSettingsOthers.Tag = 7;
- this.TabPageSettingsOthers.Text = "Others";
+ TabPageSettingsOthers.BackColor = Color.Transparent;
+ TabPageSettingsOthers.Controls.Add(CustomButtonImportUserData);
+ TabPageSettingsOthers.Controls.Add(CustomButtonExportUserData);
+ TabPageSettingsOthers.Controls.Add(CustomCheckBoxSettingWriteLogWindowToFile);
+ TabPageSettingsOthers.Controls.Add(CustomNumericUpDownSettingFallbackDnsPort);
+ TabPageSettingsOthers.Controls.Add(CustomLabelSettingFallbackDnsPort);
+ TabPageSettingsOthers.Controls.Add(CustomTextBoxSettingFallbackDnsIP);
+ TabPageSettingsOthers.Controls.Add(CustomLabelSettingFallbackDnsIP);
+ TabPageSettingsOthers.Controls.Add(CustomNumericUpDownSettingBootstrapDnsPort);
+ TabPageSettingsOthers.Controls.Add(CustomLabelSettingBootstrapDnsPort);
+ TabPageSettingsOthers.Controls.Add(CustomButtonSettingRestoreDefault);
+ TabPageSettingsOthers.Controls.Add(CustomCheckBoxSettingDisableAudioAlert);
+ TabPageSettingsOthers.Controls.Add(CustomLabelSettingBootstrapDnsIP);
+ TabPageSettingsOthers.Controls.Add(CustomCheckBoxSettingDontAskCertificate);
+ TabPageSettingsOthers.Controls.Add(CustomTextBoxSettingBootstrapDnsIP);
+ TabPageSettingsOthers.Location = new Point(94, 4);
+ TabPageSettingsOthers.Name = "TabPageSettingsOthers";
+ TabPageSettingsOthers.Padding = new Padding(3);
+ TabPageSettingsOthers.Size = new Size(588, 357);
+ TabPageSettingsOthers.TabIndex = 2;
+ TabPageSettingsOthers.Tag = 7;
+ TabPageSettingsOthers.Text = "Others";
+ //
+ // CustomButtonImportUserData
+ //
+ CustomButtonImportUserData.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ CustomButtonImportUserData.BorderColor = Color.Blue;
+ CustomButtonImportUserData.FlatStyle = FlatStyle.Flat;
+ CustomButtonImportUserData.Location = new Point(476, 324);
+ CustomButtonImportUserData.Name = "CustomButtonImportUserData";
+ CustomButtonImportUserData.RoundedCorners = 5;
+ CustomButtonImportUserData.SelectionColor = Color.LightBlue;
+ CustomButtonImportUserData.Size = new Size(106, 27);
+ CustomButtonImportUserData.TabIndex = 20;
+ CustomButtonImportUserData.Text = "Import user data";
+ CustomButtonImportUserData.UseVisualStyleBackColor = true;
+ CustomButtonImportUserData.Click += CustomButtonImportUserData_Click;
+ //
+ // CustomButtonExportUserData
+ //
+ CustomButtonExportUserData.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ CustomButtonExportUserData.BorderColor = Color.Blue;
+ CustomButtonExportUserData.FlatStyle = FlatStyle.Flat;
+ CustomButtonExportUserData.Location = new Point(368, 324);
+ CustomButtonExportUserData.Name = "CustomButtonExportUserData";
+ CustomButtonExportUserData.RoundedCorners = 5;
+ CustomButtonExportUserData.SelectionColor = Color.LightBlue;
+ CustomButtonExportUserData.Size = new Size(104, 27);
+ CustomButtonExportUserData.TabIndex = 19;
+ CustomButtonExportUserData.Text = "Export user data";
+ CustomButtonExportUserData.UseVisualStyleBackColor = true;
+ CustomButtonExportUserData.Click += CustomButtonExportUserData_Click;
+ //
+ // CustomCheckBoxSettingWriteLogWindowToFile
+ //
+ CustomCheckBoxSettingWriteLogWindowToFile.BackColor = Color.DimGray;
+ CustomCheckBoxSettingWriteLogWindowToFile.BorderColor = Color.Blue;
+ CustomCheckBoxSettingWriteLogWindowToFile.CheckColor = Color.Blue;
+ CustomCheckBoxSettingWriteLogWindowToFile.ForeColor = Color.White;
+ CustomCheckBoxSettingWriteLogWindowToFile.Location = new Point(15, 170);
+ CustomCheckBoxSettingWriteLogWindowToFile.Name = "CustomCheckBoxSettingWriteLogWindowToFile";
+ CustomCheckBoxSettingWriteLogWindowToFile.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingWriteLogWindowToFile.Size = new Size(154, 17);
+ CustomCheckBoxSettingWriteLogWindowToFile.TabIndex = 16;
+ CustomCheckBoxSettingWriteLogWindowToFile.Text = "Write log window to file.";
+ CustomCheckBoxSettingWriteLogWindowToFile.UseVisualStyleBackColor = false;
//
// CustomNumericUpDownSettingFallbackDnsPort
//
- this.CustomNumericUpDownSettingFallbackDnsPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingFallbackDnsPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingFallbackDnsPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingFallbackDnsPort.Enabled = false;
- this.CustomNumericUpDownSettingFallbackDnsPort.Location = new System.Drawing.Point(395, 68);
- this.CustomNumericUpDownSettingFallbackDnsPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingFallbackDnsPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingFallbackDnsPort.Name = "CustomNumericUpDownSettingFallbackDnsPort";
- this.CustomNumericUpDownSettingFallbackDnsPort.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownSettingFallbackDnsPort.TabIndex = 13;
- this.CustomNumericUpDownSettingFallbackDnsPort.Value = new decimal(new int[] {
- 53,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingFallbackDnsPort.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingFallbackDnsPort.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingFallbackDnsPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingFallbackDnsPort.Enabled = false;
+ CustomNumericUpDownSettingFallbackDnsPort.Location = new Point(395, 68);
+ CustomNumericUpDownSettingFallbackDnsPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownSettingFallbackDnsPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingFallbackDnsPort.Name = "CustomNumericUpDownSettingFallbackDnsPort";
+ CustomNumericUpDownSettingFallbackDnsPort.Size = new Size(53, 23);
+ CustomNumericUpDownSettingFallbackDnsPort.TabIndex = 13;
+ CustomNumericUpDownSettingFallbackDnsPort.Value = new decimal(new int[] { 53, 0, 0, 0 });
//
// CustomLabelSettingFallbackDnsPort
//
- this.CustomLabelSettingFallbackDnsPort.AutoSize = true;
- this.CustomLabelSettingFallbackDnsPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingFallbackDnsPort.Border = false;
- this.CustomLabelSettingFallbackDnsPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingFallbackDnsPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingFallbackDnsPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingFallbackDnsPort.Location = new System.Drawing.Point(275, 70);
- this.CustomLabelSettingFallbackDnsPort.Name = "CustomLabelSettingFallbackDnsPort";
- this.CustomLabelSettingFallbackDnsPort.RoundedCorners = 0;
- this.CustomLabelSettingFallbackDnsPort.Size = new System.Drawing.Size(104, 15);
- this.CustomLabelSettingFallbackDnsPort.TabIndex = 12;
- this.CustomLabelSettingFallbackDnsPort.Text = "Fallback DNS Port:";
+ CustomLabelSettingFallbackDnsPort.AutoSize = true;
+ CustomLabelSettingFallbackDnsPort.BackColor = Color.DimGray;
+ CustomLabelSettingFallbackDnsPort.Border = false;
+ CustomLabelSettingFallbackDnsPort.BorderColor = Color.Blue;
+ CustomLabelSettingFallbackDnsPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingFallbackDnsPort.ForeColor = Color.White;
+ CustomLabelSettingFallbackDnsPort.Location = new Point(275, 70);
+ CustomLabelSettingFallbackDnsPort.Name = "CustomLabelSettingFallbackDnsPort";
+ CustomLabelSettingFallbackDnsPort.RoundedCorners = 0;
+ CustomLabelSettingFallbackDnsPort.Size = new Size(104, 15);
+ CustomLabelSettingFallbackDnsPort.TabIndex = 12;
+ CustomLabelSettingFallbackDnsPort.Text = "Fallback DNS Port:";
//
// CustomTextBoxSettingFallbackDnsIP
//
- this.CustomTextBoxSettingFallbackDnsIP.AcceptsReturn = false;
- this.CustomTextBoxSettingFallbackDnsIP.AcceptsTab = false;
- this.CustomTextBoxSettingFallbackDnsIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingFallbackDnsIP.Border = true;
- this.CustomTextBoxSettingFallbackDnsIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingFallbackDnsIP.BorderSize = 1;
- this.CustomTextBoxSettingFallbackDnsIP.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingFallbackDnsIP.Enabled = false;
- this.CustomTextBoxSettingFallbackDnsIP.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingFallbackDnsIP.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingFallbackDnsIP.HideSelection = true;
- this.CustomTextBoxSettingFallbackDnsIP.Location = new System.Drawing.Point(120, 68);
- this.CustomTextBoxSettingFallbackDnsIP.MaxLength = 32767;
- this.CustomTextBoxSettingFallbackDnsIP.Multiline = false;
- this.CustomTextBoxSettingFallbackDnsIP.Name = "CustomTextBoxSettingFallbackDnsIP";
- this.CustomTextBoxSettingFallbackDnsIP.ReadOnly = false;
- this.CustomTextBoxSettingFallbackDnsIP.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingFallbackDnsIP.ShortcutsEnabled = true;
- this.CustomTextBoxSettingFallbackDnsIP.Size = new System.Drawing.Size(95, 23);
- this.CustomTextBoxSettingFallbackDnsIP.TabIndex = 0;
- this.CustomTextBoxSettingFallbackDnsIP.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingFallbackDnsIP.Texts = "8.8.8.8";
- this.CustomTextBoxSettingFallbackDnsIP.UnderlinedStyle = true;
- this.CustomTextBoxSettingFallbackDnsIP.UsePasswordChar = false;
- this.CustomTextBoxSettingFallbackDnsIP.WordWrap = true;
+ CustomTextBoxSettingFallbackDnsIP.AcceptsReturn = false;
+ CustomTextBoxSettingFallbackDnsIP.AcceptsTab = false;
+ CustomTextBoxSettingFallbackDnsIP.BackColor = Color.DimGray;
+ CustomTextBoxSettingFallbackDnsIP.Border = true;
+ CustomTextBoxSettingFallbackDnsIP.BorderColor = Color.Blue;
+ CustomTextBoxSettingFallbackDnsIP.BorderSize = 1;
+ CustomTextBoxSettingFallbackDnsIP.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingFallbackDnsIP.Enabled = false;
+ CustomTextBoxSettingFallbackDnsIP.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingFallbackDnsIP.ForeColor = Color.White;
+ CustomTextBoxSettingFallbackDnsIP.HideSelection = true;
+ CustomTextBoxSettingFallbackDnsIP.Location = new Point(120, 68);
+ CustomTextBoxSettingFallbackDnsIP.MaxLength = 32767;
+ CustomTextBoxSettingFallbackDnsIP.Multiline = false;
+ CustomTextBoxSettingFallbackDnsIP.Name = "CustomTextBoxSettingFallbackDnsIP";
+ CustomTextBoxSettingFallbackDnsIP.ReadOnly = false;
+ CustomTextBoxSettingFallbackDnsIP.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingFallbackDnsIP.ShortcutsEnabled = true;
+ CustomTextBoxSettingFallbackDnsIP.Size = new Size(95, 23);
+ CustomTextBoxSettingFallbackDnsIP.TabIndex = 0;
+ CustomTextBoxSettingFallbackDnsIP.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingFallbackDnsIP.Texts = "8.8.8.8";
+ CustomTextBoxSettingFallbackDnsIP.UnderlinedStyle = true;
+ CustomTextBoxSettingFallbackDnsIP.UsePasswordChar = false;
+ CustomTextBoxSettingFallbackDnsIP.WordWrap = true;
//
// CustomLabelSettingFallbackDnsIP
//
- this.CustomLabelSettingFallbackDnsIP.AutoSize = true;
- this.CustomLabelSettingFallbackDnsIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingFallbackDnsIP.Border = false;
- this.CustomLabelSettingFallbackDnsIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingFallbackDnsIP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingFallbackDnsIP.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingFallbackDnsIP.Location = new System.Drawing.Point(15, 70);
- this.CustomLabelSettingFallbackDnsIP.Name = "CustomLabelSettingFallbackDnsIP";
- this.CustomLabelSettingFallbackDnsIP.RoundedCorners = 0;
- this.CustomLabelSettingFallbackDnsIP.Size = new System.Drawing.Size(92, 15);
- this.CustomLabelSettingFallbackDnsIP.TabIndex = 10;
- this.CustomLabelSettingFallbackDnsIP.Text = "Fallback DNS IP:";
+ CustomLabelSettingFallbackDnsIP.AutoSize = true;
+ CustomLabelSettingFallbackDnsIP.BackColor = Color.DimGray;
+ CustomLabelSettingFallbackDnsIP.Border = false;
+ CustomLabelSettingFallbackDnsIP.BorderColor = Color.Blue;
+ CustomLabelSettingFallbackDnsIP.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingFallbackDnsIP.ForeColor = Color.White;
+ CustomLabelSettingFallbackDnsIP.Location = new Point(15, 70);
+ CustomLabelSettingFallbackDnsIP.Name = "CustomLabelSettingFallbackDnsIP";
+ CustomLabelSettingFallbackDnsIP.RoundedCorners = 0;
+ CustomLabelSettingFallbackDnsIP.Size = new Size(92, 15);
+ CustomLabelSettingFallbackDnsIP.TabIndex = 10;
+ CustomLabelSettingFallbackDnsIP.Text = "Fallback DNS IP:";
//
// CustomNumericUpDownSettingBootstrapDnsPort
//
- this.CustomNumericUpDownSettingBootstrapDnsPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownSettingBootstrapDnsPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownSettingBootstrapDnsPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownSettingBootstrapDnsPort.Location = new System.Drawing.Point(395, 18);
- this.CustomNumericUpDownSettingBootstrapDnsPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingBootstrapDnsPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownSettingBootstrapDnsPort.Name = "CustomNumericUpDownSettingBootstrapDnsPort";
- this.CustomNumericUpDownSettingBootstrapDnsPort.Size = new System.Drawing.Size(53, 23);
- this.CustomNumericUpDownSettingBootstrapDnsPort.TabIndex = 9;
- this.CustomNumericUpDownSettingBootstrapDnsPort.Value = new decimal(new int[] {
- 53,
- 0,
- 0,
- 0});
+ CustomNumericUpDownSettingBootstrapDnsPort.BackColor = Color.DimGray;
+ CustomNumericUpDownSettingBootstrapDnsPort.BorderColor = Color.Blue;
+ CustomNumericUpDownSettingBootstrapDnsPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownSettingBootstrapDnsPort.Location = new Point(395, 18);
+ CustomNumericUpDownSettingBootstrapDnsPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownSettingBootstrapDnsPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownSettingBootstrapDnsPort.Name = "CustomNumericUpDownSettingBootstrapDnsPort";
+ CustomNumericUpDownSettingBootstrapDnsPort.Size = new Size(53, 23);
+ CustomNumericUpDownSettingBootstrapDnsPort.TabIndex = 9;
+ CustomNumericUpDownSettingBootstrapDnsPort.Value = new decimal(new int[] { 53, 0, 0, 0 });
//
// CustomLabelSettingBootstrapDnsPort
//
- this.CustomLabelSettingBootstrapDnsPort.AutoSize = true;
- this.CustomLabelSettingBootstrapDnsPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingBootstrapDnsPort.Border = false;
- this.CustomLabelSettingBootstrapDnsPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingBootstrapDnsPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingBootstrapDnsPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingBootstrapDnsPort.Location = new System.Drawing.Point(275, 20);
- this.CustomLabelSettingBootstrapDnsPort.Name = "CustomLabelSettingBootstrapDnsPort";
- this.CustomLabelSettingBootstrapDnsPort.RoundedCorners = 0;
- this.CustomLabelSettingBootstrapDnsPort.Size = new System.Drawing.Size(112, 15);
- this.CustomLabelSettingBootstrapDnsPort.TabIndex = 8;
- this.CustomLabelSettingBootstrapDnsPort.Text = "Bootstrap DNS Port:";
+ CustomLabelSettingBootstrapDnsPort.AutoSize = true;
+ CustomLabelSettingBootstrapDnsPort.BackColor = Color.DimGray;
+ CustomLabelSettingBootstrapDnsPort.Border = false;
+ CustomLabelSettingBootstrapDnsPort.BorderColor = Color.Blue;
+ CustomLabelSettingBootstrapDnsPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingBootstrapDnsPort.ForeColor = Color.White;
+ CustomLabelSettingBootstrapDnsPort.Location = new Point(275, 20);
+ CustomLabelSettingBootstrapDnsPort.Name = "CustomLabelSettingBootstrapDnsPort";
+ CustomLabelSettingBootstrapDnsPort.RoundedCorners = 0;
+ CustomLabelSettingBootstrapDnsPort.Size = new Size(112, 15);
+ CustomLabelSettingBootstrapDnsPort.TabIndex = 8;
+ CustomLabelSettingBootstrapDnsPort.Text = "Bootstrap DNS Port:";
//
// CustomButtonSettingRestoreDefault
//
- this.CustomButtonSettingRestoreDefault.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomButtonSettingRestoreDefault.AutoSize = true;
- this.CustomButtonSettingRestoreDefault.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonSettingRestoreDefault.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonSettingRestoreDefault.Location = new System.Drawing.Point(40, 324);
- this.CustomButtonSettingRestoreDefault.Name = "CustomButtonSettingRestoreDefault";
- this.CustomButtonSettingRestoreDefault.RoundedCorners = 5;
- this.CustomButtonSettingRestoreDefault.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonSettingRestoreDefault.Size = new System.Drawing.Size(171, 27);
- this.CustomButtonSettingRestoreDefault.TabIndex = 2;
- this.CustomButtonSettingRestoreDefault.Text = "Restore all settings to default";
- this.CustomButtonSettingRestoreDefault.UseVisualStyleBackColor = true;
- this.CustomButtonSettingRestoreDefault.Click += new System.EventHandler(this.CustomButtonSettingRestoreDefault_Click);
+ CustomButtonSettingRestoreDefault.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonSettingRestoreDefault.BorderColor = Color.Blue;
+ CustomButtonSettingRestoreDefault.FlatStyle = FlatStyle.Flat;
+ CustomButtonSettingRestoreDefault.Location = new Point(40, 324);
+ CustomButtonSettingRestoreDefault.Name = "CustomButtonSettingRestoreDefault";
+ CustomButtonSettingRestoreDefault.RoundedCorners = 5;
+ CustomButtonSettingRestoreDefault.SelectionColor = Color.LightBlue;
+ CustomButtonSettingRestoreDefault.Size = new Size(171, 27);
+ CustomButtonSettingRestoreDefault.TabIndex = 2;
+ CustomButtonSettingRestoreDefault.Text = "Restore all settings to default";
+ CustomButtonSettingRestoreDefault.UseVisualStyleBackColor = true;
+ CustomButtonSettingRestoreDefault.Click += CustomButtonSettingRestoreDefault_Click;
//
// CustomCheckBoxSettingDisableAudioAlert
//
- this.CustomCheckBoxSettingDisableAudioAlert.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingDisableAudioAlert.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingDisableAudioAlert.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingDisableAudioAlert.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingDisableAudioAlert.Location = new System.Drawing.Point(15, 170);
- this.CustomCheckBoxSettingDisableAudioAlert.Name = "CustomCheckBoxSettingDisableAudioAlert";
- this.CustomCheckBoxSettingDisableAudioAlert.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingDisableAudioAlert.Size = new System.Drawing.Size(125, 17);
- this.CustomCheckBoxSettingDisableAudioAlert.TabIndex = 6;
- this.CustomCheckBoxSettingDisableAudioAlert.Text = "Disable audio alert.";
- this.CustomCheckBoxSettingDisableAudioAlert.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingDisableAudioAlert.BackColor = Color.DimGray;
+ CustomCheckBoxSettingDisableAudioAlert.BorderColor = Color.Blue;
+ CustomCheckBoxSettingDisableAudioAlert.CheckColor = Color.Blue;
+ CustomCheckBoxSettingDisableAudioAlert.ForeColor = Color.White;
+ CustomCheckBoxSettingDisableAudioAlert.Location = new Point(15, 140);
+ CustomCheckBoxSettingDisableAudioAlert.Name = "CustomCheckBoxSettingDisableAudioAlert";
+ CustomCheckBoxSettingDisableAudioAlert.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingDisableAudioAlert.Size = new Size(125, 17);
+ CustomCheckBoxSettingDisableAudioAlert.TabIndex = 6;
+ CustomCheckBoxSettingDisableAudioAlert.Text = "Disable audio alert.";
+ CustomCheckBoxSettingDisableAudioAlert.UseVisualStyleBackColor = false;
//
// CustomLabelSettingBootstrapDnsIP
//
- this.CustomLabelSettingBootstrapDnsIP.AutoSize = true;
- this.CustomLabelSettingBootstrapDnsIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelSettingBootstrapDnsIP.Border = false;
- this.CustomLabelSettingBootstrapDnsIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelSettingBootstrapDnsIP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelSettingBootstrapDnsIP.ForeColor = System.Drawing.Color.White;
- this.CustomLabelSettingBootstrapDnsIP.Location = new System.Drawing.Point(15, 20);
- this.CustomLabelSettingBootstrapDnsIP.Name = "CustomLabelSettingBootstrapDnsIP";
- this.CustomLabelSettingBootstrapDnsIP.RoundedCorners = 0;
- this.CustomLabelSettingBootstrapDnsIP.Size = new System.Drawing.Size(100, 15);
- this.CustomLabelSettingBootstrapDnsIP.TabIndex = 3;
- this.CustomLabelSettingBootstrapDnsIP.Text = "Bootstrap DNS IP:";
+ CustomLabelSettingBootstrapDnsIP.AutoSize = true;
+ CustomLabelSettingBootstrapDnsIP.BackColor = Color.DimGray;
+ CustomLabelSettingBootstrapDnsIP.Border = false;
+ CustomLabelSettingBootstrapDnsIP.BorderColor = Color.Blue;
+ CustomLabelSettingBootstrapDnsIP.FlatStyle = FlatStyle.Flat;
+ CustomLabelSettingBootstrapDnsIP.ForeColor = Color.White;
+ CustomLabelSettingBootstrapDnsIP.Location = new Point(15, 20);
+ CustomLabelSettingBootstrapDnsIP.Name = "CustomLabelSettingBootstrapDnsIP";
+ CustomLabelSettingBootstrapDnsIP.RoundedCorners = 0;
+ CustomLabelSettingBootstrapDnsIP.Size = new Size(100, 15);
+ CustomLabelSettingBootstrapDnsIP.TabIndex = 3;
+ CustomLabelSettingBootstrapDnsIP.Text = "Bootstrap DNS IP:";
//
// CustomCheckBoxSettingDontAskCertificate
//
- this.CustomCheckBoxSettingDontAskCertificate.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxSettingDontAskCertificate.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingDontAskCertificate.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxSettingDontAskCertificate.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxSettingDontAskCertificate.Location = new System.Drawing.Point(15, 120);
- this.CustomCheckBoxSettingDontAskCertificate.Name = "CustomCheckBoxSettingDontAskCertificate";
- this.CustomCheckBoxSettingDontAskCertificate.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxSettingDontAskCertificate.Size = new System.Drawing.Size(210, 17);
- this.CustomCheckBoxSettingDontAskCertificate.TabIndex = 4;
- this.CustomCheckBoxSettingDontAskCertificate.Text = "Don\'t ask for certificate every time.";
- this.CustomCheckBoxSettingDontAskCertificate.UseVisualStyleBackColor = false;
+ CustomCheckBoxSettingDontAskCertificate.BackColor = Color.DimGray;
+ CustomCheckBoxSettingDontAskCertificate.BorderColor = Color.Blue;
+ CustomCheckBoxSettingDontAskCertificate.CheckColor = Color.Blue;
+ CustomCheckBoxSettingDontAskCertificate.ForeColor = Color.White;
+ CustomCheckBoxSettingDontAskCertificate.Location = new Point(15, 110);
+ CustomCheckBoxSettingDontAskCertificate.Name = "CustomCheckBoxSettingDontAskCertificate";
+ CustomCheckBoxSettingDontAskCertificate.SelectionColor = Color.LightBlue;
+ CustomCheckBoxSettingDontAskCertificate.Size = new Size(210, 17);
+ CustomCheckBoxSettingDontAskCertificate.TabIndex = 4;
+ CustomCheckBoxSettingDontAskCertificate.Text = "Don't ask for certificate every time.";
+ CustomCheckBoxSettingDontAskCertificate.UseVisualStyleBackColor = false;
//
// CustomTextBoxSettingBootstrapDnsIP
//
- this.CustomTextBoxSettingBootstrapDnsIP.AcceptsReturn = false;
- this.CustomTextBoxSettingBootstrapDnsIP.AcceptsTab = false;
- this.CustomTextBoxSettingBootstrapDnsIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxSettingBootstrapDnsIP.Border = true;
- this.CustomTextBoxSettingBootstrapDnsIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxSettingBootstrapDnsIP.BorderSize = 1;
- this.CustomTextBoxSettingBootstrapDnsIP.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxSettingBootstrapDnsIP.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxSettingBootstrapDnsIP.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxSettingBootstrapDnsIP.HideSelection = true;
- this.CustomTextBoxSettingBootstrapDnsIP.Location = new System.Drawing.Point(120, 18);
- this.CustomTextBoxSettingBootstrapDnsIP.MaxLength = 32767;
- this.CustomTextBoxSettingBootstrapDnsIP.Multiline = false;
- this.CustomTextBoxSettingBootstrapDnsIP.Name = "CustomTextBoxSettingBootstrapDnsIP";
- this.CustomTextBoxSettingBootstrapDnsIP.ReadOnly = false;
- this.CustomTextBoxSettingBootstrapDnsIP.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxSettingBootstrapDnsIP.ShortcutsEnabled = true;
- this.CustomTextBoxSettingBootstrapDnsIP.Size = new System.Drawing.Size(95, 23);
- this.CustomTextBoxSettingBootstrapDnsIP.TabIndex = 0;
- this.CustomTextBoxSettingBootstrapDnsIP.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxSettingBootstrapDnsIP.Texts = "8.8.8.8";
- this.CustomTextBoxSettingBootstrapDnsIP.UnderlinedStyle = true;
- this.CustomTextBoxSettingBootstrapDnsIP.UsePasswordChar = false;
- this.CustomTextBoxSettingBootstrapDnsIP.WordWrap = true;
+ CustomTextBoxSettingBootstrapDnsIP.AcceptsReturn = false;
+ CustomTextBoxSettingBootstrapDnsIP.AcceptsTab = false;
+ CustomTextBoxSettingBootstrapDnsIP.BackColor = Color.DimGray;
+ CustomTextBoxSettingBootstrapDnsIP.Border = true;
+ CustomTextBoxSettingBootstrapDnsIP.BorderColor = Color.Blue;
+ CustomTextBoxSettingBootstrapDnsIP.BorderSize = 1;
+ CustomTextBoxSettingBootstrapDnsIP.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxSettingBootstrapDnsIP.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxSettingBootstrapDnsIP.ForeColor = Color.White;
+ CustomTextBoxSettingBootstrapDnsIP.HideSelection = true;
+ CustomTextBoxSettingBootstrapDnsIP.Location = new Point(120, 18);
+ CustomTextBoxSettingBootstrapDnsIP.MaxLength = 32767;
+ CustomTextBoxSettingBootstrapDnsIP.Multiline = false;
+ CustomTextBoxSettingBootstrapDnsIP.Name = "CustomTextBoxSettingBootstrapDnsIP";
+ CustomTextBoxSettingBootstrapDnsIP.ReadOnly = false;
+ CustomTextBoxSettingBootstrapDnsIP.ScrollBars = ScrollBars.None;
+ CustomTextBoxSettingBootstrapDnsIP.ShortcutsEnabled = true;
+ CustomTextBoxSettingBootstrapDnsIP.Size = new Size(95, 23);
+ CustomTextBoxSettingBootstrapDnsIP.TabIndex = 0;
+ CustomTextBoxSettingBootstrapDnsIP.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxSettingBootstrapDnsIP.Texts = "8.8.8.8";
+ CustomTextBoxSettingBootstrapDnsIP.UnderlinedStyle = true;
+ CustomTextBoxSettingBootstrapDnsIP.UsePasswordChar = false;
+ CustomTextBoxSettingBootstrapDnsIP.WordWrap = true;
//
// TabPageAbout
//
- this.TabPageAbout.BackColor = System.Drawing.Color.Transparent;
- this.TabPageAbout.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
- this.TabPageAbout.Controls.Add(this.CustomLabelAboutVersion);
- this.TabPageAbout.Controls.Add(this.PictureBoxFarvahar);
- this.TabPageAbout.Controls.Add(this.CustomLabelAboutCopyright);
- this.TabPageAbout.Controls.Add(this.LinkLabelStAlidxdydz);
- this.TabPageAbout.Controls.Add(this.CustomLabelAboutSpecialThanks);
- this.TabPageAbout.Controls.Add(this.LinkLabelGoodbyeDPI);
- this.TabPageAbout.Controls.Add(this.LinkLabelDNSCrypt);
- this.TabPageAbout.Controls.Add(this.LinkLabelDNSProxy);
- this.TabPageAbout.Controls.Add(this.LinkLabelDNSLookup);
- this.TabPageAbout.Controls.Add(this.CustomLabelAboutUsing);
- this.TabPageAbout.Controls.Add(this.CustomLabelAboutThis2);
- this.TabPageAbout.Controls.Add(this.CustomLabelAboutThis);
- this.TabPageAbout.Controls.Add(this.PictureBoxAbout);
- this.TabPageAbout.Location = new System.Drawing.Point(4, 25);
- this.TabPageAbout.Name = "TabPageAbout";
- this.TabPageAbout.Padding = new System.Windows.Forms.Padding(3);
- this.TabPageAbout.Size = new System.Drawing.Size(692, 371);
- this.TabPageAbout.TabIndex = 2;
- this.TabPageAbout.Tag = 3;
- this.TabPageAbout.Text = "About";
+ TabPageAbout.BackColor = Color.Transparent;
+ TabPageAbout.BackgroundImageLayout = ImageLayout.Stretch;
+ TabPageAbout.Controls.Add(CustomLabelAboutVersion);
+ TabPageAbout.Controls.Add(PictureBoxFarvahar);
+ TabPageAbout.Controls.Add(CustomLabelAboutCopyright);
+ TabPageAbout.Controls.Add(LinkLabelStAlidxdydz);
+ TabPageAbout.Controls.Add(CustomLabelAboutSpecialThanks);
+ TabPageAbout.Controls.Add(LinkLabelGoodbyeDPI);
+ TabPageAbout.Controls.Add(LinkLabelDNSCrypt);
+ TabPageAbout.Controls.Add(LinkLabelDNSProxy);
+ TabPageAbout.Controls.Add(LinkLabelDNSLookup);
+ TabPageAbout.Controls.Add(CustomLabelAboutUsing);
+ TabPageAbout.Controls.Add(CustomLabelAboutThis2);
+ TabPageAbout.Controls.Add(CustomLabelAboutThis);
+ TabPageAbout.Controls.Add(PictureBoxAbout);
+ TabPageAbout.Location = new Point(4, 25);
+ TabPageAbout.Name = "TabPageAbout";
+ TabPageAbout.Padding = new Padding(3);
+ TabPageAbout.Size = new Size(692, 371);
+ TabPageAbout.TabIndex = 2;
+ TabPageAbout.Tag = 3;
+ TabPageAbout.Text = "About";
//
// CustomLabelAboutVersion
//
- this.CustomLabelAboutVersion.AutoSize = true;
- this.CustomLabelAboutVersion.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelAboutVersion.Border = false;
- this.CustomLabelAboutVersion.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelAboutVersion.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelAboutVersion.ForeColor = System.Drawing.Color.White;
- this.CustomLabelAboutVersion.Location = new System.Drawing.Point(600, 51);
- this.CustomLabelAboutVersion.Name = "CustomLabelAboutVersion";
- this.CustomLabelAboutVersion.RoundedCorners = 0;
- this.CustomLabelAboutVersion.Size = new System.Drawing.Size(47, 17);
- this.CustomLabelAboutVersion.TabIndex = 7;
- this.CustomLabelAboutVersion.Text = "Version";
+ CustomLabelAboutVersion.AutoSize = true;
+ CustomLabelAboutVersion.BackColor = Color.DimGray;
+ CustomLabelAboutVersion.Border = false;
+ CustomLabelAboutVersion.BorderColor = Color.Blue;
+ CustomLabelAboutVersion.FlatStyle = FlatStyle.Flat;
+ CustomLabelAboutVersion.ForeColor = Color.White;
+ CustomLabelAboutVersion.Location = new Point(600, 51);
+ CustomLabelAboutVersion.Name = "CustomLabelAboutVersion";
+ CustomLabelAboutVersion.RoundedCorners = 0;
+ CustomLabelAboutVersion.Size = new Size(45, 15);
+ CustomLabelAboutVersion.TabIndex = 7;
+ CustomLabelAboutVersion.Text = "Version";
//
// PictureBoxFarvahar
//
- this.PictureBoxFarvahar.Image = global::SecureDNSClient.Properties.Resources.FarvaharBlueRed;
- this.PictureBoxFarvahar.Location = new System.Drawing.Point(55, 230);
- this.PictureBoxFarvahar.Name = "PictureBoxFarvahar";
- this.PictureBoxFarvahar.Size = new System.Drawing.Size(128, 60);
- this.PictureBoxFarvahar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
- this.PictureBoxFarvahar.TabIndex = 12;
- this.PictureBoxFarvahar.TabStop = false;
+ PictureBoxFarvahar.Image = Properties.Resources.FarvaharBlueRed;
+ PictureBoxFarvahar.Location = new Point(55, 230);
+ PictureBoxFarvahar.Name = "PictureBoxFarvahar";
+ PictureBoxFarvahar.Size = new Size(128, 60);
+ PictureBoxFarvahar.SizeMode = PictureBoxSizeMode.StretchImage;
+ PictureBoxFarvahar.TabIndex = 12;
+ PictureBoxFarvahar.TabStop = false;
//
// CustomLabelAboutCopyright
//
- this.CustomLabelAboutCopyright.AutoSize = true;
- this.CustomLabelAboutCopyright.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelAboutCopyright.Border = false;
- this.CustomLabelAboutCopyright.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelAboutCopyright.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelAboutCopyright.ForeColor = System.Drawing.Color.White;
- this.CustomLabelAboutCopyright.Location = new System.Drawing.Point(55, 185);
- this.CustomLabelAboutCopyright.Name = "CustomLabelAboutCopyright";
- this.CustomLabelAboutCopyright.RoundedCorners = 0;
- this.CustomLabelAboutCopyright.Size = new System.Drawing.Size(111, 32);
- this.CustomLabelAboutCopyright.TabIndex = 11;
- this.CustomLabelAboutCopyright.Text = "© 2023 MSasanMH\r\nLicense: GPLv3";
+ CustomLabelAboutCopyright.AutoSize = true;
+ CustomLabelAboutCopyright.BackColor = Color.DimGray;
+ CustomLabelAboutCopyright.Border = false;
+ CustomLabelAboutCopyright.BorderColor = Color.Blue;
+ CustomLabelAboutCopyright.FlatStyle = FlatStyle.Flat;
+ CustomLabelAboutCopyright.ForeColor = Color.White;
+ CustomLabelAboutCopyright.Location = new Point(55, 185);
+ CustomLabelAboutCopyright.Name = "CustomLabelAboutCopyright";
+ CustomLabelAboutCopyright.RoundedCorners = 0;
+ CustomLabelAboutCopyright.Size = new Size(109, 30);
+ CustomLabelAboutCopyright.TabIndex = 11;
+ CustomLabelAboutCopyright.Text = "© 2023 MSasanMH\r\nLicense: GPLv3";
//
// LinkLabelStAlidxdydz
//
- this.LinkLabelStAlidxdydz.AutoSize = true;
- this.LinkLabelStAlidxdydz.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
- this.LinkLabelStAlidxdydz.Location = new System.Drawing.Point(461, 174);
- this.LinkLabelStAlidxdydz.Name = "LinkLabelStAlidxdydz";
- this.LinkLabelStAlidxdydz.Size = new System.Drawing.Size(59, 15);
- this.LinkLabelStAlidxdydz.TabIndex = 10;
- this.LinkLabelStAlidxdydz.TabStop = true;
- this.LinkLabelStAlidxdydz.Text = "Alidxdydz";
- this.LinkLabelStAlidxdydz.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelStAlidxdydz_LinkClicked);
+ LinkLabelStAlidxdydz.AutoSize = true;
+ LinkLabelStAlidxdydz.LinkBehavior = LinkBehavior.NeverUnderline;
+ LinkLabelStAlidxdydz.Location = new Point(461, 174);
+ LinkLabelStAlidxdydz.Name = "LinkLabelStAlidxdydz";
+ LinkLabelStAlidxdydz.Size = new Size(59, 15);
+ LinkLabelStAlidxdydz.TabIndex = 10;
+ LinkLabelStAlidxdydz.TabStop = true;
+ LinkLabelStAlidxdydz.Text = "Alidxdydz";
+ LinkLabelStAlidxdydz.LinkClicked += LinkLabelStAlidxdydz_LinkClicked;
//
// CustomLabelAboutSpecialThanks
//
- this.CustomLabelAboutSpecialThanks.AutoSize = true;
- this.CustomLabelAboutSpecialThanks.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelAboutSpecialThanks.Border = false;
- this.CustomLabelAboutSpecialThanks.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelAboutSpecialThanks.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelAboutSpecialThanks.ForeColor = System.Drawing.Color.White;
- this.CustomLabelAboutSpecialThanks.Location = new System.Drawing.Point(446, 135);
- this.CustomLabelAboutSpecialThanks.Name = "CustomLabelAboutSpecialThanks";
- this.CustomLabelAboutSpecialThanks.RoundedCorners = 0;
- this.CustomLabelAboutSpecialThanks.Size = new System.Drawing.Size(83, 77);
- this.CustomLabelAboutSpecialThanks.TabIndex = 9;
- this.CustomLabelAboutSpecialThanks.Text = "special thanks\r\n{\r\n\r\n\r\n}";
+ CustomLabelAboutSpecialThanks.AutoSize = true;
+ CustomLabelAboutSpecialThanks.BackColor = Color.DimGray;
+ CustomLabelAboutSpecialThanks.Border = false;
+ CustomLabelAboutSpecialThanks.BorderColor = Color.Blue;
+ CustomLabelAboutSpecialThanks.FlatStyle = FlatStyle.Flat;
+ CustomLabelAboutSpecialThanks.ForeColor = Color.White;
+ CustomLabelAboutSpecialThanks.Location = new Point(446, 135);
+ CustomLabelAboutSpecialThanks.Name = "CustomLabelAboutSpecialThanks";
+ CustomLabelAboutSpecialThanks.RoundedCorners = 0;
+ CustomLabelAboutSpecialThanks.Size = new Size(81, 75);
+ CustomLabelAboutSpecialThanks.TabIndex = 9;
+ CustomLabelAboutSpecialThanks.Text = "special thanks\r\n{\r\n\r\n\r\n}";
//
// LinkLabelGoodbyeDPI
//
- this.LinkLabelGoodbyeDPI.AutoSize = true;
- this.LinkLabelGoodbyeDPI.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
- this.LinkLabelGoodbyeDPI.Location = new System.Drawing.Point(285, 230);
- this.LinkLabelGoodbyeDPI.Name = "LinkLabelGoodbyeDPI";
- this.LinkLabelGoodbyeDPI.Size = new System.Drawing.Size(76, 15);
- this.LinkLabelGoodbyeDPI.TabIndex = 6;
- this.LinkLabelGoodbyeDPI.TabStop = true;
- this.LinkLabelGoodbyeDPI.Text = "GoodbyeDPI;";
- this.LinkLabelGoodbyeDPI.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelGoodbyeDPI_LinkClicked);
+ LinkLabelGoodbyeDPI.AutoSize = true;
+ LinkLabelGoodbyeDPI.LinkBehavior = LinkBehavior.NeverUnderline;
+ LinkLabelGoodbyeDPI.Location = new Point(285, 230);
+ LinkLabelGoodbyeDPI.Name = "LinkLabelGoodbyeDPI";
+ LinkLabelGoodbyeDPI.Size = new Size(76, 15);
+ LinkLabelGoodbyeDPI.TabIndex = 6;
+ LinkLabelGoodbyeDPI.TabStop = true;
+ LinkLabelGoodbyeDPI.Text = "GoodbyeDPI;";
+ LinkLabelGoodbyeDPI.LinkClicked += LinkLabelGoodbyeDPI_LinkClicked;
//
// LinkLabelDNSCrypt
//
- this.LinkLabelDNSCrypt.AutoSize = true;
- this.LinkLabelDNSCrypt.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
- this.LinkLabelDNSCrypt.Location = new System.Drawing.Point(285, 208);
- this.LinkLabelDNSCrypt.Name = "LinkLabelDNSCrypt";
- this.LinkLabelDNSCrypt.Size = new System.Drawing.Size(62, 15);
- this.LinkLabelDNSCrypt.TabIndex = 5;
- this.LinkLabelDNSCrypt.TabStop = true;
- this.LinkLabelDNSCrypt.Text = "DNSCrypt;";
- this.LinkLabelDNSCrypt.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelDNSCrypt_LinkClicked);
+ LinkLabelDNSCrypt.AutoSize = true;
+ LinkLabelDNSCrypt.LinkBehavior = LinkBehavior.NeverUnderline;
+ LinkLabelDNSCrypt.Location = new Point(285, 208);
+ LinkLabelDNSCrypt.Name = "LinkLabelDNSCrypt";
+ LinkLabelDNSCrypt.Size = new Size(62, 15);
+ LinkLabelDNSCrypt.TabIndex = 5;
+ LinkLabelDNSCrypt.TabStop = true;
+ LinkLabelDNSCrypt.Text = "DNSCrypt;";
+ LinkLabelDNSCrypt.LinkClicked += LinkLabelDNSCrypt_LinkClicked;
//
// LinkLabelDNSProxy
//
- this.LinkLabelDNSProxy.AutoSize = true;
- this.LinkLabelDNSProxy.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
- this.LinkLabelDNSProxy.Location = new System.Drawing.Point(285, 185);
- this.LinkLabelDNSProxy.Name = "LinkLabelDNSProxy";
- this.LinkLabelDNSProxy.Size = new System.Drawing.Size(160, 15);
- this.LinkLabelDNSProxy.TabIndex = 4;
- this.LinkLabelDNSProxy.TabStop = true;
- this.LinkLabelDNSProxy.Text = "DNSProxy by AdGuard Team;";
- this.LinkLabelDNSProxy.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelDNSProxy_LinkClicked);
+ LinkLabelDNSProxy.AutoSize = true;
+ LinkLabelDNSProxy.LinkBehavior = LinkBehavior.NeverUnderline;
+ LinkLabelDNSProxy.Location = new Point(285, 185);
+ LinkLabelDNSProxy.Name = "LinkLabelDNSProxy";
+ LinkLabelDNSProxy.Size = new Size(160, 15);
+ LinkLabelDNSProxy.TabIndex = 4;
+ LinkLabelDNSProxy.TabStop = true;
+ LinkLabelDNSProxy.Text = "DNSProxy by AdGuard Team;";
+ LinkLabelDNSProxy.LinkClicked += LinkLabelDNSProxy_LinkClicked;
//
// LinkLabelDNSLookup
//
- this.LinkLabelDNSLookup.AutoSize = true;
- this.LinkLabelDNSLookup.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
- this.LinkLabelDNSLookup.Location = new System.Drawing.Point(285, 163);
- this.LinkLabelDNSLookup.Name = "LinkLabelDNSLookup";
- this.LinkLabelDNSLookup.Size = new System.Drawing.Size(73, 15);
- this.LinkLabelDNSLookup.TabIndex = 3;
- this.LinkLabelDNSLookup.TabStop = true;
- this.LinkLabelDNSLookup.Text = "DNSLookup;";
- this.LinkLabelDNSLookup.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelDNSLookup_LinkClicked);
+ LinkLabelDNSLookup.AutoSize = true;
+ LinkLabelDNSLookup.LinkBehavior = LinkBehavior.NeverUnderline;
+ LinkLabelDNSLookup.Location = new Point(285, 163);
+ LinkLabelDNSLookup.Name = "LinkLabelDNSLookup";
+ LinkLabelDNSLookup.Size = new Size(73, 15);
+ LinkLabelDNSLookup.TabIndex = 3;
+ LinkLabelDNSLookup.TabStop = true;
+ LinkLabelDNSLookup.Text = "DNSLookup;";
+ LinkLabelDNSLookup.LinkClicked += LinkLabelDNSLookup_LinkClicked;
//
// CustomLabelAboutUsing
//
- this.CustomLabelAboutUsing.AutoSize = true;
- this.CustomLabelAboutUsing.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelAboutUsing.Border = false;
- this.CustomLabelAboutUsing.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelAboutUsing.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelAboutUsing.ForeColor = System.Drawing.Color.White;
- this.CustomLabelAboutUsing.Location = new System.Drawing.Point(270, 135);
- this.CustomLabelAboutUsing.Name = "CustomLabelAboutUsing";
- this.CustomLabelAboutUsing.RoundedCorners = 0;
- this.CustomLabelAboutUsing.Size = new System.Drawing.Size(38, 122);
- this.CustomLabelAboutUsing.TabIndex = 8;
- this.CustomLabelAboutUsing.Text = "using\r\n{\r\n\r\n\r\n\r\n\r\n\r\n}";
+ CustomLabelAboutUsing.AutoSize = true;
+ CustomLabelAboutUsing.BackColor = Color.DimGray;
+ CustomLabelAboutUsing.Border = false;
+ CustomLabelAboutUsing.BorderColor = Color.Blue;
+ CustomLabelAboutUsing.FlatStyle = FlatStyle.Flat;
+ CustomLabelAboutUsing.ForeColor = Color.White;
+ CustomLabelAboutUsing.Location = new Point(270, 135);
+ CustomLabelAboutUsing.Name = "CustomLabelAboutUsing";
+ CustomLabelAboutUsing.RoundedCorners = 0;
+ CustomLabelAboutUsing.Size = new Size(36, 120);
+ CustomLabelAboutUsing.TabIndex = 8;
+ CustomLabelAboutUsing.Text = "using\r\n{\r\n\r\n\r\n\r\n\r\n\r\n}";
//
// CustomLabelAboutThis2
//
- this.CustomLabelAboutThis2.AutoSize = true;
- this.CustomLabelAboutThis2.BackColor = System.Drawing.Color.Transparent;
- this.CustomLabelAboutThis2.Border = false;
- this.CustomLabelAboutThis2.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelAboutThis2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelAboutThis2.ForeColor = System.Drawing.Color.IndianRed;
- this.CustomLabelAboutThis2.Location = new System.Drawing.Point(267, 75);
- this.CustomLabelAboutThis2.Name = "CustomLabelAboutThis2";
- this.CustomLabelAboutThis2.RoundedCorners = 0;
- this.CustomLabelAboutThis2.Size = new System.Drawing.Size(335, 17);
- this.CustomLabelAboutThis2.TabIndex = 2;
- this.CustomLabelAboutThis2.Text = "A GUI for DNSLookup, DNSProxy, DNSCrypt and GoodbyeDPI.";
+ CustomLabelAboutThis2.AutoSize = true;
+ CustomLabelAboutThis2.BackColor = Color.Transparent;
+ CustomLabelAboutThis2.Border = false;
+ CustomLabelAboutThis2.BorderColor = Color.Blue;
+ CustomLabelAboutThis2.FlatStyle = FlatStyle.Flat;
+ CustomLabelAboutThis2.ForeColor = Color.IndianRed;
+ CustomLabelAboutThis2.Location = new Point(267, 75);
+ CustomLabelAboutThis2.Name = "CustomLabelAboutThis2";
+ CustomLabelAboutThis2.RoundedCorners = 0;
+ CustomLabelAboutThis2.Size = new Size(333, 15);
+ CustomLabelAboutThis2.TabIndex = 2;
+ CustomLabelAboutThis2.Text = "A GUI for DNSLookup, DNSProxy, DNSCrypt and GoodbyeDPI.";
//
// CustomLabelAboutThis
//
- this.CustomLabelAboutThis.AutoSize = true;
- this.CustomLabelAboutThis.BackColor = System.Drawing.Color.Transparent;
- this.CustomLabelAboutThis.Border = false;
- this.CustomLabelAboutThis.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelAboutThis.Cursor = System.Windows.Forms.Cursors.Hand;
- this.CustomLabelAboutThis.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelAboutThis.Font = new System.Drawing.Font("Verdana", 19F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
- this.CustomLabelAboutThis.ForeColor = System.Drawing.Color.DodgerBlue;
- this.CustomLabelAboutThis.Location = new System.Drawing.Point(235, 33);
- this.CustomLabelAboutThis.Name = "CustomLabelAboutThis";
- this.CustomLabelAboutThis.RoundedCorners = 0;
- this.CustomLabelAboutThis.Size = new System.Drawing.Size(369, 34);
- this.CustomLabelAboutThis.TabIndex = 1;
- this.CustomLabelAboutThis.Text = "SDC - Secure DNS Client";
- this.CustomLabelAboutThis.Click += new System.EventHandler(this.CustomLabelAboutThis_Click);
+ CustomLabelAboutThis.AutoSize = true;
+ CustomLabelAboutThis.BackColor = Color.Transparent;
+ CustomLabelAboutThis.Border = false;
+ CustomLabelAboutThis.BorderColor = Color.Blue;
+ CustomLabelAboutThis.Cursor = Cursors.Hand;
+ CustomLabelAboutThis.FlatStyle = FlatStyle.Flat;
+ CustomLabelAboutThis.Font = new Font("Verdana", 19F, FontStyle.Bold, GraphicsUnit.Point);
+ CustomLabelAboutThis.ForeColor = Color.DodgerBlue;
+ CustomLabelAboutThis.Location = new Point(235, 33);
+ CustomLabelAboutThis.Name = "CustomLabelAboutThis";
+ CustomLabelAboutThis.RoundedCorners = 0;
+ CustomLabelAboutThis.Size = new Size(367, 32);
+ CustomLabelAboutThis.TabIndex = 1;
+ CustomLabelAboutThis.Text = "SDC - Secure DNS Client";
+ CustomLabelAboutThis.Click += CustomLabelAboutThis_Click;
//
// PictureBoxAbout
//
- this.PictureBoxAbout.Image = global::SecureDNSClient.Properties.Resources.SecureDNSClient;
- this.PictureBoxAbout.Location = new System.Drawing.Point(55, 35);
- this.PictureBoxAbout.Name = "PictureBoxAbout";
- this.PictureBoxAbout.Size = new System.Drawing.Size(128, 128);
- this.PictureBoxAbout.TabIndex = 0;
- this.PictureBoxAbout.TabStop = false;
+ PictureBoxAbout.Image = Properties.Resources.SecureDNSClient_PNG;
+ PictureBoxAbout.Location = new Point(55, 35);
+ PictureBoxAbout.Name = "PictureBoxAbout";
+ PictureBoxAbout.Size = new Size(128, 128);
+ PictureBoxAbout.TabIndex = 0;
+ PictureBoxAbout.TabStop = false;
//
// CustomButtonToggleLogView
//
- this.CustomButtonToggleLogView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomButtonToggleLogView.AutoSize = true;
- this.CustomButtonToggleLogView.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonToggleLogView.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonToggleLogView.Location = new System.Drawing.Point(144, 362);
- this.CustomButtonToggleLogView.Name = "CustomButtonToggleLogView";
- this.CustomButtonToggleLogView.RoundedCorners = 5;
- this.CustomButtonToggleLogView.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonToggleLogView.Size = new System.Drawing.Size(25, 27);
- this.CustomButtonToggleLogView.TabIndex = 10;
- this.CustomButtonToggleLogView.Text = "T";
- this.CustomButtonToggleLogView.UseVisualStyleBackColor = true;
- this.CustomButtonToggleLogView.Click += new System.EventHandler(this.CustomButtonToggleLogView_Click);
+ CustomButtonToggleLogView.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ CustomButtonToggleLogView.BorderColor = Color.Blue;
+ CustomButtonToggleLogView.FlatStyle = FlatStyle.Flat;
+ CustomButtonToggleLogView.Location = new Point(148, 366);
+ CustomButtonToggleLogView.Name = "CustomButtonToggleLogView";
+ CustomButtonToggleLogView.RoundedCorners = 5;
+ CustomButtonToggleLogView.SelectionColor = Color.LightBlue;
+ CustomButtonToggleLogView.Size = new Size(25, 27);
+ CustomButtonToggleLogView.TabIndex = 10;
+ CustomButtonToggleLogView.Text = "T";
+ CustomButtonToggleLogView.UseVisualStyleBackColor = true;
+ CustomButtonToggleLogView.Click += CustomButtonToggleLogView_Click;
//
// NotifyIconMain
//
- this.NotifyIconMain.ContextMenuStrip = this.CustomContextMenuStripIcon;
- this.NotifyIconMain.Icon = ((System.Drawing.Icon)(resources.GetObject("NotifyIconMain.Icon")));
- this.NotifyIconMain.Visible = true;
- this.NotifyIconMain.MouseClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIconMain_MouseClick);
+ NotifyIconMain.ContextMenuStrip = CustomContextMenuStripIcon;
+ NotifyIconMain.Icon = (Icon)resources.GetObject("NotifyIconMain.Icon");
+ NotifyIconMain.Visible = true;
+ NotifyIconMain.MouseClick += NotifyIconMain_MouseClick;
//
// CustomContextMenuStripIcon
//
- this.CustomContextMenuStripIcon.BackColor = System.Drawing.Color.DimGray;
- this.CustomContextMenuStripIcon.BorderColor = System.Drawing.Color.Blue;
- this.CustomContextMenuStripIcon.ForeColor = System.Drawing.Color.White;
- this.CustomContextMenuStripIcon.ImageScalingSize = new System.Drawing.Size(20, 20);
- this.CustomContextMenuStripIcon.Name = "CustomContextMenuStripIcon";
- this.CustomContextMenuStripIcon.SameColorForSubItems = true;
- this.CustomContextMenuStripIcon.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomContextMenuStripIcon.Size = new System.Drawing.Size(61, 4);
+ CustomContextMenuStripIcon.BackColor = Color.DimGray;
+ CustomContextMenuStripIcon.BorderColor = Color.Blue;
+ CustomContextMenuStripIcon.ForeColor = Color.White;
+ CustomContextMenuStripIcon.ImageScalingSize = new Size(20, 20);
+ CustomContextMenuStripIcon.Name = "CustomContextMenuStripIcon";
+ CustomContextMenuStripIcon.SameColorForSubItems = true;
+ CustomContextMenuStripIcon.SelectionColor = Color.LightBlue;
+ CustomContextMenuStripIcon.Size = new Size(61, 4);
//
// CustomGroupBoxStatus
//
- this.CustomGroupBoxStatus.BorderColor = System.Drawing.Color.Blue;
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusCpuUsage);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusGoodbyeDPI);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusProxyRequests);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusLocalDoHLatency);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomButtonToggleLogView);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusLocalDoH);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusLocalDnsLatency);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusLocalDNS);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusIsProxySet);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusIsSharing);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusIsDNSSet);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusProxyDpiBypass);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusIsConnected);
- this.CustomGroupBoxStatus.Controls.Add(this.CustomRichTextBoxStatusWorkingServers);
- this.CustomGroupBoxStatus.Dock = System.Windows.Forms.DockStyle.Fill;
- this.CustomGroupBoxStatus.Location = new System.Drawing.Point(0, 0);
- this.CustomGroupBoxStatus.Margin = new System.Windows.Forms.Padding(1);
- this.CustomGroupBoxStatus.Name = "CustomGroupBoxStatus";
- this.CustomGroupBoxStatus.Size = new System.Drawing.Size(180, 400);
- this.CustomGroupBoxStatus.TabIndex = 8;
- this.CustomGroupBoxStatus.TabStop = false;
- this.CustomGroupBoxStatus.Text = "Status";
+ CustomGroupBoxStatus.BorderColor = Color.Blue;
+ CustomGroupBoxStatus.Controls.Add(CustomButtonProcessMonitor);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusCpuUsage);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusGoodbyeDPI);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusProxyRequests);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusLocalDoHLatency);
+ CustomGroupBoxStatus.Controls.Add(CustomButtonToggleLogView);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusLocalDoH);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusLocalDnsLatency);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusLocalDNS);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusIsProxySet);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusIsSharing);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusIsDNSSet);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusProxyDpiBypass);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusIsConnected);
+ CustomGroupBoxStatus.Controls.Add(CustomRichTextBoxStatusWorkingServers);
+ CustomGroupBoxStatus.Dock = DockStyle.Fill;
+ CustomGroupBoxStatus.Location = new Point(0, 0);
+ CustomGroupBoxStatus.Margin = new Padding(1);
+ CustomGroupBoxStatus.Name = "CustomGroupBoxStatus";
+ CustomGroupBoxStatus.Size = new Size(180, 400);
+ CustomGroupBoxStatus.TabIndex = 8;
+ CustomGroupBoxStatus.TabStop = false;
+ CustomGroupBoxStatus.Text = "Status";
+ //
+ // CustomButtonProcessMonitor
+ //
+ CustomButtonProcessMonitor.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomButtonProcessMonitor.BorderColor = Color.Blue;
+ CustomButtonProcessMonitor.FlatStyle = FlatStyle.Flat;
+ CustomButtonProcessMonitor.Location = new Point(7, 366);
+ CustomButtonProcessMonitor.Name = "CustomButtonProcessMonitor";
+ CustomButtonProcessMonitor.RoundedCorners = 5;
+ CustomButtonProcessMonitor.SelectionColor = Color.LightBlue;
+ CustomButtonProcessMonitor.Size = new Size(62, 27);
+ CustomButtonProcessMonitor.TabIndex = 20;
+ CustomButtonProcessMonitor.Text = "Net Info";
+ CustomButtonProcessMonitor.UseVisualStyleBackColor = true;
+ CustomButtonProcessMonitor.Click += CustomButtonProcessMonitor_Click;
//
// CustomRichTextBoxStatusCpuUsage
//
- this.CustomRichTextBoxStatusCpuUsage.AcceptsTab = false;
- this.CustomRichTextBoxStatusCpuUsage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomRichTextBoxStatusCpuUsage.AutoWordSelection = false;
- this.CustomRichTextBoxStatusCpuUsage.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusCpuUsage.Border = false;
- this.CustomRichTextBoxStatusCpuUsage.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusCpuUsage.BorderSize = 1;
- this.CustomRichTextBoxStatusCpuUsage.BulletIndent = 0;
- this.CustomRichTextBoxStatusCpuUsage.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusCpuUsage.DetectUrls = true;
- this.CustomRichTextBoxStatusCpuUsage.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusCpuUsage.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusCpuUsage.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusCpuUsage.HideSelection = true;
- this.CustomRichTextBoxStatusCpuUsage.Location = new System.Drawing.Point(5, 365);
- this.CustomRichTextBoxStatusCpuUsage.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusCpuUsage.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusCpuUsage.Multiline = false;
- this.CustomRichTextBoxStatusCpuUsage.Name = "CustomRichTextBoxStatusCpuUsage";
- this.CustomRichTextBoxStatusCpuUsage.ReadOnly = true;
- this.CustomRichTextBoxStatusCpuUsage.RightMargin = 0;
- this.CustomRichTextBoxStatusCpuUsage.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusCpuUsage.ScrollToBottom = false;
- this.CustomRichTextBoxStatusCpuUsage.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusCpuUsage.SelectionLength = 0;
- this.CustomRichTextBoxStatusCpuUsage.SelectionStart = 0;
- this.CustomRichTextBoxStatusCpuUsage.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusCpuUsage.Size = new System.Drawing.Size(100, 23);
- this.CustomRichTextBoxStatusCpuUsage.TabIndex = 0;
- this.CustomRichTextBoxStatusCpuUsage.Texts = "CPU: -1";
- this.CustomRichTextBoxStatusCpuUsage.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusCpuUsage.WordWrap = false;
- this.CustomRichTextBoxStatusCpuUsage.ZoomFactor = 1F;
+ CustomRichTextBoxStatusCpuUsage.AcceptsTab = false;
+ CustomRichTextBoxStatusCpuUsage.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomRichTextBoxStatusCpuUsage.AutoWordSelection = false;
+ CustomRichTextBoxStatusCpuUsage.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusCpuUsage.Border = false;
+ CustomRichTextBoxStatusCpuUsage.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusCpuUsage.BorderSize = 1;
+ CustomRichTextBoxStatusCpuUsage.BulletIndent = 0;
+ CustomRichTextBoxStatusCpuUsage.DetectUrls = true;
+ CustomRichTextBoxStatusCpuUsage.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusCpuUsage.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusCpuUsage.ForeColor = Color.White;
+ CustomRichTextBoxStatusCpuUsage.HideSelection = true;
+ CustomRichTextBoxStatusCpuUsage.Location = new Point(5, 325);
+ CustomRichTextBoxStatusCpuUsage.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusCpuUsage.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusCpuUsage.Multiline = false;
+ CustomRichTextBoxStatusCpuUsage.Name = "CustomRichTextBoxStatusCpuUsage";
+ CustomRichTextBoxStatusCpuUsage.ReadOnly = true;
+ CustomRichTextBoxStatusCpuUsage.RightMargin = 0;
+ CustomRichTextBoxStatusCpuUsage.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusCpuUsage.ScrollToBottom = false;
+ CustomRichTextBoxStatusCpuUsage.SelectionColor = Color.White;
+ CustomRichTextBoxStatusCpuUsage.SelectionLength = 0;
+ CustomRichTextBoxStatusCpuUsage.SelectionStart = 0;
+ CustomRichTextBoxStatusCpuUsage.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusCpuUsage.Size = new Size(100, 23);
+ CustomRichTextBoxStatusCpuUsage.TabIndex = 0;
+ CustomRichTextBoxStatusCpuUsage.Texts = "CPU: -1";
+ CustomRichTextBoxStatusCpuUsage.UnderlinedStyle = false;
+ CustomRichTextBoxStatusCpuUsage.WordWrap = false;
+ CustomRichTextBoxStatusCpuUsage.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusGoodbyeDPI
//
- this.CustomRichTextBoxStatusGoodbyeDPI.AcceptsTab = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.AutoWordSelection = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusGoodbyeDPI.Border = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusGoodbyeDPI.BorderSize = 1;
- this.CustomRichTextBoxStatusGoodbyeDPI.BulletIndent = 0;
- this.CustomRichTextBoxStatusGoodbyeDPI.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusGoodbyeDPI.DetectUrls = true;
- this.CustomRichTextBoxStatusGoodbyeDPI.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusGoodbyeDPI.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusGoodbyeDPI.HideSelection = true;
- this.CustomRichTextBoxStatusGoodbyeDPI.Location = new System.Drawing.Point(5, 290);
- this.CustomRichTextBoxStatusGoodbyeDPI.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusGoodbyeDPI.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusGoodbyeDPI.Multiline = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.Name = "CustomRichTextBoxStatusGoodbyeDPI";
- this.CustomRichTextBoxStatusGoodbyeDPI.ReadOnly = true;
- this.CustomRichTextBoxStatusGoodbyeDPI.RightMargin = 0;
- this.CustomRichTextBoxStatusGoodbyeDPI.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusGoodbyeDPI.ScrollToBottom = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusGoodbyeDPI.SelectionLength = 0;
- this.CustomRichTextBoxStatusGoodbyeDPI.SelectionStart = 0;
- this.CustomRichTextBoxStatusGoodbyeDPI.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusGoodbyeDPI.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusGoodbyeDPI.TabIndex = 0;
- this.CustomRichTextBoxStatusGoodbyeDPI.Texts = "GoodbyeDPI: Inactive";
- this.CustomRichTextBoxStatusGoodbyeDPI.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.WordWrap = false;
- this.CustomRichTextBoxStatusGoodbyeDPI.ZoomFactor = 1F;
+ CustomRichTextBoxStatusGoodbyeDPI.AcceptsTab = false;
+ CustomRichTextBoxStatusGoodbyeDPI.AutoWordSelection = false;
+ CustomRichTextBoxStatusGoodbyeDPI.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusGoodbyeDPI.Border = false;
+ CustomRichTextBoxStatusGoodbyeDPI.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusGoodbyeDPI.BorderSize = 1;
+ CustomRichTextBoxStatusGoodbyeDPI.BulletIndent = 0;
+ CustomRichTextBoxStatusGoodbyeDPI.DetectUrls = true;
+ CustomRichTextBoxStatusGoodbyeDPI.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusGoodbyeDPI.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusGoodbyeDPI.ForeColor = Color.White;
+ CustomRichTextBoxStatusGoodbyeDPI.HideSelection = true;
+ CustomRichTextBoxStatusGoodbyeDPI.Location = new Point(5, 290);
+ CustomRichTextBoxStatusGoodbyeDPI.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusGoodbyeDPI.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusGoodbyeDPI.Multiline = false;
+ CustomRichTextBoxStatusGoodbyeDPI.Name = "CustomRichTextBoxStatusGoodbyeDPI";
+ CustomRichTextBoxStatusGoodbyeDPI.ReadOnly = true;
+ CustomRichTextBoxStatusGoodbyeDPI.RightMargin = 0;
+ CustomRichTextBoxStatusGoodbyeDPI.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusGoodbyeDPI.ScrollToBottom = false;
+ CustomRichTextBoxStatusGoodbyeDPI.SelectionColor = Color.White;
+ CustomRichTextBoxStatusGoodbyeDPI.SelectionLength = 0;
+ CustomRichTextBoxStatusGoodbyeDPI.SelectionStart = 0;
+ CustomRichTextBoxStatusGoodbyeDPI.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusGoodbyeDPI.Size = new Size(170, 23);
+ CustomRichTextBoxStatusGoodbyeDPI.TabIndex = 0;
+ CustomRichTextBoxStatusGoodbyeDPI.Texts = "GoodbyeDPI: Inactive";
+ CustomRichTextBoxStatusGoodbyeDPI.UnderlinedStyle = false;
+ CustomRichTextBoxStatusGoodbyeDPI.WordWrap = false;
+ CustomRichTextBoxStatusGoodbyeDPI.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusProxyRequests
//
- this.CustomRichTextBoxStatusProxyRequests.AcceptsTab = false;
- this.CustomRichTextBoxStatusProxyRequests.AutoWordSelection = false;
- this.CustomRichTextBoxStatusProxyRequests.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusProxyRequests.Border = false;
- this.CustomRichTextBoxStatusProxyRequests.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusProxyRequests.BorderSize = 1;
- this.CustomRichTextBoxStatusProxyRequests.BulletIndent = 0;
- this.CustomRichTextBoxStatusProxyRequests.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusProxyRequests.DetectUrls = true;
- this.CustomRichTextBoxStatusProxyRequests.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusProxyRequests.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusProxyRequests.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusProxyRequests.HideSelection = true;
- this.CustomRichTextBoxStatusProxyRequests.Location = new System.Drawing.Point(5, 215);
- this.CustomRichTextBoxStatusProxyRequests.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusProxyRequests.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusProxyRequests.Multiline = false;
- this.CustomRichTextBoxStatusProxyRequests.Name = "CustomRichTextBoxStatusProxyRequests";
- this.CustomRichTextBoxStatusProxyRequests.ReadOnly = true;
- this.CustomRichTextBoxStatusProxyRequests.RightMargin = 0;
- this.CustomRichTextBoxStatusProxyRequests.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusProxyRequests.ScrollToBottom = false;
- this.CustomRichTextBoxStatusProxyRequests.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusProxyRequests.SelectionLength = 0;
- this.CustomRichTextBoxStatusProxyRequests.SelectionStart = 0;
- this.CustomRichTextBoxStatusProxyRequests.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusProxyRequests.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusProxyRequests.TabIndex = 0;
- this.CustomRichTextBoxStatusProxyRequests.Texts = "Proxy Requests 20000 of 20000";
- this.CustomRichTextBoxStatusProxyRequests.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusProxyRequests.WordWrap = false;
- this.CustomRichTextBoxStatusProxyRequests.ZoomFactor = 1F;
+ CustomRichTextBoxStatusProxyRequests.AcceptsTab = false;
+ CustomRichTextBoxStatusProxyRequests.AutoWordSelection = false;
+ CustomRichTextBoxStatusProxyRequests.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusProxyRequests.Border = false;
+ CustomRichTextBoxStatusProxyRequests.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusProxyRequests.BorderSize = 1;
+ CustomRichTextBoxStatusProxyRequests.BulletIndent = 0;
+ CustomRichTextBoxStatusProxyRequests.DetectUrls = true;
+ CustomRichTextBoxStatusProxyRequests.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusProxyRequests.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusProxyRequests.ForeColor = Color.White;
+ CustomRichTextBoxStatusProxyRequests.HideSelection = true;
+ CustomRichTextBoxStatusProxyRequests.Location = new Point(5, 215);
+ CustomRichTextBoxStatusProxyRequests.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusProxyRequests.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusProxyRequests.Multiline = false;
+ CustomRichTextBoxStatusProxyRequests.Name = "CustomRichTextBoxStatusProxyRequests";
+ CustomRichTextBoxStatusProxyRequests.ReadOnly = true;
+ CustomRichTextBoxStatusProxyRequests.RightMargin = 0;
+ CustomRichTextBoxStatusProxyRequests.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusProxyRequests.ScrollToBottom = false;
+ CustomRichTextBoxStatusProxyRequests.SelectionColor = Color.White;
+ CustomRichTextBoxStatusProxyRequests.SelectionLength = 0;
+ CustomRichTextBoxStatusProxyRequests.SelectionStart = 0;
+ CustomRichTextBoxStatusProxyRequests.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusProxyRequests.Size = new Size(170, 23);
+ CustomRichTextBoxStatusProxyRequests.TabIndex = 0;
+ CustomRichTextBoxStatusProxyRequests.Texts = "Proxy Requests 20000 of 20000";
+ CustomRichTextBoxStatusProxyRequests.UnderlinedStyle = false;
+ CustomRichTextBoxStatusProxyRequests.WordWrap = false;
+ CustomRichTextBoxStatusProxyRequests.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusLocalDoHLatency
//
- this.CustomRichTextBoxStatusLocalDoHLatency.AcceptsTab = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.AutoWordSelection = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusLocalDoHLatency.Border = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusLocalDoHLatency.BorderSize = 1;
- this.CustomRichTextBoxStatusLocalDoHLatency.BulletIndent = 0;
- this.CustomRichTextBoxStatusLocalDoHLatency.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusLocalDoHLatency.DetectUrls = true;
- this.CustomRichTextBoxStatusLocalDoHLatency.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusLocalDoHLatency.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDoHLatency.HideSelection = true;
- this.CustomRichTextBoxStatusLocalDoHLatency.Location = new System.Drawing.Point(5, 140);
- this.CustomRichTextBoxStatusLocalDoHLatency.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusLocalDoHLatency.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusLocalDoHLatency.Multiline = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.Name = "CustomRichTextBoxStatusLocalDoHLatency";
- this.CustomRichTextBoxStatusLocalDoHLatency.ReadOnly = true;
- this.CustomRichTextBoxStatusLocalDoHLatency.RightMargin = 0;
- this.CustomRichTextBoxStatusLocalDoHLatency.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusLocalDoHLatency.ScrollToBottom = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDoHLatency.SelectionLength = 0;
- this.CustomRichTextBoxStatusLocalDoHLatency.SelectionStart = 0;
- this.CustomRichTextBoxStatusLocalDoHLatency.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusLocalDoHLatency.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusLocalDoHLatency.TabIndex = 0;
- this.CustomRichTextBoxStatusLocalDoHLatency.Texts = "Local DoH Latency: -1";
- this.CustomRichTextBoxStatusLocalDoHLatency.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.WordWrap = false;
- this.CustomRichTextBoxStatusLocalDoHLatency.ZoomFactor = 1F;
+ CustomRichTextBoxStatusLocalDoHLatency.AcceptsTab = false;
+ CustomRichTextBoxStatusLocalDoHLatency.AutoWordSelection = false;
+ CustomRichTextBoxStatusLocalDoHLatency.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusLocalDoHLatency.Border = false;
+ CustomRichTextBoxStatusLocalDoHLatency.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusLocalDoHLatency.BorderSize = 1;
+ CustomRichTextBoxStatusLocalDoHLatency.BulletIndent = 0;
+ CustomRichTextBoxStatusLocalDoHLatency.DetectUrls = true;
+ CustomRichTextBoxStatusLocalDoHLatency.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusLocalDoHLatency.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusLocalDoHLatency.ForeColor = Color.White;
+ CustomRichTextBoxStatusLocalDoHLatency.HideSelection = true;
+ CustomRichTextBoxStatusLocalDoHLatency.Location = new Point(5, 140);
+ CustomRichTextBoxStatusLocalDoHLatency.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusLocalDoHLatency.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusLocalDoHLatency.Multiline = false;
+ CustomRichTextBoxStatusLocalDoHLatency.Name = "CustomRichTextBoxStatusLocalDoHLatency";
+ CustomRichTextBoxStatusLocalDoHLatency.ReadOnly = true;
+ CustomRichTextBoxStatusLocalDoHLatency.RightMargin = 0;
+ CustomRichTextBoxStatusLocalDoHLatency.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusLocalDoHLatency.ScrollToBottom = false;
+ CustomRichTextBoxStatusLocalDoHLatency.SelectionColor = Color.White;
+ CustomRichTextBoxStatusLocalDoHLatency.SelectionLength = 0;
+ CustomRichTextBoxStatusLocalDoHLatency.SelectionStart = 0;
+ CustomRichTextBoxStatusLocalDoHLatency.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusLocalDoHLatency.Size = new Size(170, 23);
+ CustomRichTextBoxStatusLocalDoHLatency.TabIndex = 0;
+ CustomRichTextBoxStatusLocalDoHLatency.Texts = "Local DoH Latency: -1";
+ CustomRichTextBoxStatusLocalDoHLatency.UnderlinedStyle = false;
+ CustomRichTextBoxStatusLocalDoHLatency.WordWrap = false;
+ CustomRichTextBoxStatusLocalDoHLatency.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusLocalDoH
//
- this.CustomRichTextBoxStatusLocalDoH.AcceptsTab = false;
- this.CustomRichTextBoxStatusLocalDoH.AutoWordSelection = false;
- this.CustomRichTextBoxStatusLocalDoH.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusLocalDoH.Border = false;
- this.CustomRichTextBoxStatusLocalDoH.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusLocalDoH.BorderSize = 1;
- this.CustomRichTextBoxStatusLocalDoH.BulletIndent = 0;
- this.CustomRichTextBoxStatusLocalDoH.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusLocalDoH.DetectUrls = true;
- this.CustomRichTextBoxStatusLocalDoH.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusLocalDoH.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusLocalDoH.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDoH.HideSelection = true;
- this.CustomRichTextBoxStatusLocalDoH.Location = new System.Drawing.Point(5, 115);
- this.CustomRichTextBoxStatusLocalDoH.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusLocalDoH.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusLocalDoH.Multiline = false;
- this.CustomRichTextBoxStatusLocalDoH.Name = "CustomRichTextBoxStatusLocalDoH";
- this.CustomRichTextBoxStatusLocalDoH.ReadOnly = true;
- this.CustomRichTextBoxStatusLocalDoH.RightMargin = 0;
- this.CustomRichTextBoxStatusLocalDoH.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusLocalDoH.ScrollToBottom = false;
- this.CustomRichTextBoxStatusLocalDoH.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDoH.SelectionLength = 0;
- this.CustomRichTextBoxStatusLocalDoH.SelectionStart = 0;
- this.CustomRichTextBoxStatusLocalDoH.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusLocalDoH.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusLocalDoH.TabIndex = 0;
- this.CustomRichTextBoxStatusLocalDoH.Texts = "Local DoH: Offline";
- this.CustomRichTextBoxStatusLocalDoH.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusLocalDoH.WordWrap = false;
- this.CustomRichTextBoxStatusLocalDoH.ZoomFactor = 1F;
+ CustomRichTextBoxStatusLocalDoH.AcceptsTab = false;
+ CustomRichTextBoxStatusLocalDoH.AutoWordSelection = false;
+ CustomRichTextBoxStatusLocalDoH.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusLocalDoH.Border = false;
+ CustomRichTextBoxStatusLocalDoH.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusLocalDoH.BorderSize = 1;
+ CustomRichTextBoxStatusLocalDoH.BulletIndent = 0;
+ CustomRichTextBoxStatusLocalDoH.DetectUrls = true;
+ CustomRichTextBoxStatusLocalDoH.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusLocalDoH.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusLocalDoH.ForeColor = Color.White;
+ CustomRichTextBoxStatusLocalDoH.HideSelection = true;
+ CustomRichTextBoxStatusLocalDoH.Location = new Point(5, 115);
+ CustomRichTextBoxStatusLocalDoH.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusLocalDoH.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusLocalDoH.Multiline = false;
+ CustomRichTextBoxStatusLocalDoH.Name = "CustomRichTextBoxStatusLocalDoH";
+ CustomRichTextBoxStatusLocalDoH.ReadOnly = true;
+ CustomRichTextBoxStatusLocalDoH.RightMargin = 0;
+ CustomRichTextBoxStatusLocalDoH.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusLocalDoH.ScrollToBottom = false;
+ CustomRichTextBoxStatusLocalDoH.SelectionColor = Color.White;
+ CustomRichTextBoxStatusLocalDoH.SelectionLength = 0;
+ CustomRichTextBoxStatusLocalDoH.SelectionStart = 0;
+ CustomRichTextBoxStatusLocalDoH.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusLocalDoH.Size = new Size(170, 23);
+ CustomRichTextBoxStatusLocalDoH.TabIndex = 0;
+ CustomRichTextBoxStatusLocalDoH.Texts = "Local DoH: Offline";
+ CustomRichTextBoxStatusLocalDoH.UnderlinedStyle = false;
+ CustomRichTextBoxStatusLocalDoH.WordWrap = false;
+ CustomRichTextBoxStatusLocalDoH.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusLocalDnsLatency
//
- this.CustomRichTextBoxStatusLocalDnsLatency.AcceptsTab = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.AutoWordSelection = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusLocalDnsLatency.Border = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusLocalDnsLatency.BorderSize = 1;
- this.CustomRichTextBoxStatusLocalDnsLatency.BulletIndent = 0;
- this.CustomRichTextBoxStatusLocalDnsLatency.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusLocalDnsLatency.DetectUrls = true;
- this.CustomRichTextBoxStatusLocalDnsLatency.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusLocalDnsLatency.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDnsLatency.HideSelection = true;
- this.CustomRichTextBoxStatusLocalDnsLatency.Location = new System.Drawing.Point(5, 90);
- this.CustomRichTextBoxStatusLocalDnsLatency.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusLocalDnsLatency.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusLocalDnsLatency.Multiline = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.Name = "CustomRichTextBoxStatusLocalDnsLatency";
- this.CustomRichTextBoxStatusLocalDnsLatency.ReadOnly = true;
- this.CustomRichTextBoxStatusLocalDnsLatency.RightMargin = 0;
- this.CustomRichTextBoxStatusLocalDnsLatency.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusLocalDnsLatency.ScrollToBottom = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDnsLatency.SelectionLength = 0;
- this.CustomRichTextBoxStatusLocalDnsLatency.SelectionStart = 0;
- this.CustomRichTextBoxStatusLocalDnsLatency.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusLocalDnsLatency.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusLocalDnsLatency.TabIndex = 0;
- this.CustomRichTextBoxStatusLocalDnsLatency.Texts = "Local DNS Latency: -1";
- this.CustomRichTextBoxStatusLocalDnsLatency.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.WordWrap = false;
- this.CustomRichTextBoxStatusLocalDnsLatency.ZoomFactor = 1F;
+ CustomRichTextBoxStatusLocalDnsLatency.AcceptsTab = false;
+ CustomRichTextBoxStatusLocalDnsLatency.AutoWordSelection = false;
+ CustomRichTextBoxStatusLocalDnsLatency.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusLocalDnsLatency.Border = false;
+ CustomRichTextBoxStatusLocalDnsLatency.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusLocalDnsLatency.BorderSize = 1;
+ CustomRichTextBoxStatusLocalDnsLatency.BulletIndent = 0;
+ CustomRichTextBoxStatusLocalDnsLatency.DetectUrls = true;
+ CustomRichTextBoxStatusLocalDnsLatency.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusLocalDnsLatency.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusLocalDnsLatency.ForeColor = Color.White;
+ CustomRichTextBoxStatusLocalDnsLatency.HideSelection = true;
+ CustomRichTextBoxStatusLocalDnsLatency.Location = new Point(5, 90);
+ CustomRichTextBoxStatusLocalDnsLatency.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusLocalDnsLatency.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusLocalDnsLatency.Multiline = false;
+ CustomRichTextBoxStatusLocalDnsLatency.Name = "CustomRichTextBoxStatusLocalDnsLatency";
+ CustomRichTextBoxStatusLocalDnsLatency.ReadOnly = true;
+ CustomRichTextBoxStatusLocalDnsLatency.RightMargin = 0;
+ CustomRichTextBoxStatusLocalDnsLatency.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusLocalDnsLatency.ScrollToBottom = false;
+ CustomRichTextBoxStatusLocalDnsLatency.SelectionColor = Color.White;
+ CustomRichTextBoxStatusLocalDnsLatency.SelectionLength = 0;
+ CustomRichTextBoxStatusLocalDnsLatency.SelectionStart = 0;
+ CustomRichTextBoxStatusLocalDnsLatency.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusLocalDnsLatency.Size = new Size(170, 23);
+ CustomRichTextBoxStatusLocalDnsLatency.TabIndex = 0;
+ CustomRichTextBoxStatusLocalDnsLatency.Texts = "Local DNS Latency: -1";
+ CustomRichTextBoxStatusLocalDnsLatency.UnderlinedStyle = false;
+ CustomRichTextBoxStatusLocalDnsLatency.WordWrap = false;
+ CustomRichTextBoxStatusLocalDnsLatency.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusLocalDNS
//
- this.CustomRichTextBoxStatusLocalDNS.AcceptsTab = false;
- this.CustomRichTextBoxStatusLocalDNS.AutoWordSelection = false;
- this.CustomRichTextBoxStatusLocalDNS.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusLocalDNS.Border = false;
- this.CustomRichTextBoxStatusLocalDNS.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusLocalDNS.BorderSize = 1;
- this.CustomRichTextBoxStatusLocalDNS.BulletIndent = 0;
- this.CustomRichTextBoxStatusLocalDNS.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusLocalDNS.DetectUrls = true;
- this.CustomRichTextBoxStatusLocalDNS.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusLocalDNS.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusLocalDNS.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDNS.HideSelection = true;
- this.CustomRichTextBoxStatusLocalDNS.Location = new System.Drawing.Point(5, 65);
- this.CustomRichTextBoxStatusLocalDNS.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusLocalDNS.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusLocalDNS.Multiline = false;
- this.CustomRichTextBoxStatusLocalDNS.Name = "CustomRichTextBoxStatusLocalDNS";
- this.CustomRichTextBoxStatusLocalDNS.ReadOnly = true;
- this.CustomRichTextBoxStatusLocalDNS.RightMargin = 0;
- this.CustomRichTextBoxStatusLocalDNS.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusLocalDNS.ScrollToBottom = false;
- this.CustomRichTextBoxStatusLocalDNS.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusLocalDNS.SelectionLength = 0;
- this.CustomRichTextBoxStatusLocalDNS.SelectionStart = 0;
- this.CustomRichTextBoxStatusLocalDNS.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusLocalDNS.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusLocalDNS.TabIndex = 0;
- this.CustomRichTextBoxStatusLocalDNS.Texts = "Local DNS: Offline";
- this.CustomRichTextBoxStatusLocalDNS.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusLocalDNS.WordWrap = false;
- this.CustomRichTextBoxStatusLocalDNS.ZoomFactor = 1F;
+ CustomRichTextBoxStatusLocalDNS.AcceptsTab = false;
+ CustomRichTextBoxStatusLocalDNS.AutoWordSelection = false;
+ CustomRichTextBoxStatusLocalDNS.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusLocalDNS.Border = false;
+ CustomRichTextBoxStatusLocalDNS.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusLocalDNS.BorderSize = 1;
+ CustomRichTextBoxStatusLocalDNS.BulletIndent = 0;
+ CustomRichTextBoxStatusLocalDNS.DetectUrls = true;
+ CustomRichTextBoxStatusLocalDNS.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusLocalDNS.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusLocalDNS.ForeColor = Color.White;
+ CustomRichTextBoxStatusLocalDNS.HideSelection = true;
+ CustomRichTextBoxStatusLocalDNS.Location = new Point(5, 65);
+ CustomRichTextBoxStatusLocalDNS.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusLocalDNS.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusLocalDNS.Multiline = false;
+ CustomRichTextBoxStatusLocalDNS.Name = "CustomRichTextBoxStatusLocalDNS";
+ CustomRichTextBoxStatusLocalDNS.ReadOnly = true;
+ CustomRichTextBoxStatusLocalDNS.RightMargin = 0;
+ CustomRichTextBoxStatusLocalDNS.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusLocalDNS.ScrollToBottom = false;
+ CustomRichTextBoxStatusLocalDNS.SelectionColor = Color.White;
+ CustomRichTextBoxStatusLocalDNS.SelectionLength = 0;
+ CustomRichTextBoxStatusLocalDNS.SelectionStart = 0;
+ CustomRichTextBoxStatusLocalDNS.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusLocalDNS.Size = new Size(170, 23);
+ CustomRichTextBoxStatusLocalDNS.TabIndex = 0;
+ CustomRichTextBoxStatusLocalDNS.Texts = "Local DNS: Offline";
+ CustomRichTextBoxStatusLocalDNS.UnderlinedStyle = false;
+ CustomRichTextBoxStatusLocalDNS.WordWrap = false;
+ CustomRichTextBoxStatusLocalDNS.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusIsProxySet
//
- this.CustomRichTextBoxStatusIsProxySet.AcceptsTab = false;
- this.CustomRichTextBoxStatusIsProxySet.AutoWordSelection = false;
- this.CustomRichTextBoxStatusIsProxySet.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusIsProxySet.Border = false;
- this.CustomRichTextBoxStatusIsProxySet.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusIsProxySet.BorderSize = 1;
- this.CustomRichTextBoxStatusIsProxySet.BulletIndent = 0;
- this.CustomRichTextBoxStatusIsProxySet.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusIsProxySet.DetectUrls = true;
- this.CustomRichTextBoxStatusIsProxySet.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusIsProxySet.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusIsProxySet.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsProxySet.HideSelection = true;
- this.CustomRichTextBoxStatusIsProxySet.Location = new System.Drawing.Point(5, 240);
- this.CustomRichTextBoxStatusIsProxySet.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusIsProxySet.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusIsProxySet.Multiline = false;
- this.CustomRichTextBoxStatusIsProxySet.Name = "CustomRichTextBoxStatusIsProxySet";
- this.CustomRichTextBoxStatusIsProxySet.ReadOnly = true;
- this.CustomRichTextBoxStatusIsProxySet.RightMargin = 0;
- this.CustomRichTextBoxStatusIsProxySet.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusIsProxySet.ScrollToBottom = false;
- this.CustomRichTextBoxStatusIsProxySet.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsProxySet.SelectionLength = 0;
- this.CustomRichTextBoxStatusIsProxySet.SelectionStart = 0;
- this.CustomRichTextBoxStatusIsProxySet.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusIsProxySet.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusIsProxySet.TabIndex = 0;
- this.CustomRichTextBoxStatusIsProxySet.Texts = "Is Proxy Set: Yes";
- this.CustomRichTextBoxStatusIsProxySet.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusIsProxySet.WordWrap = false;
- this.CustomRichTextBoxStatusIsProxySet.ZoomFactor = 1F;
+ CustomRichTextBoxStatusIsProxySet.AcceptsTab = false;
+ CustomRichTextBoxStatusIsProxySet.AutoWordSelection = false;
+ CustomRichTextBoxStatusIsProxySet.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusIsProxySet.Border = false;
+ CustomRichTextBoxStatusIsProxySet.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusIsProxySet.BorderSize = 1;
+ CustomRichTextBoxStatusIsProxySet.BulletIndent = 0;
+ CustomRichTextBoxStatusIsProxySet.DetectUrls = true;
+ CustomRichTextBoxStatusIsProxySet.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusIsProxySet.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusIsProxySet.ForeColor = Color.White;
+ CustomRichTextBoxStatusIsProxySet.HideSelection = true;
+ CustomRichTextBoxStatusIsProxySet.Location = new Point(5, 240);
+ CustomRichTextBoxStatusIsProxySet.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusIsProxySet.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusIsProxySet.Multiline = false;
+ CustomRichTextBoxStatusIsProxySet.Name = "CustomRichTextBoxStatusIsProxySet";
+ CustomRichTextBoxStatusIsProxySet.ReadOnly = true;
+ CustomRichTextBoxStatusIsProxySet.RightMargin = 0;
+ CustomRichTextBoxStatusIsProxySet.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusIsProxySet.ScrollToBottom = false;
+ CustomRichTextBoxStatusIsProxySet.SelectionColor = Color.White;
+ CustomRichTextBoxStatusIsProxySet.SelectionLength = 0;
+ CustomRichTextBoxStatusIsProxySet.SelectionStart = 0;
+ CustomRichTextBoxStatusIsProxySet.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusIsProxySet.Size = new Size(170, 23);
+ CustomRichTextBoxStatusIsProxySet.TabIndex = 0;
+ CustomRichTextBoxStatusIsProxySet.Texts = "Is Proxy Set: Yes";
+ CustomRichTextBoxStatusIsProxySet.UnderlinedStyle = false;
+ CustomRichTextBoxStatusIsProxySet.WordWrap = false;
+ CustomRichTextBoxStatusIsProxySet.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusIsSharing
//
- this.CustomRichTextBoxStatusIsSharing.AcceptsTab = false;
- this.CustomRichTextBoxStatusIsSharing.AutoWordSelection = false;
- this.CustomRichTextBoxStatusIsSharing.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusIsSharing.Border = false;
- this.CustomRichTextBoxStatusIsSharing.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusIsSharing.BorderSize = 1;
- this.CustomRichTextBoxStatusIsSharing.BulletIndent = 0;
- this.CustomRichTextBoxStatusIsSharing.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusIsSharing.DetectUrls = true;
- this.CustomRichTextBoxStatusIsSharing.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusIsSharing.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusIsSharing.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsSharing.HideSelection = true;
- this.CustomRichTextBoxStatusIsSharing.Location = new System.Drawing.Point(5, 190);
- this.CustomRichTextBoxStatusIsSharing.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusIsSharing.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusIsSharing.Multiline = false;
- this.CustomRichTextBoxStatusIsSharing.Name = "CustomRichTextBoxStatusIsSharing";
- this.CustomRichTextBoxStatusIsSharing.ReadOnly = true;
- this.CustomRichTextBoxStatusIsSharing.RightMargin = 0;
- this.CustomRichTextBoxStatusIsSharing.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusIsSharing.ScrollToBottom = false;
- this.CustomRichTextBoxStatusIsSharing.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsSharing.SelectionLength = 0;
- this.CustomRichTextBoxStatusIsSharing.SelectionStart = 0;
- this.CustomRichTextBoxStatusIsSharing.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusIsSharing.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusIsSharing.TabIndex = 0;
- this.CustomRichTextBoxStatusIsSharing.Texts = "Is Sharing: Yes";
- this.CustomRichTextBoxStatusIsSharing.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusIsSharing.WordWrap = false;
- this.CustomRichTextBoxStatusIsSharing.ZoomFactor = 1F;
+ CustomRichTextBoxStatusIsSharing.AcceptsTab = false;
+ CustomRichTextBoxStatusIsSharing.AutoWordSelection = false;
+ CustomRichTextBoxStatusIsSharing.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusIsSharing.Border = false;
+ CustomRichTextBoxStatusIsSharing.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusIsSharing.BorderSize = 1;
+ CustomRichTextBoxStatusIsSharing.BulletIndent = 0;
+ CustomRichTextBoxStatusIsSharing.DetectUrls = true;
+ CustomRichTextBoxStatusIsSharing.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusIsSharing.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusIsSharing.ForeColor = Color.White;
+ CustomRichTextBoxStatusIsSharing.HideSelection = true;
+ CustomRichTextBoxStatusIsSharing.Location = new Point(5, 190);
+ CustomRichTextBoxStatusIsSharing.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusIsSharing.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusIsSharing.Multiline = false;
+ CustomRichTextBoxStatusIsSharing.Name = "CustomRichTextBoxStatusIsSharing";
+ CustomRichTextBoxStatusIsSharing.ReadOnly = true;
+ CustomRichTextBoxStatusIsSharing.RightMargin = 0;
+ CustomRichTextBoxStatusIsSharing.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusIsSharing.ScrollToBottom = false;
+ CustomRichTextBoxStatusIsSharing.SelectionColor = Color.White;
+ CustomRichTextBoxStatusIsSharing.SelectionLength = 0;
+ CustomRichTextBoxStatusIsSharing.SelectionStart = 0;
+ CustomRichTextBoxStatusIsSharing.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusIsSharing.Size = new Size(170, 23);
+ CustomRichTextBoxStatusIsSharing.TabIndex = 0;
+ CustomRichTextBoxStatusIsSharing.Texts = "Is Sharing: Yes";
+ CustomRichTextBoxStatusIsSharing.UnderlinedStyle = false;
+ CustomRichTextBoxStatusIsSharing.WordWrap = false;
+ CustomRichTextBoxStatusIsSharing.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusIsDNSSet
//
- this.CustomRichTextBoxStatusIsDNSSet.AcceptsTab = false;
- this.CustomRichTextBoxStatusIsDNSSet.AutoWordSelection = false;
- this.CustomRichTextBoxStatusIsDNSSet.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusIsDNSSet.Border = false;
- this.CustomRichTextBoxStatusIsDNSSet.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusIsDNSSet.BorderSize = 1;
- this.CustomRichTextBoxStatusIsDNSSet.BulletIndent = 0;
- this.CustomRichTextBoxStatusIsDNSSet.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusIsDNSSet.DetectUrls = true;
- this.CustomRichTextBoxStatusIsDNSSet.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusIsDNSSet.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusIsDNSSet.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsDNSSet.HideSelection = true;
- this.CustomRichTextBoxStatusIsDNSSet.Location = new System.Drawing.Point(5, 165);
- this.CustomRichTextBoxStatusIsDNSSet.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusIsDNSSet.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusIsDNSSet.Multiline = false;
- this.CustomRichTextBoxStatusIsDNSSet.Name = "CustomRichTextBoxStatusIsDNSSet";
- this.CustomRichTextBoxStatusIsDNSSet.ReadOnly = true;
- this.CustomRichTextBoxStatusIsDNSSet.RightMargin = 0;
- this.CustomRichTextBoxStatusIsDNSSet.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusIsDNSSet.ScrollToBottom = false;
- this.CustomRichTextBoxStatusIsDNSSet.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsDNSSet.SelectionLength = 0;
- this.CustomRichTextBoxStatusIsDNSSet.SelectionStart = 0;
- this.CustomRichTextBoxStatusIsDNSSet.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusIsDNSSet.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusIsDNSSet.TabIndex = 0;
- this.CustomRichTextBoxStatusIsDNSSet.Texts = "Is DNS Set: Yes";
- this.CustomRichTextBoxStatusIsDNSSet.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusIsDNSSet.WordWrap = false;
- this.CustomRichTextBoxStatusIsDNSSet.ZoomFactor = 1F;
+ CustomRichTextBoxStatusIsDNSSet.AcceptsTab = false;
+ CustomRichTextBoxStatusIsDNSSet.AutoWordSelection = false;
+ CustomRichTextBoxStatusIsDNSSet.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusIsDNSSet.Border = false;
+ CustomRichTextBoxStatusIsDNSSet.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusIsDNSSet.BorderSize = 1;
+ CustomRichTextBoxStatusIsDNSSet.BulletIndent = 0;
+ CustomRichTextBoxStatusIsDNSSet.DetectUrls = true;
+ CustomRichTextBoxStatusIsDNSSet.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusIsDNSSet.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusIsDNSSet.ForeColor = Color.White;
+ CustomRichTextBoxStatusIsDNSSet.HideSelection = true;
+ CustomRichTextBoxStatusIsDNSSet.Location = new Point(5, 165);
+ CustomRichTextBoxStatusIsDNSSet.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusIsDNSSet.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusIsDNSSet.Multiline = false;
+ CustomRichTextBoxStatusIsDNSSet.Name = "CustomRichTextBoxStatusIsDNSSet";
+ CustomRichTextBoxStatusIsDNSSet.ReadOnly = true;
+ CustomRichTextBoxStatusIsDNSSet.RightMargin = 0;
+ CustomRichTextBoxStatusIsDNSSet.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusIsDNSSet.ScrollToBottom = false;
+ CustomRichTextBoxStatusIsDNSSet.SelectionColor = Color.White;
+ CustomRichTextBoxStatusIsDNSSet.SelectionLength = 0;
+ CustomRichTextBoxStatusIsDNSSet.SelectionStart = 0;
+ CustomRichTextBoxStatusIsDNSSet.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusIsDNSSet.Size = new Size(170, 23);
+ CustomRichTextBoxStatusIsDNSSet.TabIndex = 0;
+ CustomRichTextBoxStatusIsDNSSet.Texts = "Is DNS Set: Yes";
+ CustomRichTextBoxStatusIsDNSSet.UnderlinedStyle = false;
+ CustomRichTextBoxStatusIsDNSSet.WordWrap = false;
+ CustomRichTextBoxStatusIsDNSSet.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusProxyDpiBypass
//
- this.CustomRichTextBoxStatusProxyDpiBypass.AcceptsTab = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.AutoWordSelection = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusProxyDpiBypass.Border = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusProxyDpiBypass.BorderSize = 1;
- this.CustomRichTextBoxStatusProxyDpiBypass.BulletIndent = 0;
- this.CustomRichTextBoxStatusProxyDpiBypass.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusProxyDpiBypass.DetectUrls = true;
- this.CustomRichTextBoxStatusProxyDpiBypass.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusProxyDpiBypass.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusProxyDpiBypass.HideSelection = true;
- this.CustomRichTextBoxStatusProxyDpiBypass.Location = new System.Drawing.Point(5, 265);
- this.CustomRichTextBoxStatusProxyDpiBypass.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusProxyDpiBypass.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusProxyDpiBypass.Multiline = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.Name = "CustomRichTextBoxStatusProxyDpiBypass";
- this.CustomRichTextBoxStatusProxyDpiBypass.ReadOnly = true;
- this.CustomRichTextBoxStatusProxyDpiBypass.RightMargin = 0;
- this.CustomRichTextBoxStatusProxyDpiBypass.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusProxyDpiBypass.ScrollToBottom = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusProxyDpiBypass.SelectionLength = 0;
- this.CustomRichTextBoxStatusProxyDpiBypass.SelectionStart = 0;
- this.CustomRichTextBoxStatusProxyDpiBypass.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusProxyDpiBypass.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusProxyDpiBypass.TabIndex = 0;
- this.CustomRichTextBoxStatusProxyDpiBypass.Texts = "Proxy DPI Bypass: Inactive";
- this.CustomRichTextBoxStatusProxyDpiBypass.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.WordWrap = false;
- this.CustomRichTextBoxStatusProxyDpiBypass.ZoomFactor = 1F;
+ CustomRichTextBoxStatusProxyDpiBypass.AcceptsTab = false;
+ CustomRichTextBoxStatusProxyDpiBypass.AutoWordSelection = false;
+ CustomRichTextBoxStatusProxyDpiBypass.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusProxyDpiBypass.Border = false;
+ CustomRichTextBoxStatusProxyDpiBypass.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusProxyDpiBypass.BorderSize = 1;
+ CustomRichTextBoxStatusProxyDpiBypass.BulletIndent = 0;
+ CustomRichTextBoxStatusProxyDpiBypass.DetectUrls = true;
+ CustomRichTextBoxStatusProxyDpiBypass.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusProxyDpiBypass.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusProxyDpiBypass.ForeColor = Color.White;
+ CustomRichTextBoxStatusProxyDpiBypass.HideSelection = true;
+ CustomRichTextBoxStatusProxyDpiBypass.Location = new Point(5, 265);
+ CustomRichTextBoxStatusProxyDpiBypass.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusProxyDpiBypass.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusProxyDpiBypass.Multiline = false;
+ CustomRichTextBoxStatusProxyDpiBypass.Name = "CustomRichTextBoxStatusProxyDpiBypass";
+ CustomRichTextBoxStatusProxyDpiBypass.ReadOnly = true;
+ CustomRichTextBoxStatusProxyDpiBypass.RightMargin = 0;
+ CustomRichTextBoxStatusProxyDpiBypass.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusProxyDpiBypass.ScrollToBottom = false;
+ CustomRichTextBoxStatusProxyDpiBypass.SelectionColor = Color.White;
+ CustomRichTextBoxStatusProxyDpiBypass.SelectionLength = 0;
+ CustomRichTextBoxStatusProxyDpiBypass.SelectionStart = 0;
+ CustomRichTextBoxStatusProxyDpiBypass.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusProxyDpiBypass.Size = new Size(170, 23);
+ CustomRichTextBoxStatusProxyDpiBypass.TabIndex = 0;
+ CustomRichTextBoxStatusProxyDpiBypass.Texts = "Proxy DPI Bypass: Inactive";
+ CustomRichTextBoxStatusProxyDpiBypass.UnderlinedStyle = false;
+ CustomRichTextBoxStatusProxyDpiBypass.WordWrap = false;
+ CustomRichTextBoxStatusProxyDpiBypass.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusIsConnected
//
- this.CustomRichTextBoxStatusIsConnected.AcceptsTab = false;
- this.CustomRichTextBoxStatusIsConnected.AutoWordSelection = false;
- this.CustomRichTextBoxStatusIsConnected.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusIsConnected.Border = false;
- this.CustomRichTextBoxStatusIsConnected.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusIsConnected.BorderSize = 1;
- this.CustomRichTextBoxStatusIsConnected.BulletIndent = 0;
- this.CustomRichTextBoxStatusIsConnected.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusIsConnected.DetectUrls = true;
- this.CustomRichTextBoxStatusIsConnected.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusIsConnected.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusIsConnected.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsConnected.HideSelection = true;
- this.CustomRichTextBoxStatusIsConnected.Location = new System.Drawing.Point(5, 40);
- this.CustomRichTextBoxStatusIsConnected.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusIsConnected.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusIsConnected.Multiline = false;
- this.CustomRichTextBoxStatusIsConnected.Name = "CustomRichTextBoxStatusIsConnected";
- this.CustomRichTextBoxStatusIsConnected.ReadOnly = true;
- this.CustomRichTextBoxStatusIsConnected.RightMargin = 0;
- this.CustomRichTextBoxStatusIsConnected.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusIsConnected.ScrollToBottom = false;
- this.CustomRichTextBoxStatusIsConnected.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusIsConnected.SelectionLength = 0;
- this.CustomRichTextBoxStatusIsConnected.SelectionStart = 0;
- this.CustomRichTextBoxStatusIsConnected.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusIsConnected.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusIsConnected.TabIndex = 0;
- this.CustomRichTextBoxStatusIsConnected.Texts = "Is Connected: Yes";
- this.CustomRichTextBoxStatusIsConnected.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusIsConnected.WordWrap = false;
- this.CustomRichTextBoxStatusIsConnected.ZoomFactor = 1F;
+ CustomRichTextBoxStatusIsConnected.AcceptsTab = false;
+ CustomRichTextBoxStatusIsConnected.AutoWordSelection = false;
+ CustomRichTextBoxStatusIsConnected.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusIsConnected.Border = false;
+ CustomRichTextBoxStatusIsConnected.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusIsConnected.BorderSize = 1;
+ CustomRichTextBoxStatusIsConnected.BulletIndent = 0;
+ CustomRichTextBoxStatusIsConnected.DetectUrls = true;
+ CustomRichTextBoxStatusIsConnected.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusIsConnected.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusIsConnected.ForeColor = Color.White;
+ CustomRichTextBoxStatusIsConnected.HideSelection = true;
+ CustomRichTextBoxStatusIsConnected.Location = new Point(5, 40);
+ CustomRichTextBoxStatusIsConnected.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusIsConnected.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusIsConnected.Multiline = false;
+ CustomRichTextBoxStatusIsConnected.Name = "CustomRichTextBoxStatusIsConnected";
+ CustomRichTextBoxStatusIsConnected.ReadOnly = true;
+ CustomRichTextBoxStatusIsConnected.RightMargin = 0;
+ CustomRichTextBoxStatusIsConnected.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusIsConnected.ScrollToBottom = false;
+ CustomRichTextBoxStatusIsConnected.SelectionColor = Color.White;
+ CustomRichTextBoxStatusIsConnected.SelectionLength = 0;
+ CustomRichTextBoxStatusIsConnected.SelectionStart = 0;
+ CustomRichTextBoxStatusIsConnected.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusIsConnected.Size = new Size(170, 23);
+ CustomRichTextBoxStatusIsConnected.TabIndex = 0;
+ CustomRichTextBoxStatusIsConnected.Texts = "Is Connected: Yes";
+ CustomRichTextBoxStatusIsConnected.UnderlinedStyle = false;
+ CustomRichTextBoxStatusIsConnected.WordWrap = false;
+ CustomRichTextBoxStatusIsConnected.ZoomFactor = 1F;
//
// CustomRichTextBoxStatusWorkingServers
//
- this.CustomRichTextBoxStatusWorkingServers.AcceptsTab = false;
- this.CustomRichTextBoxStatusWorkingServers.AutoWordSelection = false;
- this.CustomRichTextBoxStatusWorkingServers.BackColor = System.Drawing.Color.DimGray;
- this.CustomRichTextBoxStatusWorkingServers.Border = false;
- this.CustomRichTextBoxStatusWorkingServers.BorderColor = System.Drawing.Color.Blue;
- this.CustomRichTextBoxStatusWorkingServers.BorderSize = 1;
- this.CustomRichTextBoxStatusWorkingServers.BulletIndent = 0;
- this.CustomRichTextBoxStatusWorkingServers.Cursor = System.Windows.Forms.Cursors.Default;
- this.CustomRichTextBoxStatusWorkingServers.DetectUrls = true;
- this.CustomRichTextBoxStatusWorkingServers.EnableAutoDragDrop = false;
- this.CustomRichTextBoxStatusWorkingServers.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomRichTextBoxStatusWorkingServers.ForeColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusWorkingServers.HideSelection = true;
- this.CustomRichTextBoxStatusWorkingServers.Location = new System.Drawing.Point(5, 15);
- this.CustomRichTextBoxStatusWorkingServers.MaxLength = 2147483647;
- this.CustomRichTextBoxStatusWorkingServers.MinimumSize = new System.Drawing.Size(0, 15);
- this.CustomRichTextBoxStatusWorkingServers.Multiline = false;
- this.CustomRichTextBoxStatusWorkingServers.Name = "CustomRichTextBoxStatusWorkingServers";
- this.CustomRichTextBoxStatusWorkingServers.ReadOnly = true;
- this.CustomRichTextBoxStatusWorkingServers.RightMargin = 0;
- this.CustomRichTextBoxStatusWorkingServers.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomRichTextBoxStatusWorkingServers.ScrollToBottom = false;
- this.CustomRichTextBoxStatusWorkingServers.SelectionColor = System.Drawing.Color.White;
- this.CustomRichTextBoxStatusWorkingServers.SelectionLength = 0;
- this.CustomRichTextBoxStatusWorkingServers.SelectionStart = 0;
- this.CustomRichTextBoxStatusWorkingServers.ShortcutsEnabled = true;
- this.CustomRichTextBoxStatusWorkingServers.Size = new System.Drawing.Size(170, 23);
- this.CustomRichTextBoxStatusWorkingServers.TabIndex = 0;
- this.CustomRichTextBoxStatusWorkingServers.Texts = "Working Servers: 0000";
- this.CustomRichTextBoxStatusWorkingServers.UnderlinedStyle = false;
- this.CustomRichTextBoxStatusWorkingServers.WordWrap = false;
- this.CustomRichTextBoxStatusWorkingServers.ZoomFactor = 1F;
+ CustomRichTextBoxStatusWorkingServers.AcceptsTab = false;
+ CustomRichTextBoxStatusWorkingServers.AutoWordSelection = false;
+ CustomRichTextBoxStatusWorkingServers.BackColor = Color.DimGray;
+ CustomRichTextBoxStatusWorkingServers.Border = false;
+ CustomRichTextBoxStatusWorkingServers.BorderColor = Color.Blue;
+ CustomRichTextBoxStatusWorkingServers.BorderSize = 1;
+ CustomRichTextBoxStatusWorkingServers.BulletIndent = 0;
+ CustomRichTextBoxStatusWorkingServers.DetectUrls = true;
+ CustomRichTextBoxStatusWorkingServers.EnableAutoDragDrop = false;
+ CustomRichTextBoxStatusWorkingServers.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomRichTextBoxStatusWorkingServers.ForeColor = Color.White;
+ CustomRichTextBoxStatusWorkingServers.HideSelection = true;
+ CustomRichTextBoxStatusWorkingServers.Location = new Point(5, 15);
+ CustomRichTextBoxStatusWorkingServers.MaxLength = int.MaxValue;
+ CustomRichTextBoxStatusWorkingServers.MinimumSize = new Size(0, 15);
+ CustomRichTextBoxStatusWorkingServers.Multiline = false;
+ CustomRichTextBoxStatusWorkingServers.Name = "CustomRichTextBoxStatusWorkingServers";
+ CustomRichTextBoxStatusWorkingServers.ReadOnly = true;
+ CustomRichTextBoxStatusWorkingServers.RightMargin = 0;
+ CustomRichTextBoxStatusWorkingServers.ScrollBars = ScrollBars.None;
+ CustomRichTextBoxStatusWorkingServers.ScrollToBottom = false;
+ CustomRichTextBoxStatusWorkingServers.SelectionColor = Color.White;
+ CustomRichTextBoxStatusWorkingServers.SelectionLength = 0;
+ CustomRichTextBoxStatusWorkingServers.SelectionStart = 0;
+ CustomRichTextBoxStatusWorkingServers.ShortcutsEnabled = true;
+ CustomRichTextBoxStatusWorkingServers.Size = new Size(170, 23);
+ CustomRichTextBoxStatusWorkingServers.TabIndex = 0;
+ CustomRichTextBoxStatusWorkingServers.Texts = "Working Servers: 0000";
+ CustomRichTextBoxStatusWorkingServers.UnderlinedStyle = false;
+ CustomRichTextBoxStatusWorkingServers.WordWrap = false;
+ CustomRichTextBoxStatusWorkingServers.ZoomFactor = 1F;
//
// SplitContainerMain
//
- this.SplitContainerMain.BackColor = System.Drawing.Color.Transparent;
- this.SplitContainerMain.Cursor = System.Windows.Forms.Cursors.Default;
- this.SplitContainerMain.Dock = System.Windows.Forms.DockStyle.Fill;
- this.SplitContainerMain.IsSplitterFixed = true;
- this.SplitContainerMain.Location = new System.Drawing.Point(0, 0);
- this.SplitContainerMain.Name = "SplitContainerMain";
- this.SplitContainerMain.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ SplitContainerMain.BackColor = Color.Transparent;
+ SplitContainerMain.Dock = DockStyle.Fill;
+ SplitContainerMain.IsSplitterFixed = true;
+ SplitContainerMain.Location = new Point(0, 0);
+ SplitContainerMain.Name = "SplitContainerMain";
+ SplitContainerMain.Orientation = Orientation.Horizontal;
//
// SplitContainerMain.Panel1
//
- this.SplitContainerMain.Panel1.Controls.Add(this.SplitContainerTop);
+ SplitContainerMain.Panel1.Controls.Add(SplitContainerTop);
//
// SplitContainerMain.Panel2
//
- this.SplitContainerMain.Panel2.Controls.Add(this.CustomGroupBoxLog);
- this.SplitContainerMain.Size = new System.Drawing.Size(884, 581);
- this.SplitContainerMain.SplitterDistance = 400;
- this.SplitContainerMain.TabIndex = 9;
+ SplitContainerMain.Panel2.Controls.Add(CustomGroupBoxLog);
+ SplitContainerMain.Size = new Size(884, 581);
+ SplitContainerMain.SplitterDistance = 400;
+ SplitContainerMain.TabIndex = 9;
//
// SplitContainerTop
//
- this.SplitContainerTop.Cursor = System.Windows.Forms.Cursors.Default;
- this.SplitContainerTop.Dock = System.Windows.Forms.DockStyle.Fill;
- this.SplitContainerTop.IsSplitterFixed = true;
- this.SplitContainerTop.Location = new System.Drawing.Point(0, 0);
- this.SplitContainerTop.Name = "SplitContainerTop";
+ SplitContainerTop.Dock = DockStyle.Fill;
+ SplitContainerTop.IsSplitterFixed = true;
+ SplitContainerTop.Location = new Point(0, 0);
+ SplitContainerTop.Name = "SplitContainerTop";
//
// SplitContainerTop.Panel1
//
- this.SplitContainerTop.Panel1.Controls.Add(this.CustomTabControlMain);
+ SplitContainerTop.Panel1.Controls.Add(CustomTabControlMain);
+ SplitContainerTop.Panel1MinSize = 678;
//
// SplitContainerTop.Panel2
//
- this.SplitContainerTop.Panel2.Controls.Add(this.CustomGroupBoxStatus);
- this.SplitContainerTop.Size = new System.Drawing.Size(884, 400);
- this.SplitContainerTop.SplitterDistance = 700;
- this.SplitContainerTop.TabIndex = 0;
+ SplitContainerTop.Panel2.Controls.Add(CustomGroupBoxStatus);
+ SplitContainerTop.Panel2MinSize = 180;
+ SplitContainerTop.Size = new Size(884, 400);
+ SplitContainerTop.SplitterDistance = 700;
+ SplitContainerTop.TabIndex = 0;
//
// FormMain
//
- this.AcceptButton = this.CustomButtonCheck;
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(884, 581);
- this.Controls.Add(this.SplitContainerMain);
- this.DoubleBuffered = true;
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MaximizeBox = false;
- this.MaximumSize = new System.Drawing.Size(900, 620);
- this.MinimumSize = new System.Drawing.Size(900, 435);
- this.Name = "FormMain";
- this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
- this.Text = "SecureDNSClient";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormMain_FormClosing);
- this.CustomGroupBoxLog.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSSLFragmentSize)).EndInit();
- this.CustomTabControlMain.ResumeLayout(false);
- this.TabPageSecureDNS.ResumeLayout(false);
- this.CustomTabControlSecureDNS.ResumeLayout(false);
- this.TabPageCheck.ResumeLayout(false);
- this.TabPageCheck.PerformLayout();
- this.TabPageConnect.ResumeLayout(false);
- this.TabPageConnect.PerformLayout();
- this.TabPageSetDNS.ResumeLayout(false);
- this.TabPageSetDNS.PerformLayout();
- this.TabPageShare.ResumeLayout(false);
- this.TabPageShare.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiBeforeSniChunks)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiAntiPatternOffset)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiFragDelay)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPDpiSniChunks)).EndInit();
- this.TabPageGoodbyeDPI.ResumeLayout(false);
- this.CustomTabControlDPIBasicAdvanced.ResumeLayout(false);
- this.TabPageDPIBasic.ResumeLayout(false);
- this.TabPageDPIBasic.PerformLayout();
- this.TabPageDPIAdvanced.ResumeLayout(false);
- this.TabPageDPIAdvanced.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvMaxPayload)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvMinTTL)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvSetTTL)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvPort)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvE)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvK)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownDPIAdvF)).EndInit();
- this.TabPageTools.ResumeLayout(false);
- this.TabPageTools.PerformLayout();
- this.TabPageSettings.ResumeLayout(false);
- this.CustomTabControlSettings.ResumeLayout(false);
- this.TabPageSettingsWorkingMode.ResumeLayout(false);
- this.TabPageSettingsWorkingMode.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingWorkingModeSetDohPort)).EndInit();
- this.TabPageSettingsCheck.ResumeLayout(false);
- this.TabPageSettingsCheck.PerformLayout();
- this.CustomGroupBoxSettingCheckDnsProtocol.ResumeLayout(false);
- this.CustomGroupBoxSettingCheckSDNS.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingCheckTimeout)).EndInit();
- this.TabPageSettingsConnect.ResumeLayout(false);
- this.TabPageSettingsConnect.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingCamouflageDnsPort)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingMaxServers)).EndInit();
- this.TabPageSettingsSetUnsetDNS.ResumeLayout(false);
- this.TabPageSettingsSetUnsetDNS.PerformLayout();
- this.TabPageSettingsShare.ResumeLayout(false);
- this.CustomTabControlSettingHttpProxy.ResumeLayout(false);
- this.TabPageSettingHttpProxyBasic.ResumeLayout(false);
- this.TabPageSettingHttpProxyBasic.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyKillRequestTimeout)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyUpstreamPort)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyPort)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingHTTPProxyHandleRequests)).EndInit();
- this.TabPageSettingHttpProxyAdvanced.ResumeLayout(false);
- this.TabPageSettingHttpProxyAdvanced.PerformLayout();
- this.TabPageSettingsFakeProxy.ResumeLayout(false);
- this.TabPageSettingsFakeProxy.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingFakeProxyPort)).EndInit();
- this.TabPageSettingsCPU.ResumeLayout(false);
- this.TabPageSettingsCPU.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingCpuKillProxyRequests)).EndInit();
- this.TabPageSettingsOthers.ResumeLayout(false);
- this.TabPageSettingsOthers.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingFallbackDnsPort)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownSettingBootstrapDnsPort)).EndInit();
- this.TabPageAbout.ResumeLayout(false);
- this.TabPageAbout.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.PictureBoxFarvahar)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.PictureBoxAbout)).EndInit();
- this.CustomGroupBoxStatus.ResumeLayout(false);
- this.CustomGroupBoxStatus.PerformLayout();
- this.SplitContainerMain.Panel1.ResumeLayout(false);
- this.SplitContainerMain.Panel2.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.SplitContainerMain)).EndInit();
- this.SplitContainerMain.ResumeLayout(false);
- this.SplitContainerTop.Panel1.ResumeLayout(false);
- this.SplitContainerTop.Panel2.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.SplitContainerTop)).EndInit();
- this.SplitContainerTop.ResumeLayout(false);
- this.ResumeLayout(false);
-
+ AcceptButton = CustomButtonCheck;
+ AutoScaleMode = AutoScaleMode.None;
+ ClientSize = new Size(884, 581);
+ Controls.Add(SplitContainerMain);
+ DoubleBuffered = true;
+ FormBorderStyle = FormBorderStyle.FixedSingle;
+ Icon = (Icon)resources.GetObject("$this.Icon");
+ MaximizeBox = false;
+ MaximumSize = new Size(900, 620);
+ MinimumSize = new Size(900, 435);
+ Name = "FormMain";
+ SizeGripStyle = SizeGripStyle.Hide;
+ Text = "SecureDNSClient";
+ FormClosing += FormMain_FormClosing;
+ CustomGroupBoxLog.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSSLFragmentSize).EndInit();
+ CustomTabControlMain.ResumeLayout(false);
+ TabPageSecureDNS.ResumeLayout(false);
+ CustomTabControlSecureDNS.ResumeLayout(false);
+ TabPageCheck.ResumeLayout(false);
+ TabPageCheck.PerformLayout();
+ TabPageConnect.ResumeLayout(false);
+ TabPageSetDNS.ResumeLayout(false);
+ TabPageSetDNS.PerformLayout();
+ TabPageShare.ResumeLayout(false);
+ TabPageShare.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiBeforeSniChunks).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiAntiPatternOffset).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiFragDelay).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPDpiSniChunks).EndInit();
+ TabPageGoodbyeDPI.ResumeLayout(false);
+ CustomTabControlDPIBasicAdvanced.ResumeLayout(false);
+ TabPageDPIBasic.ResumeLayout(false);
+ TabPageDPIBasic.PerformLayout();
+ TabPageDPIAdvanced.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvMaxPayload).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvMinTTL).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvSetTTL).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvPort).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvE).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvK).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownDPIAdvF).EndInit();
+ TabPageTools.ResumeLayout(false);
+ TabPageSettings.ResumeLayout(false);
+ CustomTabControlSettings.ResumeLayout(false);
+ TabPageSettingsWorkingMode.ResumeLayout(false);
+ TabPageSettingsWorkingMode.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingWorkingModeSetDohPort).EndInit();
+ TabPageSettingsCheck.ResumeLayout(false);
+ TabPageSettingsCheck.PerformLayout();
+ CustomGroupBoxSettingCheckDnsProtocol.ResumeLayout(false);
+ CustomGroupBoxSettingCheckSDNS.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingCheckTimeout).EndInit();
+ TabPageSettingsConnect.ResumeLayout(false);
+ TabPageSettingsConnect.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingCamouflageDnsPort).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingMaxServers).EndInit();
+ TabPageSettingsSetUnsetDNS.ResumeLayout(false);
+ TabPageSettingsSetUnsetDNS.PerformLayout();
+ TabPageSettingsShare.ResumeLayout(false);
+ CustomTabControlSettingHttpProxy.ResumeLayout(false);
+ TabPageSettingHttpProxyBasic.ResumeLayout(false);
+ TabPageSettingHttpProxyBasic.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyKillRequestTimeout).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyUpstreamPort).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyPort).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingHTTPProxyHandleRequests).EndInit();
+ TabPageSettingHttpProxyAdvanced.ResumeLayout(false);
+ TabPageSettingHttpProxyAdvanced.PerformLayout();
+ TabPageSettingsFakeProxy.ResumeLayout(false);
+ TabPageSettingsFakeProxy.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingFakeProxyPort).EndInit();
+ TabPageSettingsCPU.ResumeLayout(false);
+ TabPageSettingsCPU.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingCpuKillProxyRequests).EndInit();
+ TabPageSettingsOthers.ResumeLayout(false);
+ TabPageSettingsOthers.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingFallbackDnsPort).EndInit();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownSettingBootstrapDnsPort).EndInit();
+ TabPageAbout.ResumeLayout(false);
+ TabPageAbout.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)PictureBoxFarvahar).EndInit();
+ ((System.ComponentModel.ISupportInitialize)PictureBoxAbout).EndInit();
+ CustomGroupBoxStatus.ResumeLayout(false);
+ SplitContainerMain.Panel1.ResumeLayout(false);
+ SplitContainerMain.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)SplitContainerMain).EndInit();
+ SplitContainerMain.ResumeLayout(false);
+ SplitContainerTop.Panel1.ResumeLayout(false);
+ SplitContainerTop.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)SplitContainerTop).EndInit();
+ SplitContainerTop.ResumeLayout(false);
+ ResumeLayout(false);
}
#endregion
@@ -4991,7 +4753,6 @@ private void InitializeComponent()
private CustomControls.CustomRichTextBox CustomRichTextBoxStatusProxyDpiBypass;
private CustomControls.CustomRichTextBox CustomRichTextBoxStatusIsDNSSet;
private CustomControls.CustomRichTextBox CustomRichTextBoxStatusIsSharing;
- private CustomControls.CustomButton CustomButtonConnectAll;
private CustomControls.CustomCheckBox CustomCheckBoxSettingDisableAudioAlert;
private CustomControls.CustomTabControl CustomTabControlSettings;
private TabPage TabPageSettingsWorkingMode;
@@ -5139,5 +4900,11 @@ private void InitializeComponent()
private CustomControls.CustomLabel CustomLabelSettingHTTPProxyKillRequestTimeout;
private CustomControls.CustomProgressBar CustomProgressBarCheck;
private PictureBox PictureBoxFarvahar;
+ private CustomControls.CustomButton CustomButtonQuickConnect;
+ private CustomControls.CustomCheckBox CustomCheckBoxSettingWriteLogWindowToFile;
+ private CustomControls.CustomButton CustomButtonImportUserData;
+ private CustomControls.CustomButton CustomButtonExportUserData;
+ private CustomControls.CustomButton CustomButtonProcessMonitor;
+ private CustomControls.CustomButton CustomButtonToolsDnsScanner;
}
}
\ No newline at end of file
diff --git a/SecureDNSClient/Forms/FormMain.cs b/SecureDNSClient/Forms/FormMain.cs
index 1a49b25..d3bc0b1 100644
--- a/SecureDNSClient/Forms/FormMain.cs
+++ b/SecureDNSClient/Forms/FormMain.cs
@@ -1,11 +1,15 @@
using System.Net;
using System.Diagnostics;
-using MsmhTools;
-using MsmhTools.HTTPProxyServer;
-using MsmhTools.Themes;
using CustomControls;
-using System.Text;
using System.Reflection;
+using System.Text;
+using System.IO.Compression;
+using System.Globalization;
+using Microsoft.Win32;
+using MsmhToolsClass;
+using MsmhToolsClass.HTTPProxyServer;
+using MsmhToolsWinFormsClass;
+using MsmhToolsWinFormsClass.Themes;
// https://github.com/msasanmh/SecureDNSClient
namespace SecureDNSClient
@@ -18,28 +22,29 @@ public partial class FormMain : Form
public List SavedEncodedDnsList = new();
private List WorkingDnsListToFile = new();
private List> WorkingDnsAndLatencyListToFile = new();
- private bool Once = true;
- private bool IsCheckingForUpdate = false;
- private bool IsCheckingStarted = false;
- private bool StopChecking = false;
- private bool IsCheckDone = false;
- private bool IsConnecting = false;
- private bool IsDisconnecting = false;
- private bool IsConnected = false;
+ public static ProcessMonitor MonitorProcess { get; set; } = new();
+ private bool Once { get; set; } = true;
+ private bool IsCheckingForUpdate { get; set; } = false;
+ private int NumberOfWorkingServers { get; set; } = 0;
+ public static bool IsCheckingStarted { get; set; } = false;
+ private static bool StopChecking { get; set; } = false;
+ private bool IsConnecting { get; set; } = false;
+ private bool IsDisconnecting { get; set; } = false;
+ private bool IsConnected { get; set; } = false;
public static bool IsDNSConnected { get; set; } = false;
- public bool IsDoHConnected = false;
- private int ConnectedDohPort = 443;
- private bool IsDPIActive = false;
- private bool IsGoodbyeDPIActive = false;
- private bool IsDNSSet = false;
- private bool IsDNSSetting = false;
- private bool IsDNSUnsetting = false;
- private int NumberOfWorkingServers = 0;
- private int LocalDnsLatency = -1;
- private int LocalDohLatency = -1;
- private bool ConnectAllClicked = false;
- private IPAddress? LocalIP = IPAddress.Loopback; // as default
- public Settings AppSettings;
+ private int LocalDnsLatency { get; set; } = -1;
+ public static bool IsDoHConnected { get; set; } = false;
+ private int LocalDohLatency { get; set; } = -1;
+ public static int ConnectedDohPort { get; set; } = 443; // as default
+ private bool IsDNSSetting { get; set; } = false;
+ private bool IsDNSUnsetting { get; set; } = false;
+ private bool IsDNSSet { get; set; } = false;
+ private bool IsDPIActive { get; set; } = false;
+ private bool IsGoodbyeDPIBasicActive { get; set; } = false;
+ private bool IsGoodbyeDPIAdvancedActive { get; set; } = false;
+ private bool ConnectAllClicked { get; set; } = false;
+ public static IPAddress? LocalIP { get; set; } = IPAddress.Loopback; // as default
+ public Settings AppSettings { get; set; }
private readonly ToolStripMenuItem ToolStripMenuItemIcon = new();
private bool AudioAlertOnline = true;
private bool AudioAlertOffline = false;
@@ -47,35 +52,36 @@ public partial class FormMain : Form
private readonly Stopwatch StopWatchCheckDPIWorks = new();
private readonly Stopwatch StopWatchAudioAlertDelay = new();
private string TheDll = string.Empty;
- private readonly string NL = Environment.NewLine;
+ private static readonly string NL = Environment.NewLine;
private readonly int LogHeight;
private bool IsExiting = false;
// PIDs
- private int PIDDNSProxy { get; set; } = -1;
- private int PIDDNSCrypt { get; set; } = -1;
- private int PIDGoodbyeDPI { get; set; } = -1;
+ public static int PIDDNSProxy { get; set; } = -1;
+ public static int PIDDNSCrypt { get; set; } = -1;
+ private static int PIDGoodbyeDPIBasic { get; set; } = -1;
+ private static int PIDGoodbyeDPIAdvanced { get; set; } = -1;
// Camouflage
- private HTTPProxyServer CamouflageProxyServer = new();
- private CamouflageDNSServer? CamouflageDNSServer;
- private bool IsBypassProxyActive { get; set; } = false;
+ private HTTPProxyServer CamouflageHttpProxyServer { get; set; } = new();
+ private CamouflageDNSServer? CamouflageDNSServer { get; set; }
+ private bool IsBypassHttpProxyActive { get; set; } = false;
private bool IsBypassDNSActive { get; set; } = false;
- private int PIDDNSCryptBypass = -1;
- private int PIDDNSProxyBypass = -1;
- private int PIDGoodbyeDPIBypass = -1;
+ private static int PIDDNSCryptBypass { get; set; } = -1;
+ private static int PIDDNSProxyBypass { get; set; } = -1;
+ private static int PIDGoodbyeDPIBypass { get; set; } = -1;
// HTTP Proxy
- private int PIDHttpProxy { get; set; } = -1;
- private Process? ProxyProcess;
- private bool IsProxyActivated = false;
- private bool IsProxyActivating = false;
- private bool IsProxyDeactivating = false;
- private bool IsSharing = false;
- private int ProxyPort = -1;
- private int ProxyRequests = 0;
- private int ProxyMaxRequests = 250;
- private bool IsProxyDPIActive = false;
+ private static int PIDHttpProxy { get; set; } = -1;
+ private Process? HttpProxyProcess { get; set; }
+ private bool IsHttpProxyActivated { get; set; } = false;
+ private bool IsHttpProxyActivating { get; set; } = false;
+ private bool IsHttpProxyDeactivating { get; set; } = false;
+ public static bool IsHttpProxyRunning { get; set; } = false;
+ public static int HttpProxyPort { get; set; } = -1;
+ private int HttpProxyRequests { get; set; } = 0;
+ private int HttpProxyMaxRequests { get; set; } = 250;
+ private bool IsHttpProxyDpiBypassActive { get; set; } = false;
private HTTPProxyServer.Program.DPIBypass.Mode ProxyStaticDPIBypassMode = HTTPProxyServer.Program.DPIBypass.Mode.Disable;
private HTTPProxyServer.Program.DPIBypass.Mode ProxyDPIBypassMode = HTTPProxyServer.Program.DPIBypass.Mode.Disable;
private HTTPProxyServer.Program.UpStreamProxy.Mode ProxyUpStreamMode = HTTPProxyServer.Program.UpStreamProxy.Mode.Disable;
@@ -83,31 +89,27 @@ public partial class FormMain : Form
private HTTPProxyServer.Program.FakeDns.Mode ProxyFakeDnsMode = HTTPProxyServer.Program.FakeDns.Mode.Disable;
private HTTPProxyServer.Program.BlackWhiteList.Mode ProxyBWListMode = HTTPProxyServer.Program.BlackWhiteList.Mode.Disable;
private HTTPProxyServer.Program.DontBypass.Mode DontBypassMode = HTTPProxyServer.Program.DontBypass.Mode.Disable;
- private bool IsProxySet = false;
- private static bool UpdateProxyBools = true;
+ private bool IsHttpProxySet { get; set; } = false;
+ private static bool UpdateHttpProxyBools { get; set; } = true;
// Fake Proxy
- private int PIDFakeProxy { get; set; } = -1;
- private Process? FakeProxyProcess;
+ private static int PIDFakeHttpProxy { get; set; } = -1;
+ private Process? FakeHttpProxyProcess { get; set; }
public FormMain()
{
+ // Fix Screed DPI
+ ScreenDPI.FixDpiBeforeInitializeComponent(this);
InitializeComponent();
+ ScreenDPI.FixDpiAfterInitializeComponent(this);
+ FixScreenDPI(this); // Change some labels font
+
//CustomStatusStrip1.SizingGrip = false;
// Set Min Size for Toggle Log View
MinimumSize = new Size(Width, Height - CustomGroupBoxLog.Height);
LogHeight = CustomGroupBoxLog.Height;
- // Fix Screen DPI
- ScreenDPI.ScaleForm(this, true, false);
- FixScreenDPI(this);
-
- // Rightclick on NotifyIcon
- ToolStripMenuItemIcon.Text = "Exit";
- ToolStripMenuItemIcon.Click += ToolStripMenuItemIcon_Click;
- CustomContextMenuStripIcon.Items.Add(ToolStripMenuItemIcon);
-
// Update NICs
SecureDNS.UpdateNICs(CustomComboBoxNICs);
@@ -132,6 +134,7 @@ public FormMain()
// Add Tooltips
string msgCheckInParallel = "a) Don't use parallel on slow network.";
msgCheckInParallel += $"{NL}b) Parallel doesn't support bootstrap.";
+ msgCheckInParallel += $"{NL}c) Parallel doesn't support insecure mode.";
CustomCheckBoxCheckInParallel.SetToolTip("Info", msgCheckInParallel);
// Add Tooltips to advanced DPI
@@ -188,15 +191,13 @@ public FormMain()
CustomLabelAboutVersion.Text = " v" + Info.GetAppInfo(Assembly.GetExecutingAssembly()).ProductVersion;
CustomLabelAboutThis2.ForeColor = Color.IndianRed;
- // In case application closed unexpectedly Kill processes and set DNS to dynamic
- KillAll(true);
-
// Initialize and load Settings
- if (File.Exists(SecureDNS.SettingsXmlPath) && Xml.IsValidXMLFile(SecureDNS.SettingsXmlPath))
+ if (File.Exists(SecureDNS.SettingsXmlPath) && XmlTool.IsValidXMLFile(SecureDNS.SettingsXmlPath))
AppSettings = new(this, SecureDNS.SettingsXmlPath);
else
AppSettings = new(this);
+ UpdateNotifyIconIconAuto();
CheckUpdateAuto();
LogClearAuto();
UpdateBoolsAuto();
@@ -209,6 +210,7 @@ public FormMain()
// Auto Save Settings (Timer)
AutoSaveSettings();
+ // Label Moving
Controls.Add(LabelMoving);
LabelMoving.Text = "Now Moving...";
LabelMoving.Size = new(300, 150);
@@ -219,22 +221,78 @@ public FormMain()
LabelMoving.Visible = false;
LabelMoving.SendToBack();
+ // Save Log to File
+ CustomRichTextBoxLog.TextAppended += CustomRichTextBoxLog_TextAppended;
+
Shown += FormMain_Shown;
Move += FormMain_Move;
ResizeEnd += FormMain_ResizeEnd;
Resize += FormMain_Resize;
+
+ SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged;
+ }
+
+ private void HideLabelMoving()
+ {
+ LabelMoving.Visible = false;
+ LabelMoving.SendToBack();
+ SplitContainerMain.Visible = true;
+ }
+
+ private void SystemEvents_DisplaySettingsChanged(object? sender, EventArgs e)
+ {
+ HideLabelMoving();
+ if (ScreenDPI.GetSystemDpi() != 96)
+ {
+ string msg = "Display Settings Changed.\n";
+ msg += "You may need restart the app to fix display issue.";
+ CustomMessageBox.Show(this, msg);
+ }
+ }
+
+ private void CustomRichTextBoxLog_TextAppended(object? sender, EventArgs e)
+ {
+ if (sender is string text)
+ {
+ // Write to file
+ try
+ {
+ if (CustomCheckBoxSettingWriteLogWindowToFile.Checked)
+ FileDirectory.AppendText(SecureDNS.LogWindowPath, text, new UTF8Encoding(false));
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Write Log to file: {ex.Message}");
+ }
+ }
}
private async void FormMain_Shown(object? sender, EventArgs e)
{
if (Once)
{
+ HideLabelMoving();
+
// Write binaries if not exist or needs update
await WriteNecessaryFilesToDisk();
// Load Saved Servers
SavedDnsLoad();
+ // In case application closed unexpectedly Kill processes and set DNS to dynamic
+ KillAll(true);
+ await UnsetSavedDNS();
+
+ // Delete Log File on > 500KB
+ DeleteFileOnSize(SecureDNS.LogWindowPath, 500);
+
+ // Load Proxy Port
+ HttpProxyPort = GetHTTPProxyPortSetting();
+
+ // Start Trace Event Session
+ MonitorProcess.SetPID(GetPids(true));
+ MonitorProcess.Start(true);
+
Once = false;
}
}
@@ -249,18 +307,14 @@ private void FormMain_Move(object? sender, EventArgs e)
private void FormMain_ResizeEnd(object? sender, EventArgs e)
{
- SplitContainerMain.Visible = true;
- LabelMoving.Visible = false;
- LabelMoving.SendToBack();
+ HideLabelMoving();
}
private void FormMain_Resize(object? sender, EventArgs e)
{
if (WindowState != FormWindowState.Minimized)
{
- SplitContainerMain.Visible = true;
- LabelMoving.Visible = false;
- LabelMoving.SendToBack();
+ HideLabelMoving();
}
}
@@ -405,10 +459,28 @@ private void DefaultSettings()
CustomNumericUpDownSettingFallbackDnsPort.Value = (decimal)53;
CustomCheckBoxSettingDontAskCertificate.Checked = false;
CustomCheckBoxSettingDisableAudioAlert.Checked = false;
+ CustomCheckBoxSettingWriteLogWindowToFile.Checked = false;
}
//============================== Buttons
+ private void CustomButtonProcessMonitor_Click(object sender, EventArgs e)
+ {
+ // Check if it's already open
+ Form f = Application.OpenForms[nameof(FormProcessMonitor)];
+ if (f != null)
+ {
+ f.BringToFront();
+ return;
+ }
+
+ FormProcessMonitor formProcessMonitor = new();
+ formProcessMonitor.StartPosition = FormStartPosition.Manual;
+ formProcessMonitor.Location = new Point(MousePosition.X - formProcessMonitor.Width, MousePosition.Y - formProcessMonitor.Height);
+ formProcessMonitor.FormClosing += (s, e) => { formProcessMonitor.Dispose(); };
+ formProcessMonitor.Show();
+ }
+
private void CustomButtonToggleLogView_Click(object sender, EventArgs e)
{
int logHeight = LogHeight;
@@ -437,23 +509,17 @@ private void CustomButtonToggleLogView_Click(object sender, EventArgs e)
private void CustomButtonEditCustomServers_Click(object sender, EventArgs e)
{
- ToolStripItem tsiBrowse = new ToolStripMenuItem("Browse");
- tsiBrowse.Click -= TsiBrowse_Click;
- tsiBrowse.Click += TsiBrowse_Click;
- void TsiBrowse_Click(object? sender, EventArgs e)
- {
- browse();
- }
-
- ToolStripItem tsiEdit = new ToolStripMenuItem("Edit");
- tsiEdit.Click -= TsiEdit_Click;
- tsiEdit.Click += TsiEdit_Click;
- void TsiEdit_Click(object? sender, EventArgs e)
+ ToolStripItem tsiEdit = new ToolStripMenuItem("Manage custom servers");
+ tsiEdit.Font = Font;
+ tsiEdit.Click -= tsiEdit_Click;
+ tsiEdit.Click += tsiEdit_Click;
+ void tsiEdit_Click(object? sender, EventArgs e)
{
edit();
}
ToolStripItem tsiViewWorkingServers = new ToolStripMenuItem("View working servers");
+ tsiViewWorkingServers.Font = Font;
tsiViewWorkingServers.Click -= tsiViewWorkingServers_Click;
tsiViewWorkingServers.Click += tsiViewWorkingServers_Click;
void tsiViewWorkingServers_Click(object? sender, EventArgs e)
@@ -461,83 +527,40 @@ void tsiViewWorkingServers_Click(object? sender, EventArgs e)
viewWorkingServers();
}
+ ToolStripItem tsiClearWorkingServers = new ToolStripMenuItem("Clear working servers");
+ tsiClearWorkingServers.Font = Font;
+ tsiClearWorkingServers.Click -= tsiClearWorkingServers_Click;
+ tsiClearWorkingServers.Click += tsiClearWorkingServers_Click;
+ void tsiClearWorkingServers_Click(object? sender, EventArgs e)
+ {
+ try
+ {
+ File.Delete(SecureDNS.WorkingServersPath);
+ string msg = $"{NL}Working Servers Cleared.{NL}{NL}";
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.MediumSeaGreen));
+ }
+ catch (Exception ex)
+ {
+ CustomMessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
CustomContextMenuStrip cms = new();
+ cms.Font = Font;
cms.Items.Clear();
- cms.Items.Add(tsiBrowse);
cms.Items.Add(tsiEdit);
cms.Items.Add(tsiViewWorkingServers);
+ cms.Items.Add(tsiClearWorkingServers);
Theme.SetColors(cms);
Control b = CustomButtonEditCustomServers;
cms.Show(b, 0, 0);
-
- async void browse()
- {
- if (IsCheckingStarted)
- {
- string msgCheck = $"{NL}Wait for previous task to finish.{NL}{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgCheck, Color.DodgerBlue));
- return;
- }
-
- using OpenFileDialog ofd = new();
- ofd.Filter = "Custom Servers|*.txt";
- ofd.Multiselect = true;
- ofd.RestoreDirectory = true;
-
- if (ofd.ShowDialog() == DialogResult.OK)
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Reading...{NL}", Color.DodgerBlue));
-
- string allContent = string.Empty;
- string[] files = ofd.FileNames;
- for (int n = 0; n < files.Length; n++)
- {
- string file = files[n];
- if (File.Exists(file))
- {
- string content = await File.ReadAllTextAsync(file, new UTF8Encoding(false));
- if (content.Length > 0)
- {
- allContent += content;
- allContent += NL;
- }
- }
- }
-
- if (allContent.Length > 0)
- {
- try
- {
- await FileDirectory.WriteAllTextAsync(SecureDNS.CustomServersPath, allContent, new UTF8Encoding(false));
- CustomRadioButtonBuiltIn.Checked = false;
- CustomRadioButtonCustom.Checked = true;
-
- string msg;
- if (files.Length == 1)
- msg = $"Loaded 1 file to Custom Servers.{NL}";
- else
- msg = $"Loaded {files.Length} files to Custom Servers.{NL}";
-
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.MediumSeaGreen));
-
- }
- catch (Exception ex)
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(ex.Message + NL, Color.IndianRed));
- }
- }
- }
- }
void edit()
{
- FileDirectory.CreateEmptyFile(SecureDNS.CustomServersPath);
- int notepad = ProcessManager.ExecuteOnly(out Process _, "notepad", SecureDNS.CustomServersPath, false, false, SecureDNS.CurrentPath);
- if (notepad == -1)
- {
- string msg = "Notepad is not installed on your system.";
- CustomRichTextBoxLog.AppendText(msg + NL, Color.IndianRed);
- }
+ if (IsInAction(true, true, true, true, true, true, true, true, false, false)) return;
+
+ using FormCustomServers formCustomServers = new();
+ formCustomServers.ShowDialog(this);
}
void viewWorkingServers()
@@ -554,80 +577,57 @@ void viewWorkingServers()
private void CustomButtonCheck_Click(object? sender, EventArgs? e)
{
- StartCheck();
+ if (IsInAction(true, true, true, false, true, true, true, true, true, false)) return;
+ StartCheck(null);
}
- private async void CustomButtonCheckUpdate_Click(object sender, EventArgs e)
+ private async void CustomButtonQuickConnect_Click(object sender, EventArgs e)
{
- await CheckUpdate(true);
+ await StartQuickConnect(null);
}
- private void CustomButtonConnectAll_Click(object sender, EventArgs e)
+ private async void CustomButtonCheckUpdate_Click(object sender, EventArgs e)
{
-
+ if (IsInAction(true, true, false, false, false, false, false, false, false, false)) return;
+ await CheckUpdate(true);
}
private async void CustomButtonWriteSavedServersDelay_Click(object sender, EventArgs e)
{
+ if (IsInAction(true, true, true, true, true, true, true, true, true, false)) return;
await WriteSavedServersDelayToLog();
}
- private void CustomButtonConnect_Click(object? sender, EventArgs? e)
- {
- StartConnect();
- }
-
- private void CustomButtonDPIBasic_Click(object sender, EventArgs e)
- {
- DPIBasic();
- }
-
- private void CustomButtonDPIBasicDeactivate_Click(object sender, EventArgs e)
- {
- DPIDeactive();
- }
-
- private void CustomButtonDPIAdvBlacklist_Click(object sender, EventArgs e)
+ private async void CustomButtonConnect_Click(object? sender, EventArgs? e)
{
- FileDirectory.CreateEmptyFile(SecureDNS.DPIBlacklistPath);
- int notepad = ProcessManager.ExecuteOnly(out Process _, "notepad", SecureDNS.DPIBlacklistPath, false, false, SecureDNS.CurrentPath);
- if (notepad == -1)
- {
- string msg = "Notepad is not installed on your system.";
- CustomRichTextBoxLog.AppendText(msg + NL, Color.IndianRed);
- }
- }
-
- private void CustomButtonDPIAdvActivate_Click(object sender, EventArgs e)
- {
- DPIAdvanced();
- }
-
- private void CustomButtonDPIAdvDeactivate_Click(object sender, EventArgs e)
- {
- DPIDeactive();
+ if (IsInAction(true, true, true, true, false, false, true, true, true, true)) return;
+ await StartConnect(GetConnectMode());
}
private void CustomButtonSetDNS_Click(object sender, EventArgs e)
{
+ if (IsInAction(true, true, true, true, true, true, true, true, true, false)) return;
SetDNS();
}
- private void CustomButtonShare_Click(object sender, EventArgs e)
+ private async void CustomButtonShare_Click(object sender, EventArgs e)
{
- Share();
+ if (IsInAction(true, true, true, true, true, true, true, true, true, true)) return;
+ await StartHttpProxy();
}
private void CustomButtonSetProxy_Click(object sender, EventArgs e)
{
+ if (IsInAction(true, false, false, false, false, false, false, false, true, true)) return;
SetProxy();
}
+
private void CustomButtonPDpiApplyChanges_Click(object sender, EventArgs e)
{
- if (CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Checked && FakeProxyProcess != null)
- ApplyPDpiChangesFakeProxy(FakeProxyProcess);
- if (ProxyProcess != null)
- ApplyPDpiChanges(ProxyProcess);
+ if (CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Checked && FakeHttpProxyProcess != null)
+ ApplyPDpiChangesFakeProxy(FakeHttpProxyProcess);
+ if (HttpProxyProcess != null)
+ ApplyPDpiChanges(HttpProxyProcess);
}
private void CustomButtonPDpiPresetDefault_Click(object sender, EventArgs e)
@@ -645,30 +645,110 @@ private void CustomButtonPDpiPresetDefault_Click(object sender, EventArgs e)
CustomRichTextBoxLog.AppendText(msg2, Color.DodgerBlue);
}
- private void CustomButtonToolsIpScanner_Click(object sender, EventArgs e)
+ private void CustomButtonDPIBasic_Click(object sender, EventArgs e)
{
- FormIpScanner formIpScanner = new();
- formIpScanner.Show();
+ // Activate/Reactivate GoodbyeDPI Basic
+ GoodbyeDPIBasic();
+ }
+
+ private void CustomButtonDPIBasicDeactivate_Click(object sender, EventArgs e)
+ {
+ //Deactivate GoodbyeDPI Basic
+ GoodbyeDPIDeactive(true, false);
+ }
+
+ private void CustomButtonDPIAdvBlacklist_Click(object sender, EventArgs e)
+ {
+ // Edit GoodbyeDPI Advanced Blacklist
+ FileDirectory.CreateEmptyFile(SecureDNS.DPIBlacklistPath);
+ int notepad = ProcessManager.ExecuteOnly(out Process _, "notepad", SecureDNS.DPIBlacklistPath, false, false, SecureDNS.CurrentPath);
+ if (notepad == -1)
+ {
+ string msg = "Notepad is not installed on your system.";
+ CustomRichTextBoxLog.AppendText(msg + NL, Color.IndianRed);
+ }
+ }
+
+ private void CustomButtonDPIAdvActivate_Click(object sender, EventArgs e)
+ {
+ // Activate/Reactivate GoodbyeDPI Advanced
+ GoodbyeDPIAdvanced();
+ }
+
+ private void CustomButtonDPIAdvDeactivate_Click(object sender, EventArgs e)
+ {
+ // Deactivate GoodbyeDPI Advanced
+ GoodbyeDPIDeactive(false, true);
+ }
+
+ private void CustomButtonToolsDnsScanner_Click(object sender, EventArgs e)
+ {
+ // Check if it's already open
+ Form f = Application.OpenForms[nameof(FormDnsScanner)];
+ if (f != null)
+ {
+ f.BringToFront();
+ return;
+ }
+
+ FormDnsScanner formDnsScanner = new();
+ formDnsScanner.StartPosition = FormStartPosition.CenterParent;
+ formDnsScanner.FormClosing += (s, e) => { formDnsScanner.Dispose(); };
+ formDnsScanner.ShowDialog(this);
}
private void CustomButtonToolsDnsLookup_Click(object sender, EventArgs e)
{
FormDnsLookup formDnsLookup = new();
- formDnsLookup.Show();
+ formDnsLookup.FormClosing += (s, e) => { formDnsLookup.Dispose(); };
+ formDnsLookup.Show(this);
}
private void CustomButtonToolsStampReader_Click(object sender, EventArgs e)
{
+ // Check if it's already open
+ Form f = Application.OpenForms[nameof(FormStampReader)];
+ if (f != null)
+ {
+ f.BringToFront();
+ return;
+ }
+
FormStampReader formStampReader = new();
+ formStampReader.FormClosing += (s, e) => { formStampReader.Dispose(); };
formStampReader.Show();
}
private void CustomButtonToolsStampGenerator_Click(object sender, EventArgs e)
{
+ // Check if it's already open
+ Form f = Application.OpenForms[nameof(FormStampGenerator)];
+ if (f != null)
+ {
+ f.BringToFront();
+ return;
+ }
+
FormStampGenerator formStampGenerator = new();
+ formStampGenerator.FormClosing += (s, e) => { formStampGenerator.Dispose(); };
formStampGenerator.Show();
}
+ private void CustomButtonToolsIpScanner_Click(object sender, EventArgs e)
+ {
+ // Check if it's already open
+ Form f = Application.OpenForms[nameof(FormIpScanner)];
+ if (f != null)
+ {
+ f.BringToFront();
+ return;
+ }
+
+ FormIpScanner formIpScanner = new();
+ formIpScanner.FormClosing += (s, e) => { formIpScanner.Dispose(); };
+ formIpScanner.Show();
+ }
+
private void CustomButtonSettingUninstallCertificate_Click(object sender, EventArgs e)
{
UninstallCertificate();
@@ -715,14 +795,14 @@ private void CustomButtonSettingRestoreDefault_Click(object sender, EventArgs e)
CustomRichTextBoxLog.AppendText(msgChecking, Color.IndianRed);
return;
}
-
+
if (IsConnected)
{
string msgConnected = "Disconnect first." + NL;
CustomRichTextBoxLog.AppendText(msgConnected, Color.IndianRed);
return;
}
-
+
if (IsDNSSet)
{
string msgDNSIsSet = "Unset DNS first." + NL;
@@ -736,19 +816,64 @@ private void CustomButtonSettingRestoreDefault_Click(object sender, EventArgs e)
CustomRichTextBoxLog.AppendText(msgDefault, Color.MediumSeaGreen);
}
+ private void CustomButtonExportUserData_Click(object sender, EventArgs e)
+ {
+ using SaveFileDialog sfd = new();
+ sfd.Filter = "SDC User Data (*.sdcud)|*.sdcud";
+ sfd.DefaultExt = ".sdcud";
+ sfd.AddExtension = true;
+ sfd.RestoreDirectory = true;
+ sfd.FileName = $"sdc_user_data_{DateTime.Now.ToString("yyyy.MM.dd-HH.mm.ss", CultureInfo.InvariantCulture)}";
+ if (sfd.ShowDialog() == DialogResult.OK)
+ {
+ try
+ {
+ ZipFile.CreateFromDirectory(SecureDNS.UserDataDirPath, sfd.FileName);
+ CustomMessageBox.Show(this, "Data exported successfully.", "Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ catch (Exception ex)
+ {
+ CustomMessageBox.Show(this, ex.Message, "Export", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+
+ private void CustomButtonImportUserData_Click(object sender, EventArgs e)
+ {
+ using OpenFileDialog ofd = new();
+ ofd.Filter = "SDC User Data (*.sdcud)|*.sdcud";
+ ofd.DefaultExt = ".sdcud";
+ ofd.AddExtension = true;
+ ofd.RestoreDirectory = true;
+ if (ofd.ShowDialog() == DialogResult.OK)
+ {
+ try
+ {
+ ZipFile.ExtractToDirectory(ofd.FileName, SecureDNS.UserDataDirPath, true);
+ string msg = "Data imported seccessfully.\n";
+ msg += "Restart application is required for changes to take effect.";
+ CustomMessageBox.Show(this, msg, "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ catch (Exception ex)
+ {
+ CustomMessageBox.Show(this, ex.Message, "Import", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+
//============================== Events
private void SecureDNSClient_CheckedChanged(object sender, EventArgs e)
{
string msgCommandError = $"Couldn't send command to Http Proxy, try again.{NL}";
if (sender is CustomCheckBox checkBoxR && checkBoxR.Name == CustomCheckBoxHTTPProxyEventShowRequest.Name)
{
- UpdateProxyBools = false;
+ UpdateHttpProxyBools = false;
if (checkBoxR.Checked)
{
string command = "writerequests -true";
- if (IsProxyActivated && ProxyProcess != null)
+ if (IsHttpProxyActivated && HttpProxyProcess != null)
{
- bool isSent = ProcessManager.SendCommand(ProxyProcess, command);
+ bool isSent = ProcessManager.SendCommand(HttpProxyProcess, command);
if (!isSent)
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgCommandError, Color.IndianRed));
}
@@ -756,25 +881,25 @@ private void SecureDNSClient_CheckedChanged(object sender, EventArgs e)
else
{
string command = "writerequests -false";
- if (IsProxyActivated && ProxyProcess != null)
+ if (IsHttpProxyActivated && HttpProxyProcess != null)
{
- bool isSent = ProcessManager.SendCommand(ProxyProcess, command);
+ bool isSent = ProcessManager.SendCommand(HttpProxyProcess, command);
if (!isSent)
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgCommandError, Color.IndianRed));
}
}
- UpdateProxyBools = true;
+ UpdateHttpProxyBools = true;
}
if (sender is CustomCheckBox checkBoxC && checkBoxC.Name == CustomCheckBoxHTTPProxyEventShowChunkDetails.Name)
{
- UpdateProxyBools = false;
+ UpdateHttpProxyBools = false;
if (checkBoxC.Checked)
{
string command = "writechunkdetails -true";
- if (IsProxyActivated && ProxyProcess != null)
+ if (IsHttpProxyActivated && HttpProxyProcess != null)
{
- bool isSent = ProcessManager.SendCommand(ProxyProcess, command);
+ bool isSent = ProcessManager.SendCommand(HttpProxyProcess, command);
if (!isSent)
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgCommandError, Color.IndianRed));
}
@@ -782,16 +907,16 @@ private void SecureDNSClient_CheckedChanged(object sender, EventArgs e)
else
{
string command = "writechunkdetails -false";
- if (IsProxyActivated && ProxyProcess != null)
+ if (IsHttpProxyActivated && HttpProxyProcess != null)
{
- bool isSent = ProcessManager.SendCommand(ProxyProcess, command);
+ bool isSent = ProcessManager.SendCommand(HttpProxyProcess, command);
if (!isSent)
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgCommandError, Color.IndianRed));
}
}
- UpdateProxyBools = true;
+ UpdateHttpProxyBools = true;
}
-
+
if (AppSettings == null) return;
if (sender is CustomRadioButton crbBuiltIn && crbBuiltIn.Name == CustomRadioButtonBuiltIn.Name)
@@ -824,174 +949,13 @@ private void NotifyIconMain_MouseClick(object sender, MouseEventArgs e)
if (e.Button == MouseButtons.Left)
{
this.SetDarkTitleBar(true); // Just in case
- if (!Visible) Show();
+ Show();
BringToFront();
}
else if (e.Button == MouseButtons.Right)
{
- CustomContextMenuStripIcon.Show();
- }
- }
-
- private async void ToolStripMenuItemIcon_Click(object? sender, EventArgs e)
- {
- if (IsExiting) return;
- IsExiting = true;
-
- // Write Closing message to log
- string msg = "Exiting...";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg + NL, Color.LightGray));
- NotifyIconMain.BalloonTipText = msg;
- NotifyIconMain.ShowBalloonTip(500);
-
- // Deactivate GoodbyeDPI
- if (IsGoodbyeDPIActive)
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Deactivating GoodbyeDPI...{NL}", Color.LightGray));
- ProcessManager.KillProcessByPID(PIDGoodbyeDPI);
-
- // Wait
- Task wait1 = Task.Run(async () =>
- {
- while (ProcessManager.FindProcessByPID(PIDGoodbyeDPI))
- {
- if (!ProcessManager.FindProcessByPID(PIDGoodbyeDPI))
- break;
- await Task.Delay(50);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
- }
-
- // Deactivate GoodbyeDPIBypass (Connect Method 3)
- if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBypass))
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Deactivating GoodbyeDPI Bypass...{NL}", Color.LightGray));
- ProcessManager.KillProcessByPID(PIDGoodbyeDPIBypass);
-
- // Wait
- Task wait1 = Task.Run(async () =>
- {
- while (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBypass))
- {
- if (!ProcessManager.FindProcessByPID(PIDGoodbyeDPIBypass))
- break;
- await Task.Delay(50);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
- }
-
- // Unset Proxy
- if (IsProxySet)
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Unsetting Proxy...{NL}", Color.LightGray));
- Network.UnsetProxy(false, false);
-
- // Wait
- Task wait1 = Task.Run(async () =>
- {
- while (IsProxySet)
- {
- if (!IsProxySet)
- break;
- await Task.Delay(50);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
- }
-
- // Deactivate Proxy
- if (IsProxyActivated || IsProxyActivating)
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Deactivating Proxy...{NL}", Color.LightGray));
- ProcessManager.KillProcessByPID(PIDHttpProxy);
-
- // Wait
- Task wait1 = Task.Run(async () =>
- {
- while (ProcessManager.FindProcessByPID(PIDHttpProxy))
- {
- if (!ProcessManager.FindProcessByPID(PIDHttpProxy))
- break;
- await Task.Delay(50);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
+ ShowMainContextMenu();
}
-
- // Deactivate Fake Proxy
- if (ProcessManager.FindProcessByPID(PIDFakeProxy))
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Deactivating Fake Proxy...{NL}", Color.LightGray));
- ProcessManager.KillProcessByPID(PIDFakeProxy);
-
- // Wait
- Task wait1 = Task.Run(async () =>
- {
- while (ProcessManager.FindProcessByPID(PIDFakeProxy))
- {
- if (!ProcessManager.FindProcessByPID(PIDFakeProxy))
- break;
- await Task.Delay(50);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
- }
-
- // Unset DNS
- if (IsDNSSet || IsDNSSetting)
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Unsetting DNS...{NL}", Color.LightGray));
- await Task.Run(() => UnsetSavedDNS());
- IsDNSSet = false;
- }
-
- // Disconnect - Kill all processes
- if (IsConnected || IsConnecting)
- {
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Disconnecting...{NL}", Color.LightGray));
- await Task.Run(() => KillAll());
-
- // Wait
- Task wait1 = Task.Run(async () =>
- {
- while (IsConnected)
- {
- if (!IsConnected)
- break;
- await Task.Delay(50);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
- }
-
- // Flush DNS On Exit
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Flushing DNS...{NL}", Color.LightGray));
- await Task.Run(() => FlushDnsOnExit());
-
- // Select Control type and properties to save
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Saving Settings...{NL}", Color.LightGray));
- AppSettings.AddSelectedControlAndProperty(typeof(CustomCheckBox), "Checked");
- AppSettings.AddSelectedControlAndProperty(typeof(CustomNumericUpDown), "Value");
- AppSettings.AddSelectedControlAndProperty(typeof(CustomRadioButton), "Checked");
- AppSettings.AddSelectedControlAndProperty(typeof(CustomTextBox), "Text");
- AppSettings.AddSelectedControlAndProperty(typeof(CustomTextBox), "Texts");
- AppSettings.AddSelectedControlAndProperty(typeof(CustomComboBox), "SelectedIndex");
-
- // Add Settings to save
- AppSettings.AddSelectedSettings(this);
-
- // Save Application Settings
- await AppSettings.SaveAsync(SecureDNS.SettingsXmlPath);
-
- // Hide NotifyIcon
- NotifyIconMain.Visible = false;
-
- // Exit
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Goodbye.{NL}", Color.LightGray));
- Environment.Exit(0);
- Application.Exit();
}
//============================== About
diff --git a/SecureDNSClient/Forms/FormMain.resx b/SecureDNSClient/Forms/FormMain.resx
index 661e379..2b79488 100644
--- a/SecureDNSClient/Forms/FormMain.resx
+++ b/SecureDNSClient/Forms/FormMain.resx
@@ -1,4 +1,64 @@
-
+
+
+
diff --git a/SecureDNSClient/Forms/FormStampGenerator.Designer.cs b/SecureDNSClient/Forms/FormStampGenerator.Designer.cs
index 19dbf87..eb1cb5c 100644
--- a/SecureDNSClient/Forms/FormStampGenerator.Designer.cs
+++ b/SecureDNSClient/Forms/FormStampGenerator.Designer.cs
@@ -29,543 +29,519 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormStampGenerator));
- this.CustomLabelProtocol = new CustomControls.CustomLabel();
- this.CustomComboBoxProtocol = new CustomControls.CustomComboBox();
- this.CustomLabelIP = new CustomControls.CustomLabel();
- this.CustomTextBoxIP = new CustomControls.CustomTextBox();
- this.CustomLabelHost = new CustomControls.CustomLabel();
- this.CustomTextBoxHost = new CustomControls.CustomTextBox();
- this.CustomLabelPort = new CustomControls.CustomLabel();
- this.CustomNumericUpDownPort = new CustomControls.CustomNumericUpDown();
- this.CustomLabelPath = new CustomControls.CustomLabel();
- this.CustomTextBoxPath = new CustomControls.CustomTextBox();
- this.CustomLabelProviderName = new CustomControls.CustomLabel();
- this.CustomTextBoxProviderName = new CustomControls.CustomTextBox();
- this.CustomLabelPublicKey = new CustomControls.CustomLabel();
- this.CustomTextBoxPublicKey = new CustomControls.CustomTextBox();
- this.CustomLabelHash = new CustomControls.CustomLabel();
- this.CustomTextBoxHash = new CustomControls.CustomTextBox();
- this.CustomCheckBoxIsDnsSec = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxIsNoFilter = new CustomControls.CustomCheckBox();
- this.CustomCheckBoxIsNoLog = new CustomControls.CustomCheckBox();
- this.CustomTextBoxStamp = new CustomControls.CustomTextBox();
- this.CustomButtonClear = new CustomControls.CustomButton();
- this.CustomButtonDecode = new CustomControls.CustomButton();
- this.CustomLabelStatus = new CustomControls.CustomLabel();
- this.CustomButtonEncode = new CustomControls.CustomButton();
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPort)).BeginInit();
- this.SuspendLayout();
+ CustomLabelProtocol = new CustomControls.CustomLabel();
+ CustomComboBoxProtocol = new CustomControls.CustomComboBox();
+ CustomLabelIP = new CustomControls.CustomLabel();
+ CustomTextBoxIP = new CustomControls.CustomTextBox();
+ CustomLabelHost = new CustomControls.CustomLabel();
+ CustomTextBoxHost = new CustomControls.CustomTextBox();
+ CustomLabelPort = new CustomControls.CustomLabel();
+ CustomNumericUpDownPort = new CustomControls.CustomNumericUpDown();
+ CustomLabelPath = new CustomControls.CustomLabel();
+ CustomTextBoxPath = new CustomControls.CustomTextBox();
+ CustomLabelProviderName = new CustomControls.CustomLabel();
+ CustomTextBoxProviderName = new CustomControls.CustomTextBox();
+ CustomLabelPublicKey = new CustomControls.CustomLabel();
+ CustomTextBoxPublicKey = new CustomControls.CustomTextBox();
+ CustomLabelHash = new CustomControls.CustomLabel();
+ CustomTextBoxHash = new CustomControls.CustomTextBox();
+ CustomCheckBoxIsDnsSec = new CustomControls.CustomCheckBox();
+ CustomCheckBoxIsNoFilter = new CustomControls.CustomCheckBox();
+ CustomCheckBoxIsNoLog = new CustomControls.CustomCheckBox();
+ CustomTextBoxStamp = new CustomControls.CustomTextBox();
+ CustomButtonClear = new CustomControls.CustomButton();
+ CustomButtonDecode = new CustomControls.CustomButton();
+ CustomLabelStatus = new CustomControls.CustomLabel();
+ CustomButtonEncode = new CustomControls.CustomButton();
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPort).BeginInit();
+ SuspendLayout();
//
// CustomLabelProtocol
//
- this.CustomLabelProtocol.AutoSize = true;
- this.CustomLabelProtocol.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelProtocol.Border = false;
- this.CustomLabelProtocol.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelProtocol.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelProtocol.ForeColor = System.Drawing.Color.White;
- this.CustomLabelProtocol.Location = new System.Drawing.Point(12, 10);
- this.CustomLabelProtocol.Name = "CustomLabelProtocol";
- this.CustomLabelProtocol.RoundedCorners = 0;
- this.CustomLabelProtocol.Size = new System.Drawing.Size(57, 17);
- this.CustomLabelProtocol.TabIndex = 0;
- this.CustomLabelProtocol.Text = "Protocol:";
+ CustomLabelProtocol.AutoSize = true;
+ CustomLabelProtocol.BackColor = Color.DimGray;
+ CustomLabelProtocol.Border = false;
+ CustomLabelProtocol.BorderColor = Color.Blue;
+ CustomLabelProtocol.FlatStyle = FlatStyle.Flat;
+ CustomLabelProtocol.ForeColor = Color.White;
+ CustomLabelProtocol.Location = new Point(12, 10);
+ CustomLabelProtocol.Name = "CustomLabelProtocol";
+ CustomLabelProtocol.RoundedCorners = 0;
+ CustomLabelProtocol.Size = new Size(57, 17);
+ CustomLabelProtocol.TabIndex = 0;
+ CustomLabelProtocol.Text = "Protocol:";
//
// CustomComboBoxProtocol
//
- this.CustomComboBoxProtocol.BackColor = System.Drawing.Color.DimGray;
- this.CustomComboBoxProtocol.BorderColor = System.Drawing.Color.Blue;
- this.CustomComboBoxProtocol.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
- this.CustomComboBoxProtocol.ForeColor = System.Drawing.Color.White;
- this.CustomComboBoxProtocol.FormattingEnabled = true;
- this.CustomComboBoxProtocol.ItemHeight = 17;
- this.CustomComboBoxProtocol.Items.AddRange(new object[] {
- "Plain DNS",
- "DNSCrypt",
- "DNS-Over-HTTPS",
- "DNS-Over-TLS",
- "DNS-Over-Quic",
- "Oblivious DoH Target",
- "Anonymized DNSCrypt Relay",
- "Oblivious DoH Relay"});
- this.CustomComboBoxProtocol.Location = new System.Drawing.Point(75, 8);
- this.CustomComboBoxProtocol.Name = "CustomComboBoxProtocol";
- this.CustomComboBoxProtocol.SelectionColor = System.Drawing.Color.DodgerBlue;
- this.CustomComboBoxProtocol.Size = new System.Drawing.Size(287, 23);
- this.CustomComboBoxProtocol.TabIndex = 1;
- this.CustomComboBoxProtocol.SelectedIndexChanged += new System.EventHandler(this.CustomComboBoxProtocol_SelectedIndexChanged);
+ CustomComboBoxProtocol.BackColor = Color.DimGray;
+ CustomComboBoxProtocol.BorderColor = Color.Blue;
+ CustomComboBoxProtocol.DrawMode = DrawMode.OwnerDrawVariable;
+ CustomComboBoxProtocol.ForeColor = Color.White;
+ CustomComboBoxProtocol.FormattingEnabled = true;
+ CustomComboBoxProtocol.ItemHeight = 17;
+ CustomComboBoxProtocol.Items.AddRange(new object[] { "Plain DNS", "DNSCrypt", "DNS-Over-HTTPS", "DNS-Over-TLS", "DNS-Over-Quic", "Oblivious DoH Target", "Anonymized DNSCrypt Relay", "Oblivious DoH Relay" });
+ CustomComboBoxProtocol.Location = new Point(75, 8);
+ CustomComboBoxProtocol.Name = "CustomComboBoxProtocol";
+ CustomComboBoxProtocol.SelectionColor = Color.DodgerBlue;
+ CustomComboBoxProtocol.Size = new Size(287, 23);
+ CustomComboBoxProtocol.TabIndex = 1;
+ CustomComboBoxProtocol.SelectedIndexChanged += CustomComboBoxProtocol_SelectedIndexChanged;
//
// CustomLabelIP
//
- this.CustomLabelIP.AutoSize = true;
- this.CustomLabelIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelIP.Border = false;
- this.CustomLabelIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelIP.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelIP.ForeColor = System.Drawing.Color.White;
- this.CustomLabelIP.Location = new System.Drawing.Point(12, 50);
- this.CustomLabelIP.Name = "CustomLabelIP";
- this.CustomLabelIP.RoundedCorners = 0;
- this.CustomLabelIP.Size = new System.Drawing.Size(274, 17);
- this.CustomLabelIP.TabIndex = 2;
- this.CustomLabelIP.Text = "IP Address (IPv6 addresses must be in [ ] brackets):";
+ CustomLabelIP.AutoSize = true;
+ CustomLabelIP.BackColor = Color.DimGray;
+ CustomLabelIP.Border = false;
+ CustomLabelIP.BorderColor = Color.Blue;
+ CustomLabelIP.FlatStyle = FlatStyle.Flat;
+ CustomLabelIP.ForeColor = Color.White;
+ CustomLabelIP.Location = new Point(12, 50);
+ CustomLabelIP.Name = "CustomLabelIP";
+ CustomLabelIP.RoundedCorners = 0;
+ CustomLabelIP.Size = new Size(274, 17);
+ CustomLabelIP.TabIndex = 2;
+ CustomLabelIP.Text = "IP Address (IPv6 addresses must be in [ ] brackets):";
//
// CustomTextBoxIP
//
- this.CustomTextBoxIP.AcceptsReturn = false;
- this.CustomTextBoxIP.AcceptsTab = false;
- this.CustomTextBoxIP.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxIP.Border = true;
- this.CustomTextBoxIP.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxIP.BorderSize = 1;
- this.CustomTextBoxIP.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxIP.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxIP.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxIP.HideSelection = true;
- this.CustomTextBoxIP.Location = new System.Drawing.Point(12, 70);
- this.CustomTextBoxIP.MaxLength = 32767;
- this.CustomTextBoxIP.Multiline = false;
- this.CustomTextBoxIP.Name = "CustomTextBoxIP";
- this.CustomTextBoxIP.ReadOnly = false;
- this.CustomTextBoxIP.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxIP.ShortcutsEnabled = true;
- this.CustomTextBoxIP.Size = new System.Drawing.Size(350, 23);
- this.CustomTextBoxIP.TabIndex = 0;
- this.CustomTextBoxIP.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxIP.Texts = "";
- this.CustomTextBoxIP.UnderlinedStyle = true;
- this.CustomTextBoxIP.UsePasswordChar = false;
- this.CustomTextBoxIP.WordWrap = true;
+ CustomTextBoxIP.AcceptsReturn = false;
+ CustomTextBoxIP.AcceptsTab = false;
+ CustomTextBoxIP.BackColor = Color.DimGray;
+ CustomTextBoxIP.Border = true;
+ CustomTextBoxIP.BorderColor = Color.Blue;
+ CustomTextBoxIP.BorderSize = 1;
+ CustomTextBoxIP.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxIP.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxIP.ForeColor = Color.White;
+ CustomTextBoxIP.HideSelection = true;
+ CustomTextBoxIP.Location = new Point(12, 70);
+ CustomTextBoxIP.MaxLength = 32767;
+ CustomTextBoxIP.Multiline = false;
+ CustomTextBoxIP.Name = "CustomTextBoxIP";
+ CustomTextBoxIP.ReadOnly = false;
+ CustomTextBoxIP.ScrollBars = ScrollBars.None;
+ CustomTextBoxIP.ShortcutsEnabled = true;
+ CustomTextBoxIP.Size = new Size(350, 23);
+ CustomTextBoxIP.TabIndex = 0;
+ CustomTextBoxIP.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxIP.Texts = "";
+ CustomTextBoxIP.UnderlinedStyle = true;
+ CustomTextBoxIP.UsePasswordChar = false;
+ CustomTextBoxIP.WordWrap = true;
//
// CustomLabelHost
//
- this.CustomLabelHost.AutoSize = true;
- this.CustomLabelHost.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelHost.Border = false;
- this.CustomLabelHost.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelHost.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelHost.ForeColor = System.Drawing.Color.White;
- this.CustomLabelHost.Location = new System.Drawing.Point(12, 110);
- this.CustomLabelHost.Name = "CustomLabelHost";
- this.CustomLabelHost.RoundedCorners = 0;
- this.CustomLabelHost.Size = new System.Drawing.Size(140, 17);
- this.CustomLabelHost.TabIndex = 4;
- this.CustomLabelHost.Text = "Host Name (vHost+SNI):";
+ CustomLabelHost.AutoSize = true;
+ CustomLabelHost.BackColor = Color.DimGray;
+ CustomLabelHost.Border = false;
+ CustomLabelHost.BorderColor = Color.Blue;
+ CustomLabelHost.FlatStyle = FlatStyle.Flat;
+ CustomLabelHost.ForeColor = Color.White;
+ CustomLabelHost.Location = new Point(12, 110);
+ CustomLabelHost.Name = "CustomLabelHost";
+ CustomLabelHost.RoundedCorners = 0;
+ CustomLabelHost.Size = new Size(140, 17);
+ CustomLabelHost.TabIndex = 4;
+ CustomLabelHost.Text = "Host Name (vHost+SNI):";
//
// CustomTextBoxHost
//
- this.CustomTextBoxHost.AcceptsReturn = false;
- this.CustomTextBoxHost.AcceptsTab = false;
- this.CustomTextBoxHost.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxHost.Border = true;
- this.CustomTextBoxHost.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxHost.BorderSize = 1;
- this.CustomTextBoxHost.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxHost.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxHost.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxHost.HideSelection = true;
- this.CustomTextBoxHost.Location = new System.Drawing.Point(12, 130);
- this.CustomTextBoxHost.MaxLength = 32767;
- this.CustomTextBoxHost.Multiline = false;
- this.CustomTextBoxHost.Name = "CustomTextBoxHost";
- this.CustomTextBoxHost.ReadOnly = false;
- this.CustomTextBoxHost.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxHost.ShortcutsEnabled = true;
- this.CustomTextBoxHost.Size = new System.Drawing.Size(350, 23);
- this.CustomTextBoxHost.TabIndex = 0;
- this.CustomTextBoxHost.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxHost.Texts = "";
- this.CustomTextBoxHost.UnderlinedStyle = true;
- this.CustomTextBoxHost.UsePasswordChar = false;
- this.CustomTextBoxHost.WordWrap = true;
+ CustomTextBoxHost.AcceptsReturn = false;
+ CustomTextBoxHost.AcceptsTab = false;
+ CustomTextBoxHost.BackColor = Color.DimGray;
+ CustomTextBoxHost.Border = true;
+ CustomTextBoxHost.BorderColor = Color.Blue;
+ CustomTextBoxHost.BorderSize = 1;
+ CustomTextBoxHost.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxHost.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxHost.ForeColor = Color.White;
+ CustomTextBoxHost.HideSelection = true;
+ CustomTextBoxHost.Location = new Point(12, 130);
+ CustomTextBoxHost.MaxLength = 32767;
+ CustomTextBoxHost.Multiline = false;
+ CustomTextBoxHost.Name = "CustomTextBoxHost";
+ CustomTextBoxHost.ReadOnly = false;
+ CustomTextBoxHost.ScrollBars = ScrollBars.None;
+ CustomTextBoxHost.ShortcutsEnabled = true;
+ CustomTextBoxHost.Size = new Size(350, 23);
+ CustomTextBoxHost.TabIndex = 0;
+ CustomTextBoxHost.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxHost.Texts = "";
+ CustomTextBoxHost.UnderlinedStyle = true;
+ CustomTextBoxHost.UsePasswordChar = false;
+ CustomTextBoxHost.WordWrap = true;
//
// CustomLabelPort
//
- this.CustomLabelPort.AutoSize = true;
- this.CustomLabelPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPort.Border = false;
- this.CustomLabelPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPort.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPort.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPort.Location = new System.Drawing.Point(12, 170);
- this.CustomLabelPort.Name = "CustomLabelPort";
- this.CustomLabelPort.RoundedCorners = 0;
- this.CustomLabelPort.Size = new System.Drawing.Size(81, 17);
- this.CustomLabelPort.TabIndex = 7;
- this.CustomLabelPort.Text = "Port Number:";
+ CustomLabelPort.AutoSize = true;
+ CustomLabelPort.BackColor = Color.DimGray;
+ CustomLabelPort.Border = false;
+ CustomLabelPort.BorderColor = Color.Blue;
+ CustomLabelPort.FlatStyle = FlatStyle.Flat;
+ CustomLabelPort.ForeColor = Color.White;
+ CustomLabelPort.Location = new Point(12, 170);
+ CustomLabelPort.Name = "CustomLabelPort";
+ CustomLabelPort.RoundedCorners = 0;
+ CustomLabelPort.Size = new Size(81, 17);
+ CustomLabelPort.TabIndex = 7;
+ CustomLabelPort.Text = "Port Number:";
//
// CustomNumericUpDownPort
//
- this.CustomNumericUpDownPort.BackColor = System.Drawing.Color.DimGray;
- this.CustomNumericUpDownPort.BorderColor = System.Drawing.Color.Blue;
- this.CustomNumericUpDownPort.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.CustomNumericUpDownPort.Location = new System.Drawing.Point(99, 168);
- this.CustomNumericUpDownPort.Maximum = new decimal(new int[] {
- 65535,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownPort.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.CustomNumericUpDownPort.Name = "CustomNumericUpDownPort";
- this.CustomNumericUpDownPort.Size = new System.Drawing.Size(80, 23);
- this.CustomNumericUpDownPort.TabIndex = 8;
- this.CustomNumericUpDownPort.Value = new decimal(new int[] {
- 53,
- 0,
- 0,
- 0});
+ CustomNumericUpDownPort.BackColor = Color.DimGray;
+ CustomNumericUpDownPort.BorderColor = Color.Blue;
+ CustomNumericUpDownPort.BorderStyle = BorderStyle.FixedSingle;
+ CustomNumericUpDownPort.Location = new Point(99, 168);
+ CustomNumericUpDownPort.Maximum = new decimal(new int[] { 65535, 0, 0, 0 });
+ CustomNumericUpDownPort.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
+ CustomNumericUpDownPort.Name = "CustomNumericUpDownPort";
+ CustomNumericUpDownPort.Size = new Size(80, 23);
+ CustomNumericUpDownPort.TabIndex = 8;
+ CustomNumericUpDownPort.Value = new decimal(new int[] { 53, 0, 0, 0 });
//
// CustomLabelPath
//
- this.CustomLabelPath.AutoSize = true;
- this.CustomLabelPath.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPath.Border = false;
- this.CustomLabelPath.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPath.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPath.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPath.Location = new System.Drawing.Point(12, 210);
- this.CustomLabelPath.Name = "CustomLabelPath";
- this.CustomLabelPath.RoundedCorners = 0;
- this.CustomLabelPath.Size = new System.Drawing.Size(121, 17);
- this.CustomLabelPath.TabIndex = 9;
- this.CustomLabelPath.Text = "Path (Can be empty):";
+ CustomLabelPath.AutoSize = true;
+ CustomLabelPath.BackColor = Color.DimGray;
+ CustomLabelPath.Border = false;
+ CustomLabelPath.BorderColor = Color.Blue;
+ CustomLabelPath.FlatStyle = FlatStyle.Flat;
+ CustomLabelPath.ForeColor = Color.White;
+ CustomLabelPath.Location = new Point(12, 210);
+ CustomLabelPath.Name = "CustomLabelPath";
+ CustomLabelPath.RoundedCorners = 0;
+ CustomLabelPath.Size = new Size(121, 17);
+ CustomLabelPath.TabIndex = 9;
+ CustomLabelPath.Text = "Path (Can be empty):";
//
// CustomTextBoxPath
//
- this.CustomTextBoxPath.AcceptsReturn = false;
- this.CustomTextBoxPath.AcceptsTab = false;
- this.CustomTextBoxPath.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxPath.Border = true;
- this.CustomTextBoxPath.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxPath.BorderSize = 1;
- this.CustomTextBoxPath.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxPath.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxPath.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxPath.HideSelection = true;
- this.CustomTextBoxPath.Location = new System.Drawing.Point(139, 208);
- this.CustomTextBoxPath.MaxLength = 32767;
- this.CustomTextBoxPath.Multiline = false;
- this.CustomTextBoxPath.Name = "CustomTextBoxPath";
- this.CustomTextBoxPath.ReadOnly = false;
- this.CustomTextBoxPath.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxPath.ShortcutsEnabled = true;
- this.CustomTextBoxPath.Size = new System.Drawing.Size(223, 23);
- this.CustomTextBoxPath.TabIndex = 0;
- this.CustomTextBoxPath.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxPath.Texts = "";
- this.CustomTextBoxPath.UnderlinedStyle = true;
- this.CustomTextBoxPath.UsePasswordChar = false;
- this.CustomTextBoxPath.WordWrap = true;
+ CustomTextBoxPath.AcceptsReturn = false;
+ CustomTextBoxPath.AcceptsTab = false;
+ CustomTextBoxPath.BackColor = Color.DimGray;
+ CustomTextBoxPath.Border = true;
+ CustomTextBoxPath.BorderColor = Color.Blue;
+ CustomTextBoxPath.BorderSize = 1;
+ CustomTextBoxPath.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxPath.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxPath.ForeColor = Color.White;
+ CustomTextBoxPath.HideSelection = true;
+ CustomTextBoxPath.Location = new Point(139, 208);
+ CustomTextBoxPath.MaxLength = 32767;
+ CustomTextBoxPath.Multiline = false;
+ CustomTextBoxPath.Name = "CustomTextBoxPath";
+ CustomTextBoxPath.ReadOnly = false;
+ CustomTextBoxPath.ScrollBars = ScrollBars.None;
+ CustomTextBoxPath.ShortcutsEnabled = true;
+ CustomTextBoxPath.Size = new Size(223, 23);
+ CustomTextBoxPath.TabIndex = 0;
+ CustomTextBoxPath.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxPath.Texts = "";
+ CustomTextBoxPath.UnderlinedStyle = true;
+ CustomTextBoxPath.UsePasswordChar = false;
+ CustomTextBoxPath.WordWrap = true;
//
// CustomLabelProviderName
//
- this.CustomLabelProviderName.AutoSize = true;
- this.CustomLabelProviderName.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelProviderName.Border = false;
- this.CustomLabelProviderName.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelProviderName.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelProviderName.ForeColor = System.Drawing.Color.White;
- this.CustomLabelProviderName.Location = new System.Drawing.Point(407, 50);
- this.CustomLabelProviderName.Name = "CustomLabelProviderName";
- this.CustomLabelProviderName.RoundedCorners = 0;
- this.CustomLabelProviderName.Size = new System.Drawing.Size(91, 17);
- this.CustomLabelProviderName.TabIndex = 12;
- this.CustomLabelProviderName.Text = "Provider Name:";
+ CustomLabelProviderName.AutoSize = true;
+ CustomLabelProviderName.BackColor = Color.DimGray;
+ CustomLabelProviderName.Border = false;
+ CustomLabelProviderName.BorderColor = Color.Blue;
+ CustomLabelProviderName.FlatStyle = FlatStyle.Flat;
+ CustomLabelProviderName.ForeColor = Color.White;
+ CustomLabelProviderName.Location = new Point(407, 50);
+ CustomLabelProviderName.Name = "CustomLabelProviderName";
+ CustomLabelProviderName.RoundedCorners = 0;
+ CustomLabelProviderName.Size = new Size(91, 17);
+ CustomLabelProviderName.TabIndex = 12;
+ CustomLabelProviderName.Text = "Provider Name:";
//
// CustomTextBoxProviderName
//
- this.CustomTextBoxProviderName.AcceptsReturn = false;
- this.CustomTextBoxProviderName.AcceptsTab = false;
- this.CustomTextBoxProviderName.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxProviderName.Border = true;
- this.CustomTextBoxProviderName.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxProviderName.BorderSize = 1;
- this.CustomTextBoxProviderName.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxProviderName.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxProviderName.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxProviderName.HideSelection = true;
- this.CustomTextBoxProviderName.Location = new System.Drawing.Point(407, 70);
- this.CustomTextBoxProviderName.MaxLength = 32767;
- this.CustomTextBoxProviderName.Multiline = false;
- this.CustomTextBoxProviderName.Name = "CustomTextBoxProviderName";
- this.CustomTextBoxProviderName.ReadOnly = false;
- this.CustomTextBoxProviderName.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxProviderName.ShortcutsEnabled = true;
- this.CustomTextBoxProviderName.Size = new System.Drawing.Size(350, 23);
- this.CustomTextBoxProviderName.TabIndex = 0;
- this.CustomTextBoxProviderName.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxProviderName.Texts = "";
- this.CustomTextBoxProviderName.UnderlinedStyle = true;
- this.CustomTextBoxProviderName.UsePasswordChar = false;
- this.CustomTextBoxProviderName.WordWrap = true;
+ CustomTextBoxProviderName.AcceptsReturn = false;
+ CustomTextBoxProviderName.AcceptsTab = false;
+ CustomTextBoxProviderName.BackColor = Color.DimGray;
+ CustomTextBoxProviderName.Border = true;
+ CustomTextBoxProviderName.BorderColor = Color.Blue;
+ CustomTextBoxProviderName.BorderSize = 1;
+ CustomTextBoxProviderName.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxProviderName.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxProviderName.ForeColor = Color.White;
+ CustomTextBoxProviderName.HideSelection = true;
+ CustomTextBoxProviderName.Location = new Point(407, 70);
+ CustomTextBoxProviderName.MaxLength = 32767;
+ CustomTextBoxProviderName.Multiline = false;
+ CustomTextBoxProviderName.Name = "CustomTextBoxProviderName";
+ CustomTextBoxProviderName.ReadOnly = false;
+ CustomTextBoxProviderName.ScrollBars = ScrollBars.None;
+ CustomTextBoxProviderName.ShortcutsEnabled = true;
+ CustomTextBoxProviderName.Size = new Size(350, 23);
+ CustomTextBoxProviderName.TabIndex = 0;
+ CustomTextBoxProviderName.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxProviderName.Texts = "";
+ CustomTextBoxProviderName.UnderlinedStyle = true;
+ CustomTextBoxProviderName.UsePasswordChar = false;
+ CustomTextBoxProviderName.WordWrap = true;
//
// CustomLabelPublicKey
//
- this.CustomLabelPublicKey.AutoSize = true;
- this.CustomLabelPublicKey.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelPublicKey.Border = false;
- this.CustomLabelPublicKey.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelPublicKey.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelPublicKey.ForeColor = System.Drawing.Color.White;
- this.CustomLabelPublicKey.Location = new System.Drawing.Point(407, 110);
- this.CustomLabelPublicKey.Name = "CustomLabelPublicKey";
- this.CustomLabelPublicKey.RoundedCorners = 0;
- this.CustomLabelPublicKey.Size = new System.Drawing.Size(355, 17);
- this.CustomLabelPublicKey.TabIndex = 15;
- this.CustomLabelPublicKey.Text = "Public Key (DNSCrypt provider’s Ed25519 public key) (HEX String):";
+ CustomLabelPublicKey.AutoSize = true;
+ CustomLabelPublicKey.BackColor = Color.DimGray;
+ CustomLabelPublicKey.Border = false;
+ CustomLabelPublicKey.BorderColor = Color.Blue;
+ CustomLabelPublicKey.FlatStyle = FlatStyle.Flat;
+ CustomLabelPublicKey.ForeColor = Color.White;
+ CustomLabelPublicKey.Location = new Point(407, 110);
+ CustomLabelPublicKey.Name = "CustomLabelPublicKey";
+ CustomLabelPublicKey.RoundedCorners = 0;
+ CustomLabelPublicKey.Size = new Size(355, 17);
+ CustomLabelPublicKey.TabIndex = 15;
+ CustomLabelPublicKey.Text = "Public Key (DNSCrypt provider’s Ed25519 public key) (HEX String):";
//
// CustomTextBoxPublicKey
//
- this.CustomTextBoxPublicKey.AcceptsReturn = false;
- this.CustomTextBoxPublicKey.AcceptsTab = false;
- this.CustomTextBoxPublicKey.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxPublicKey.Border = true;
- this.CustomTextBoxPublicKey.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxPublicKey.BorderSize = 1;
- this.CustomTextBoxPublicKey.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxPublicKey.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxPublicKey.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxPublicKey.HideSelection = true;
- this.CustomTextBoxPublicKey.Location = new System.Drawing.Point(407, 130);
- this.CustomTextBoxPublicKey.MaxLength = 32767;
- this.CustomTextBoxPublicKey.Multiline = false;
- this.CustomTextBoxPublicKey.Name = "CustomTextBoxPublicKey";
- this.CustomTextBoxPublicKey.ReadOnly = false;
- this.CustomTextBoxPublicKey.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxPublicKey.ShortcutsEnabled = true;
- this.CustomTextBoxPublicKey.Size = new System.Drawing.Size(350, 23);
- this.CustomTextBoxPublicKey.TabIndex = 0;
- this.CustomTextBoxPublicKey.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxPublicKey.Texts = "";
- this.CustomTextBoxPublicKey.UnderlinedStyle = true;
- this.CustomTextBoxPublicKey.UsePasswordChar = false;
- this.CustomTextBoxPublicKey.WordWrap = true;
+ CustomTextBoxPublicKey.AcceptsReturn = false;
+ CustomTextBoxPublicKey.AcceptsTab = false;
+ CustomTextBoxPublicKey.BackColor = Color.DimGray;
+ CustomTextBoxPublicKey.Border = true;
+ CustomTextBoxPublicKey.BorderColor = Color.Blue;
+ CustomTextBoxPublicKey.BorderSize = 1;
+ CustomTextBoxPublicKey.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxPublicKey.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxPublicKey.ForeColor = Color.White;
+ CustomTextBoxPublicKey.HideSelection = true;
+ CustomTextBoxPublicKey.Location = new Point(407, 130);
+ CustomTextBoxPublicKey.MaxLength = 32767;
+ CustomTextBoxPublicKey.Multiline = false;
+ CustomTextBoxPublicKey.Name = "CustomTextBoxPublicKey";
+ CustomTextBoxPublicKey.ReadOnly = false;
+ CustomTextBoxPublicKey.ScrollBars = ScrollBars.None;
+ CustomTextBoxPublicKey.ShortcutsEnabled = true;
+ CustomTextBoxPublicKey.Size = new Size(350, 23);
+ CustomTextBoxPublicKey.TabIndex = 0;
+ CustomTextBoxPublicKey.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxPublicKey.Texts = "";
+ CustomTextBoxPublicKey.UnderlinedStyle = true;
+ CustomTextBoxPublicKey.UsePasswordChar = false;
+ CustomTextBoxPublicKey.WordWrap = true;
//
// CustomLabelHash
//
- this.CustomLabelHash.AutoSize = true;
- this.CustomLabelHash.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelHash.Border = false;
- this.CustomLabelHash.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelHash.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelHash.ForeColor = System.Drawing.Color.White;
- this.CustomLabelHash.Location = new System.Drawing.Point(407, 170);
- this.CustomLabelHash.Name = "CustomLabelHash";
- this.CustomLabelHash.RoundedCorners = 0;
- this.CustomLabelHash.Size = new System.Drawing.Size(356, 17);
- this.CustomLabelHash.TabIndex = 17;
- this.CustomLabelHash.Text = "Hashes (Comma-separated) (SHA256 HEX String) (Can be empty):";
+ CustomLabelHash.AutoSize = true;
+ CustomLabelHash.BackColor = Color.DimGray;
+ CustomLabelHash.Border = false;
+ CustomLabelHash.BorderColor = Color.Blue;
+ CustomLabelHash.FlatStyle = FlatStyle.Flat;
+ CustomLabelHash.ForeColor = Color.White;
+ CustomLabelHash.Location = new Point(407, 170);
+ CustomLabelHash.Name = "CustomLabelHash";
+ CustomLabelHash.RoundedCorners = 0;
+ CustomLabelHash.Size = new Size(356, 17);
+ CustomLabelHash.TabIndex = 17;
+ CustomLabelHash.Text = "Hashes (Comma-separated) (SHA256 HEX String) (Can be empty):";
//
// CustomTextBoxHash
//
- this.CustomTextBoxHash.AcceptsReturn = false;
- this.CustomTextBoxHash.AcceptsTab = false;
- this.CustomTextBoxHash.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxHash.Border = true;
- this.CustomTextBoxHash.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxHash.BorderSize = 1;
- this.CustomTextBoxHash.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxHash.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxHash.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxHash.HideSelection = true;
- this.CustomTextBoxHash.Location = new System.Drawing.Point(407, 190);
- this.CustomTextBoxHash.MaxLength = 32767;
- this.CustomTextBoxHash.Multiline = false;
- this.CustomTextBoxHash.Name = "CustomTextBoxHash";
- this.CustomTextBoxHash.ReadOnly = false;
- this.CustomTextBoxHash.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxHash.ShortcutsEnabled = true;
- this.CustomTextBoxHash.Size = new System.Drawing.Size(350, 23);
- this.CustomTextBoxHash.TabIndex = 0;
- this.CustomTextBoxHash.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxHash.Texts = "";
- this.CustomTextBoxHash.UnderlinedStyle = true;
- this.CustomTextBoxHash.UsePasswordChar = false;
- this.CustomTextBoxHash.WordWrap = true;
+ CustomTextBoxHash.AcceptsReturn = false;
+ CustomTextBoxHash.AcceptsTab = false;
+ CustomTextBoxHash.BackColor = Color.DimGray;
+ CustomTextBoxHash.Border = true;
+ CustomTextBoxHash.BorderColor = Color.Blue;
+ CustomTextBoxHash.BorderSize = 1;
+ CustomTextBoxHash.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxHash.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxHash.ForeColor = Color.White;
+ CustomTextBoxHash.HideSelection = true;
+ CustomTextBoxHash.Location = new Point(407, 190);
+ CustomTextBoxHash.MaxLength = 32767;
+ CustomTextBoxHash.Multiline = false;
+ CustomTextBoxHash.Name = "CustomTextBoxHash";
+ CustomTextBoxHash.ReadOnly = false;
+ CustomTextBoxHash.ScrollBars = ScrollBars.None;
+ CustomTextBoxHash.ShortcutsEnabled = true;
+ CustomTextBoxHash.Size = new Size(350, 23);
+ CustomTextBoxHash.TabIndex = 0;
+ CustomTextBoxHash.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxHash.Texts = "";
+ CustomTextBoxHash.UnderlinedStyle = true;
+ CustomTextBoxHash.UsePasswordChar = false;
+ CustomTextBoxHash.WordWrap = true;
//
// CustomCheckBoxIsDnsSec
//
- this.CustomCheckBoxIsDnsSec.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxIsDnsSec.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxIsDnsSec.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxIsDnsSec.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxIsDnsSec.Location = new System.Drawing.Point(12, 250);
- this.CustomCheckBoxIsDnsSec.Name = "CustomCheckBoxIsDnsSec";
- this.CustomCheckBoxIsDnsSec.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxIsDnsSec.Size = new System.Drawing.Size(76, 17);
- this.CustomCheckBoxIsDnsSec.TabIndex = 20;
- this.CustomCheckBoxIsDnsSec.Text = "Is DNSSec";
- this.CustomCheckBoxIsDnsSec.UseVisualStyleBackColor = false;
+ CustomCheckBoxIsDnsSec.BackColor = Color.DimGray;
+ CustomCheckBoxIsDnsSec.BorderColor = Color.Blue;
+ CustomCheckBoxIsDnsSec.CheckColor = Color.Blue;
+ CustomCheckBoxIsDnsSec.ForeColor = Color.White;
+ CustomCheckBoxIsDnsSec.Location = new Point(12, 250);
+ CustomCheckBoxIsDnsSec.Name = "CustomCheckBoxIsDnsSec";
+ CustomCheckBoxIsDnsSec.SelectionColor = Color.LightBlue;
+ CustomCheckBoxIsDnsSec.Size = new Size(76, 17);
+ CustomCheckBoxIsDnsSec.TabIndex = 20;
+ CustomCheckBoxIsDnsSec.Text = "Is DNSSec";
+ CustomCheckBoxIsDnsSec.UseVisualStyleBackColor = false;
//
// CustomCheckBoxIsNoFilter
//
- this.CustomCheckBoxIsNoFilter.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxIsNoFilter.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxIsNoFilter.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxIsNoFilter.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxIsNoFilter.Location = new System.Drawing.Point(122, 250);
- this.CustomCheckBoxIsNoFilter.Name = "CustomCheckBoxIsNoFilter";
- this.CustomCheckBoxIsNoFilter.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxIsNoFilter.Size = new System.Drawing.Size(79, 17);
- this.CustomCheckBoxIsNoFilter.TabIndex = 21;
- this.CustomCheckBoxIsNoFilter.Text = "Is No Filter";
- this.CustomCheckBoxIsNoFilter.UseVisualStyleBackColor = false;
+ CustomCheckBoxIsNoFilter.BackColor = Color.DimGray;
+ CustomCheckBoxIsNoFilter.BorderColor = Color.Blue;
+ CustomCheckBoxIsNoFilter.CheckColor = Color.Blue;
+ CustomCheckBoxIsNoFilter.ForeColor = Color.White;
+ CustomCheckBoxIsNoFilter.Location = new Point(122, 250);
+ CustomCheckBoxIsNoFilter.Name = "CustomCheckBoxIsNoFilter";
+ CustomCheckBoxIsNoFilter.SelectionColor = Color.LightBlue;
+ CustomCheckBoxIsNoFilter.Size = new Size(79, 17);
+ CustomCheckBoxIsNoFilter.TabIndex = 21;
+ CustomCheckBoxIsNoFilter.Text = "Is No Filter";
+ CustomCheckBoxIsNoFilter.UseVisualStyleBackColor = false;
//
// CustomCheckBoxIsNoLog
//
- this.CustomCheckBoxIsNoLog.BackColor = System.Drawing.Color.DimGray;
- this.CustomCheckBoxIsNoLog.BorderColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxIsNoLog.CheckColor = System.Drawing.Color.Blue;
- this.CustomCheckBoxIsNoLog.ForeColor = System.Drawing.Color.White;
- this.CustomCheckBoxIsNoLog.Location = new System.Drawing.Point(232, 250);
- this.CustomCheckBoxIsNoLog.Name = "CustomCheckBoxIsNoLog";
- this.CustomCheckBoxIsNoLog.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomCheckBoxIsNoLog.Size = new System.Drawing.Size(73, 17);
- this.CustomCheckBoxIsNoLog.TabIndex = 22;
- this.CustomCheckBoxIsNoLog.Text = "Is No Log";
- this.CustomCheckBoxIsNoLog.UseVisualStyleBackColor = false;
+ CustomCheckBoxIsNoLog.BackColor = Color.DimGray;
+ CustomCheckBoxIsNoLog.BorderColor = Color.Blue;
+ CustomCheckBoxIsNoLog.CheckColor = Color.Blue;
+ CustomCheckBoxIsNoLog.ForeColor = Color.White;
+ CustomCheckBoxIsNoLog.Location = new Point(232, 250);
+ CustomCheckBoxIsNoLog.Name = "CustomCheckBoxIsNoLog";
+ CustomCheckBoxIsNoLog.SelectionColor = Color.LightBlue;
+ CustomCheckBoxIsNoLog.Size = new Size(73, 17);
+ CustomCheckBoxIsNoLog.TabIndex = 22;
+ CustomCheckBoxIsNoLog.Text = "Is No Log";
+ CustomCheckBoxIsNoLog.UseVisualStyleBackColor = false;
//
// CustomTextBoxStamp
//
- this.CustomTextBoxStamp.AcceptsReturn = false;
- this.CustomTextBoxStamp.AcceptsTab = false;
- this.CustomTextBoxStamp.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomTextBoxStamp.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxStamp.Border = true;
- this.CustomTextBoxStamp.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxStamp.BorderSize = 1;
- this.CustomTextBoxStamp.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxStamp.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxStamp.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxStamp.HideSelection = true;
- this.CustomTextBoxStamp.Location = new System.Drawing.Point(12, 280);
- this.CustomTextBoxStamp.MaxLength = 32767;
- this.CustomTextBoxStamp.MinimumSize = new System.Drawing.Size(0, 23);
- this.CustomTextBoxStamp.Multiline = true;
- this.CustomTextBoxStamp.Name = "CustomTextBoxStamp";
- this.CustomTextBoxStamp.ReadOnly = false;
- this.CustomTextBoxStamp.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.CustomTextBoxStamp.ShortcutsEnabled = true;
- this.CustomTextBoxStamp.Size = new System.Drawing.Size(602, 102);
- this.CustomTextBoxStamp.TabIndex = 0;
- this.CustomTextBoxStamp.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxStamp.Texts = "sdns://";
- this.CustomTextBoxStamp.UnderlinedStyle = false;
- this.CustomTextBoxStamp.UsePasswordChar = false;
- this.CustomTextBoxStamp.WordWrap = true;
+ CustomTextBoxStamp.AcceptsReturn = false;
+ CustomTextBoxStamp.AcceptsTab = false;
+ CustomTextBoxStamp.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ CustomTextBoxStamp.BackColor = Color.DimGray;
+ CustomTextBoxStamp.Border = true;
+ CustomTextBoxStamp.BorderColor = Color.Blue;
+ CustomTextBoxStamp.BorderSize = 1;
+ CustomTextBoxStamp.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxStamp.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxStamp.ForeColor = Color.White;
+ CustomTextBoxStamp.HideSelection = true;
+ CustomTextBoxStamp.Location = new Point(12, 280);
+ CustomTextBoxStamp.MaxLength = 32767;
+ CustomTextBoxStamp.MinimumSize = new Size(0, 23);
+ CustomTextBoxStamp.Multiline = true;
+ CustomTextBoxStamp.Name = "CustomTextBoxStamp";
+ CustomTextBoxStamp.ReadOnly = false;
+ CustomTextBoxStamp.ScrollBars = ScrollBars.Vertical;
+ CustomTextBoxStamp.ShortcutsEnabled = true;
+ CustomTextBoxStamp.Size = new Size(602, 102);
+ CustomTextBoxStamp.TabIndex = 0;
+ CustomTextBoxStamp.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxStamp.Texts = "sdns://";
+ CustomTextBoxStamp.UnderlinedStyle = false;
+ CustomTextBoxStamp.UsePasswordChar = false;
+ CustomTextBoxStamp.WordWrap = true;
//
// CustomButtonClear
//
- this.CustomButtonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomButtonClear.AutoSize = true;
- this.CustomButtonClear.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonClear.Location = new System.Drawing.Point(655, 280);
- this.CustomButtonClear.Name = "CustomButtonClear";
- this.CustomButtonClear.RoundedCorners = 5;
- this.CustomButtonClear.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonClear.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonClear.TabIndex = 24;
- this.CustomButtonClear.Text = "Clear";
- this.CustomButtonClear.UseVisualStyleBackColor = true;
- this.CustomButtonClear.Click += new System.EventHandler(this.CustomButtonClear_Click);
+ CustomButtonClear.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ CustomButtonClear.AutoSize = true;
+ CustomButtonClear.BorderColor = Color.Blue;
+ CustomButtonClear.FlatStyle = FlatStyle.Flat;
+ CustomButtonClear.Location = new Point(655, 280);
+ CustomButtonClear.Name = "CustomButtonClear";
+ CustomButtonClear.RoundedCorners = 5;
+ CustomButtonClear.SelectionColor = Color.LightBlue;
+ CustomButtonClear.Size = new Size(75, 27);
+ CustomButtonClear.TabIndex = 24;
+ CustomButtonClear.Text = "Clear";
+ CustomButtonClear.UseVisualStyleBackColor = true;
+ CustomButtonClear.Click += CustomButtonClear_Click;
//
// CustomButtonDecode
//
- this.CustomButtonDecode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomButtonDecode.AutoSize = true;
- this.CustomButtonDecode.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDecode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDecode.Location = new System.Drawing.Point(655, 317);
- this.CustomButtonDecode.Name = "CustomButtonDecode";
- this.CustomButtonDecode.RoundedCorners = 5;
- this.CustomButtonDecode.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDecode.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonDecode.TabIndex = 33;
- this.CustomButtonDecode.Text = "Decode";
- this.CustomButtonDecode.UseVisualStyleBackColor = true;
- this.CustomButtonDecode.Click += new System.EventHandler(this.CustomButtonDecode_Click);
+ CustomButtonDecode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ CustomButtonDecode.AutoSize = true;
+ CustomButtonDecode.BorderColor = Color.Blue;
+ CustomButtonDecode.FlatStyle = FlatStyle.Flat;
+ CustomButtonDecode.Location = new Point(655, 317);
+ CustomButtonDecode.Name = "CustomButtonDecode";
+ CustomButtonDecode.RoundedCorners = 5;
+ CustomButtonDecode.SelectionColor = Color.LightBlue;
+ CustomButtonDecode.Size = new Size(75, 27);
+ CustomButtonDecode.TabIndex = 33;
+ CustomButtonDecode.Text = "Decode";
+ CustomButtonDecode.UseVisualStyleBackColor = true;
+ CustomButtonDecode.Click += CustomButtonDecode_Click;
//
// CustomLabelStatus
//
- this.CustomLabelStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.CustomLabelStatus.AutoSize = true;
- this.CustomLabelStatus.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelStatus.Border = false;
- this.CustomLabelStatus.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelStatus.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelStatus.ForeColor = System.Drawing.Color.White;
- this.CustomLabelStatus.Location = new System.Drawing.Point(12, 385);
- this.CustomLabelStatus.Name = "CustomLabelStatus";
- this.CustomLabelStatus.RoundedCorners = 0;
- this.CustomLabelStatus.Size = new System.Drawing.Size(79, 17);
- this.CustomLabelStatus.TabIndex = 34;
- this.CustomLabelStatus.Text = "Status: Ready";
+ CustomLabelStatus.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
+ CustomLabelStatus.AutoSize = true;
+ CustomLabelStatus.BackColor = Color.DimGray;
+ CustomLabelStatus.Border = false;
+ CustomLabelStatus.BorderColor = Color.Blue;
+ CustomLabelStatus.FlatStyle = FlatStyle.Flat;
+ CustomLabelStatus.ForeColor = Color.White;
+ CustomLabelStatus.Location = new Point(12, 388);
+ CustomLabelStatus.Name = "CustomLabelStatus";
+ CustomLabelStatus.RoundedCorners = 0;
+ CustomLabelStatus.Size = new Size(79, 17);
+ CustomLabelStatus.TabIndex = 34;
+ CustomLabelStatus.Text = "Status: Ready";
//
// CustomButtonEncode
//
- this.CustomButtonEncode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomButtonEncode.AutoSize = true;
- this.CustomButtonEncode.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonEncode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonEncode.Location = new System.Drawing.Point(655, 355);
- this.CustomButtonEncode.Name = "CustomButtonEncode";
- this.CustomButtonEncode.RoundedCorners = 5;
- this.CustomButtonEncode.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonEncode.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonEncode.TabIndex = 35;
- this.CustomButtonEncode.Text = "Encode";
- this.CustomButtonEncode.UseVisualStyleBackColor = true;
- this.CustomButtonEncode.Click += new System.EventHandler(this.CustomButtonEncode_Click);
+ CustomButtonEncode.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
+ CustomButtonEncode.AutoSize = true;
+ CustomButtonEncode.BorderColor = Color.Blue;
+ CustomButtonEncode.FlatStyle = FlatStyle.Flat;
+ CustomButtonEncode.Location = new Point(655, 355);
+ CustomButtonEncode.Name = "CustomButtonEncode";
+ CustomButtonEncode.RoundedCorners = 5;
+ CustomButtonEncode.SelectionColor = Color.LightBlue;
+ CustomButtonEncode.Size = new Size(75, 27);
+ CustomButtonEncode.TabIndex = 35;
+ CustomButtonEncode.Text = "Encode";
+ CustomButtonEncode.UseVisualStyleBackColor = true;
+ CustomButtonEncode.Click += CustomButtonEncode_Click;
//
// FormStampGenerator
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.DimGray;
- this.ClientSize = new System.Drawing.Size(769, 411);
- this.Controls.Add(this.CustomButtonEncode);
- this.Controls.Add(this.CustomLabelStatus);
- this.Controls.Add(this.CustomButtonDecode);
- this.Controls.Add(this.CustomButtonClear);
- this.Controls.Add(this.CustomTextBoxStamp);
- this.Controls.Add(this.CustomCheckBoxIsNoLog);
- this.Controls.Add(this.CustomCheckBoxIsNoFilter);
- this.Controls.Add(this.CustomCheckBoxIsDnsSec);
- this.Controls.Add(this.CustomTextBoxHash);
- this.Controls.Add(this.CustomLabelHash);
- this.Controls.Add(this.CustomTextBoxPublicKey);
- this.Controls.Add(this.CustomLabelPublicKey);
- this.Controls.Add(this.CustomTextBoxProviderName);
- this.Controls.Add(this.CustomLabelProviderName);
- this.Controls.Add(this.CustomTextBoxPath);
- this.Controls.Add(this.CustomLabelPath);
- this.Controls.Add(this.CustomNumericUpDownPort);
- this.Controls.Add(this.CustomLabelPort);
- this.Controls.Add(this.CustomTextBoxHost);
- this.Controls.Add(this.CustomLabelHost);
- this.Controls.Add(this.CustomTextBoxIP);
- this.Controls.Add(this.CustomLabelIP);
- this.Controls.Add(this.CustomComboBoxProtocol);
- this.Controls.Add(this.CustomLabelProtocol);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MaximizeBox = false;
- this.MaximumSize = new System.Drawing.Size(785, 450);
- this.MinimumSize = new System.Drawing.Size(785, 450);
- this.Name = "FormStampGenerator";
- this.Text = "DNSCrypt Stamp Generator";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FormStampGenerator_FormClosing);
- ((System.ComponentModel.ISupportInitialize)(this.CustomNumericUpDownPort)).EndInit();
- this.ResumeLayout(false);
- this.PerformLayout();
-
+ AutoScaleMode = AutoScaleMode.None;
+ BackColor = Color.DimGray;
+ ClientSize = new Size(769, 411);
+ Controls.Add(CustomButtonEncode);
+ Controls.Add(CustomLabelStatus);
+ Controls.Add(CustomButtonDecode);
+ Controls.Add(CustomButtonClear);
+ Controls.Add(CustomTextBoxStamp);
+ Controls.Add(CustomCheckBoxIsNoLog);
+ Controls.Add(CustomCheckBoxIsNoFilter);
+ Controls.Add(CustomCheckBoxIsDnsSec);
+ Controls.Add(CustomTextBoxHash);
+ Controls.Add(CustomLabelHash);
+ Controls.Add(CustomTextBoxPublicKey);
+ Controls.Add(CustomLabelPublicKey);
+ Controls.Add(CustomTextBoxProviderName);
+ Controls.Add(CustomLabelProviderName);
+ Controls.Add(CustomTextBoxPath);
+ Controls.Add(CustomLabelPath);
+ Controls.Add(CustomNumericUpDownPort);
+ Controls.Add(CustomLabelPort);
+ Controls.Add(CustomTextBoxHost);
+ Controls.Add(CustomLabelHost);
+ Controls.Add(CustomTextBoxIP);
+ Controls.Add(CustomLabelIP);
+ Controls.Add(CustomComboBoxProtocol);
+ Controls.Add(CustomLabelProtocol);
+ FormBorderStyle = FormBorderStyle.FixedSingle;
+ Icon = (Icon)resources.GetObject("$this.Icon");
+ MaximizeBox = false;
+ MaximumSize = new Size(785, 450);
+ MinimumSize = new Size(785, 450);
+ Name = "FormStampGenerator";
+ Text = "DNSCrypt Stamp Generator";
+ FormClosing += FormStampGenerator_FormClosing;
+ ((System.ComponentModel.ISupportInitialize)CustomNumericUpDownPort).EndInit();
+ ResumeLayout(false);
+ PerformLayout();
}
#endregion
diff --git a/SecureDNSClient/Forms/FormStampGenerator.cs b/SecureDNSClient/Forms/FormStampGenerator.cs
index afecb96..30ea996 100644
--- a/SecureDNSClient/Forms/FormStampGenerator.cs
+++ b/SecureDNSClient/Forms/FormStampGenerator.cs
@@ -1,6 +1,7 @@
-using MsmhTools;
-using MsmhTools.Themes;
-using MsmhTools.DnsTool;
+using MsmhToolsClass;
+using MsmhToolsClass.DnsTool;
+using MsmhToolsWinFormsClass;
+using MsmhToolsWinFormsClass.Themes;
using System;
using System.Diagnostics;
@@ -12,7 +13,10 @@ public partial class FormStampGenerator : Form
private static bool IsExiting = false;
public FormStampGenerator()
{
+ // Fix Screed DPI
+ ScreenDPI.FixDpiBeforeInitializeComponent(this);
InitializeComponent();
+ ScreenDPI.FixDpiAfterInitializeComponent(this);
// Load Theme
Theme.LoadTheme(this, Theme.Themes.Dark);
@@ -304,7 +308,7 @@ await Task.Run(async () =>
{
if (ClearStatus.ElapsedMilliseconds > 5000 && !IsExiting)
if (!string.IsNullOrEmpty(CustomLabelStatus.Text))
- this.InvokeIt(() => CustomLabelStatus.Text = string.Empty);
+ this.InvokeIt(() => CustomLabelStatus.Text = string.Empty);
}
catch (Exception) { }
}
diff --git a/SecureDNSClient/Forms/FormStampGenerator.resx b/SecureDNSClient/Forms/FormStampGenerator.resx
index f852953..6e5de1e 100644
--- a/SecureDNSClient/Forms/FormStampGenerator.resx
+++ b/SecureDNSClient/Forms/FormStampGenerator.resx
@@ -1,4 +1,64 @@
-
+
+
+
diff --git a/SecureDNSClient/Forms/FormStampReader.Designer.cs b/SecureDNSClient/Forms/FormStampReader.Designer.cs
index 19390a2..4762392 100644
--- a/SecureDNSClient/Forms/FormStampReader.Designer.cs
+++ b/SecureDNSClient/Forms/FormStampReader.Designer.cs
@@ -29,120 +29,116 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormStampReader));
- this.CustomLabelStampUrl = new CustomControls.CustomLabel();
- this.CustomTextBoxStampUrl = new CustomControls.CustomTextBox();
- this.CustomButtonDecode = new CustomControls.CustomButton();
- this.CustomTextBoxResult = new CustomControls.CustomTextBox();
- this.SuspendLayout();
+ CustomLabelStampUrl = new CustomControls.CustomLabel();
+ CustomTextBoxStampUrl = new CustomControls.CustomTextBox();
+ CustomButtonDecode = new CustomControls.CustomButton();
+ CustomTextBoxResult = new CustomControls.CustomTextBox();
+ SuspendLayout();
//
// CustomLabelStampUrl
//
- this.CustomLabelStampUrl.AutoSize = true;
- this.CustomLabelStampUrl.BackColor = System.Drawing.Color.DimGray;
- this.CustomLabelStampUrl.Border = false;
- this.CustomLabelStampUrl.BorderColor = System.Drawing.Color.Blue;
- this.CustomLabelStampUrl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomLabelStampUrl.ForeColor = System.Drawing.Color.White;
- this.CustomLabelStampUrl.Location = new System.Drawing.Point(12, 10);
- this.CustomLabelStampUrl.Name = "CustomLabelStampUrl";
- this.CustomLabelStampUrl.RoundedCorners = 0;
- this.CustomLabelStampUrl.Size = new System.Drawing.Size(64, 17);
- this.CustomLabelStampUrl.TabIndex = 0;
- this.CustomLabelStampUrl.Text = "Stamp Url:";
+ CustomLabelStampUrl.AutoSize = true;
+ CustomLabelStampUrl.BackColor = Color.DimGray;
+ CustomLabelStampUrl.Border = false;
+ CustomLabelStampUrl.BorderColor = Color.Blue;
+ CustomLabelStampUrl.FlatStyle = FlatStyle.Flat;
+ CustomLabelStampUrl.ForeColor = Color.White;
+ CustomLabelStampUrl.Location = new Point(12, 10);
+ CustomLabelStampUrl.Name = "CustomLabelStampUrl";
+ CustomLabelStampUrl.RoundedCorners = 0;
+ CustomLabelStampUrl.Size = new Size(64, 17);
+ CustomLabelStampUrl.TabIndex = 0;
+ CustomLabelStampUrl.Text = "Stamp Url:";
//
// CustomTextBoxStampUrl
//
- this.CustomTextBoxStampUrl.AcceptsReturn = false;
- this.CustomTextBoxStampUrl.AcceptsTab = false;
- this.CustomTextBoxStampUrl.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxStampUrl.Border = true;
- this.CustomTextBoxStampUrl.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxStampUrl.BorderSize = 1;
- this.CustomTextBoxStampUrl.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxStampUrl.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxStampUrl.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxStampUrl.HideSelection = true;
- this.CustomTextBoxStampUrl.Location = new System.Drawing.Point(82, 8);
- this.CustomTextBoxStampUrl.MaxLength = 32767;
- this.CustomTextBoxStampUrl.Multiline = false;
- this.CustomTextBoxStampUrl.Name = "CustomTextBoxStampUrl";
- this.CustomTextBoxStampUrl.ReadOnly = false;
- this.CustomTextBoxStampUrl.ScrollBars = System.Windows.Forms.ScrollBars.None;
- this.CustomTextBoxStampUrl.ShortcutsEnabled = true;
- this.CustomTextBoxStampUrl.Size = new System.Drawing.Size(500, 23);
- this.CustomTextBoxStampUrl.TabIndex = 0;
- this.CustomTextBoxStampUrl.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxStampUrl.Texts = "";
- this.CustomTextBoxStampUrl.UnderlinedStyle = true;
- this.CustomTextBoxStampUrl.UsePasswordChar = false;
- this.CustomTextBoxStampUrl.WordWrap = true;
+ CustomTextBoxStampUrl.AcceptsReturn = false;
+ CustomTextBoxStampUrl.AcceptsTab = false;
+ CustomTextBoxStampUrl.BackColor = Color.DimGray;
+ CustomTextBoxStampUrl.Border = true;
+ CustomTextBoxStampUrl.BorderColor = Color.Blue;
+ CustomTextBoxStampUrl.BorderSize = 1;
+ CustomTextBoxStampUrl.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxStampUrl.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxStampUrl.ForeColor = Color.White;
+ CustomTextBoxStampUrl.HideSelection = true;
+ CustomTextBoxStampUrl.Location = new Point(82, 8);
+ CustomTextBoxStampUrl.MaxLength = 32767;
+ CustomTextBoxStampUrl.Multiline = false;
+ CustomTextBoxStampUrl.Name = "CustomTextBoxStampUrl";
+ CustomTextBoxStampUrl.ReadOnly = false;
+ CustomTextBoxStampUrl.ScrollBars = ScrollBars.None;
+ CustomTextBoxStampUrl.ShortcutsEnabled = true;
+ CustomTextBoxStampUrl.Size = new Size(500, 23);
+ CustomTextBoxStampUrl.TabIndex = 0;
+ CustomTextBoxStampUrl.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxStampUrl.Texts = "";
+ CustomTextBoxStampUrl.UnderlinedStyle = true;
+ CustomTextBoxStampUrl.UsePasswordChar = false;
+ CustomTextBoxStampUrl.WordWrap = true;
//
// CustomButtonDecode
//
- this.CustomButtonDecode.AutoSize = true;
- this.CustomButtonDecode.BorderColor = System.Drawing.Color.Blue;
- this.CustomButtonDecode.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.CustomButtonDecode.Location = new System.Drawing.Point(610, 10);
- this.CustomButtonDecode.Name = "CustomButtonDecode";
- this.CustomButtonDecode.RoundedCorners = 5;
- this.CustomButtonDecode.SelectionColor = System.Drawing.Color.LightBlue;
- this.CustomButtonDecode.Size = new System.Drawing.Size(75, 27);
- this.CustomButtonDecode.TabIndex = 2;
- this.CustomButtonDecode.Text = "Decode";
- this.CustomButtonDecode.UseVisualStyleBackColor = true;
- this.CustomButtonDecode.Click += new System.EventHandler(this.CustomButtonDecode_Click);
+ CustomButtonDecode.AutoSize = true;
+ CustomButtonDecode.BorderColor = Color.Blue;
+ CustomButtonDecode.FlatStyle = FlatStyle.Flat;
+ CustomButtonDecode.Location = new Point(610, 10);
+ CustomButtonDecode.Name = "CustomButtonDecode";
+ CustomButtonDecode.RoundedCorners = 5;
+ CustomButtonDecode.SelectionColor = Color.LightBlue;
+ CustomButtonDecode.Size = new Size(75, 27);
+ CustomButtonDecode.TabIndex = 2;
+ CustomButtonDecode.Text = "Decode";
+ CustomButtonDecode.UseVisualStyleBackColor = true;
+ CustomButtonDecode.Click += CustomButtonDecode_Click;
//
// CustomTextBoxResult
//
- this.CustomTextBoxResult.AcceptsReturn = false;
- this.CustomTextBoxResult.AcceptsTab = false;
- this.CustomTextBoxResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.CustomTextBoxResult.BackColor = System.Drawing.Color.DimGray;
- this.CustomTextBoxResult.Border = true;
- this.CustomTextBoxResult.BorderColor = System.Drawing.Color.Blue;
- this.CustomTextBoxResult.BorderSize = 1;
- this.CustomTextBoxResult.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
- this.CustomTextBoxResult.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
- this.CustomTextBoxResult.ForeColor = System.Drawing.Color.White;
- this.CustomTextBoxResult.HideSelection = true;
- this.CustomTextBoxResult.Location = new System.Drawing.Point(12, 43);
- this.CustomTextBoxResult.MaxLength = 32767;
- this.CustomTextBoxResult.MinimumSize = new System.Drawing.Size(0, 23);
- this.CustomTextBoxResult.Multiline = true;
- this.CustomTextBoxResult.Name = "CustomTextBoxResult";
- this.CustomTextBoxResult.ReadOnly = true;
- this.CustomTextBoxResult.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.CustomTextBoxResult.ShortcutsEnabled = true;
- this.CustomTextBoxResult.Size = new System.Drawing.Size(673, 356);
- this.CustomTextBoxResult.TabIndex = 0;
- this.CustomTextBoxResult.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
- this.CustomTextBoxResult.Texts = "";
- this.CustomTextBoxResult.UnderlinedStyle = false;
- this.CustomTextBoxResult.UsePasswordChar = false;
- this.CustomTextBoxResult.WordWrap = true;
+ CustomTextBoxResult.AcceptsReturn = false;
+ CustomTextBoxResult.AcceptsTab = false;
+ CustomTextBoxResult.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+ CustomTextBoxResult.BackColor = Color.DimGray;
+ CustomTextBoxResult.Border = true;
+ CustomTextBoxResult.BorderColor = Color.Blue;
+ CustomTextBoxResult.BorderSize = 1;
+ CustomTextBoxResult.CharacterCasing = CharacterCasing.Normal;
+ CustomTextBoxResult.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
+ CustomTextBoxResult.ForeColor = Color.White;
+ CustomTextBoxResult.HideSelection = true;
+ CustomTextBoxResult.Location = new Point(12, 43);
+ CustomTextBoxResult.MaxLength = 32767;
+ CustomTextBoxResult.MinimumSize = new Size(0, 23);
+ CustomTextBoxResult.Multiline = true;
+ CustomTextBoxResult.Name = "CustomTextBoxResult";
+ CustomTextBoxResult.ReadOnly = true;
+ CustomTextBoxResult.ScrollBars = ScrollBars.Vertical;
+ CustomTextBoxResult.ShortcutsEnabled = true;
+ CustomTextBoxResult.Size = new Size(673, 356);
+ CustomTextBoxResult.TabIndex = 0;
+ CustomTextBoxResult.TextAlign = HorizontalAlignment.Left;
+ CustomTextBoxResult.Texts = "";
+ CustomTextBoxResult.UnderlinedStyle = false;
+ CustomTextBoxResult.UsePasswordChar = false;
+ CustomTextBoxResult.WordWrap = true;
//
// FormStampReader
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.DimGray;
- this.ClientSize = new System.Drawing.Size(699, 411);
- this.Controls.Add(this.CustomTextBoxResult);
- this.Controls.Add(this.CustomButtonDecode);
- this.Controls.Add(this.CustomTextBoxStampUrl);
- this.Controls.Add(this.CustomLabelStampUrl);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.MaximizeBox = false;
- this.MaximumSize = new System.Drawing.Size(715, 450);
- this.MinimumSize = new System.Drawing.Size(715, 450);
- this.Name = "FormStampReader";
- this.Text = "DNSCrypt Stamp Reader";
- this.ResumeLayout(false);
- this.PerformLayout();
-
+ AutoScaleMode = AutoScaleMode.None;
+ BackColor = Color.DimGray;
+ ClientSize = new Size(699, 411);
+ Controls.Add(CustomTextBoxResult);
+ Controls.Add(CustomButtonDecode);
+ Controls.Add(CustomTextBoxStampUrl);
+ Controls.Add(CustomLabelStampUrl);
+ FormBorderStyle = FormBorderStyle.FixedSingle;
+ Icon = (Icon)resources.GetObject("$this.Icon");
+ MaximizeBox = false;
+ MaximumSize = new Size(715, 450);
+ MinimumSize = new Size(715, 450);
+ Name = "FormStampReader";
+ Text = "DNSCrypt Stamp Reader";
+ ResumeLayout(false);
+ PerformLayout();
}
#endregion
diff --git a/SecureDNSClient/Forms/FormStampReader.cs b/SecureDNSClient/Forms/FormStampReader.cs
index c9689a2..0345f2c 100644
--- a/SecureDNSClient/Forms/FormStampReader.cs
+++ b/SecureDNSClient/Forms/FormStampReader.cs
@@ -1,6 +1,6 @@
-using MsmhTools;
-using MsmhTools.Themes;
-using MsmhTools.DnsTool;
+using MsmhToolsClass.DnsTool;
+using MsmhToolsWinFormsClass;
+using MsmhToolsWinFormsClass.Themes;
using System;
namespace SecureDNSClient
@@ -10,7 +10,10 @@ public partial class FormStampReader : Form
private readonly string NL = Environment.NewLine;
public FormStampReader()
{
+ // Fix Screed DPI
+ ScreenDPI.FixDpiBeforeInitializeComponent(this);
InitializeComponent();
+ ScreenDPI.FixDpiAfterInitializeComponent(this);
// Load Theme
Theme.LoadTheme(this, Theme.Themes.Dark);
diff --git a/SecureDNSClient/Forms/FormStampReader.resx b/SecureDNSClient/Forms/FormStampReader.resx
index f852953..6e5de1e 100644
--- a/SecureDNSClient/Forms/FormStampReader.resx
+++ b/SecureDNSClient/Forms/FormStampReader.resx
@@ -1,4 +1,64 @@
-
+
+
+
diff --git a/SecureDNSClient/Forms/GoodbyeDPI.cs b/SecureDNSClient/Forms/GoodbyeDPI.cs
index b89ec74..bc051c9 100644
--- a/SecureDNSClient/Forms/GoodbyeDPI.cs
+++ b/SecureDNSClient/Forms/GoodbyeDPI.cs
@@ -1,4 +1,4 @@
-using MsmhTools;
+using MsmhToolsClass;
using SecureDNSClient.DPIBasic;
using System;
using System.Diagnostics;
@@ -23,16 +23,8 @@ public DPIBasicBypassMode GetGoodbyeDpiModeBasic()
else return DPIBasicBypassMode.Light;
}
- private void DPIBasic()
+ private async void GoodbyeDPIBasic()
{
- //// Write Connect first to log
- //if (!IsDNSConnected && !IsDoHConnected)
- //{
- // string msgConnect = "Connect first." + NL;
- // this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgConnect, Color.IndianRed));
- // return;
- //}
-
// Check Internet Connectivity
if (!IsInternetAlive()) return;
@@ -44,13 +36,14 @@ private void DPIBasic()
if (string.IsNullOrEmpty(blockedDomain)) return;
// Kill GoodbyeDPI
- ProcessManager.KillProcessByPID(PIDGoodbyeDPI);
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIBasic);
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIAdvanced);
string args = string.Empty;
string text = string.Empty;
string fallbackDNS = SecureDNS.BootstrapDnsIPv4.ToString();
int fallbackDnsPort = SecureDNS.BootstrapDnsPort;
- bool isfallBackDNS = Network.IsIPv4Valid(CustomTextBoxSettingBootstrapDnsIP.Text, out IPAddress? fallBackDNSIP);
+ bool isfallBackDNS = NetworkTool.IsIPv4Valid(CustomTextBoxSettingBootstrapDnsIP.Text, out IPAddress? fallBackDNSIP);
if (isfallBackDNS && fallBackDNSIP != null)
{
fallbackDNS = fallBackDNSIP.ToString();
@@ -65,9 +58,20 @@ private void DPIBasic()
text = dpiBypass.Text;
// Execute GoodByeDPI
- PIDGoodbyeDPI = ProcessManager.ExecuteOnly(out Process _, SecureDNS.GoodbyeDpi, args, true, true, SecureDNS.BinaryDirPath, GetCPUPriority());
+ PIDGoodbyeDPIBasic = ProcessManager.ExecuteOnly(out Process _, SecureDNS.GoodbyeDpi, args, true, true, SecureDNS.BinaryDirPath, GetCPUPriority());
+
+ // Wait for GoodbyeDPI
+ Task wait1 = Task.Run(async () =>
+ {
+ while (true)
+ {
+ if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBasic)) break;
+ await Task.Delay(100);
+ }
+ });
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
- if (ProcessManager.FindProcessByPID(PIDGoodbyeDPI))
+ if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBasic))
{
// Write DPI Mode to log
string msg = "DPI bypass is active, mode: ";
@@ -78,18 +82,12 @@ private void DPIBasic()
UpdateStatusLong();
// Set IsGoodbyeDPIActive true
- IsGoodbyeDPIActive = true;
+ IsGoodbyeDPIBasicActive = true;
IsDPIActive = true;
- // Go to SetDNS Tab if it's not already set
- if (ConnectAllClicked && !IsDNSSet)
- {
- this.InvokeIt(() => CustomTabControlMain.SelectedIndex = 0);
- this.InvokeIt(() => CustomTabControlSecureDNS.SelectedIndex = 3);
- }
-
// Check DPI works
- Task.Run(() => CheckDPIWorks(blockedDomain));
+ if (IsDNSSet)
+ _ = Task.Run(() => CheckDPIWorks(blockedDomain));
}
else
{
@@ -99,16 +97,8 @@ private void DPIBasic()
}
}
- private async void DPIAdvanced()
+ private async void GoodbyeDPIAdvanced()
{
- //// Write Connect first to log
- //if (!IsDNSConnected && !IsDoHConnected)
- //{
- // string msgConnect = "Connect first." + NL;
- // this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgConnect, Color.IndianRed));
- // return;
- //}
-
// Check Internet Connectivity
if (!IsInternetAlive()) return;
@@ -123,7 +113,7 @@ private async void DPIAdvanced()
// Write IP Error to log
if (CustomCheckBoxDPIAdvIpId.Checked)
{
- bool isIpValid = Network.IsIPv4Valid(CustomTextBoxDPIAdvIpId.Text, out IPAddress? tempIP);
+ bool isIpValid = NetworkTool.IsIPv4Valid(CustomTextBoxDPIAdvIpId.Text, out IPAddress? tempIP);
if (!isIpValid)
{
string msgIp = "IP Address is not valid." + NL;
@@ -251,7 +241,7 @@ private async void DPIAdvanced()
string fallbackDNS = SecureDNS.BootstrapDnsIPv4.ToString();
int fallbackDnsPort = SecureDNS.BootstrapDnsPort;
- bool isfallBackDNS = Network.IsIPv4Valid(CustomTextBoxSettingBootstrapDnsIP.Text, out IPAddress? fallBackDNSIP);
+ bool isfallBackDNS = NetworkTool.IsIPv4Valid(CustomTextBoxSettingBootstrapDnsIP.Text, out IPAddress? fallBackDNSIP);
if (isfallBackDNS && fallBackDNSIP != null)
{
fallbackDNS = fallBackDNSIP.ToString();
@@ -272,16 +262,17 @@ private async void DPIAdvanced()
}
// Kill GoodbyeDPI
- ProcessManager.KillProcessByPID(PIDGoodbyeDPI);
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIBasic);
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIAdvanced);
await Task.Delay(100);
string text = "Advanced";
// Execute GoodByeDPI
- PIDGoodbyeDPI = ProcessManager.ExecuteOnly(out Process _, SecureDNS.GoodbyeDpi, args, true, true, SecureDNS.BinaryDirPath, GetCPUPriority());
+ PIDGoodbyeDPIAdvanced = ProcessManager.ExecuteOnly(out Process _, SecureDNS.GoodbyeDpi, args, true, true, SecureDNS.BinaryDirPath, GetCPUPriority());
await Task.Delay(100);
- if (ProcessManager.FindProcessByPID(PIDGoodbyeDPI))
+ if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIAdvanced))
{
// Write DPI Mode to log
string msg = "DPI bypass is active, mode: ";
@@ -292,18 +283,12 @@ private async void DPIAdvanced()
UpdateStatusLong();
// Set IsGoodbyeDPIActive true
- IsGoodbyeDPIActive = true;
+ IsGoodbyeDPIAdvancedActive = true;
IsDPIActive = true;
- // Go to SetDNS Tab if it's not already set
- if (ConnectAllClicked && !IsDNSSet)
- {
- this.InvokeIt(() => CustomTabControlMain.SelectedIndex = 0);
- this.InvokeIt(() => CustomTabControlSecureDNS.SelectedIndex = 3);
- }
-
// Check DPI works
- Task.Run(() => CheckDPIWorks(blockedDomain));
+ if (IsDNSSet)
+ _ = Task.Run(() => CheckDPIWorks(blockedDomain));
}
else
{
@@ -313,31 +298,76 @@ private async void DPIAdvanced()
}
}
- private void DPIDeactive()
+ private async void GoodbyeDPIDeactive(bool deactiveBasic, bool deactiveAdvanced)
{
- if (ProcessManager.FindProcessByPID(PIDGoodbyeDPI))
+ if (!deactiveBasic && !deactiveAdvanced) return;
+
+ // Kill GoodbyeDPI Basic
+ if (deactiveBasic)
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIBasic);
+
+ // Kill GoodbyeDPI Advanced
+ if (deactiveAdvanced)
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIAdvanced);
+
+ Task wait1 = Task.Run(async () =>
+ {
+ while (true)
+ {
+ if (deactiveBasic && deactiveAdvanced)
+ {
+ if (!ProcessManager.FindProcessByPID(PIDGoodbyeDPIBasic) &&
+ !ProcessManager.FindProcessByPID(PIDGoodbyeDPIAdvanced)) break;
+ }
+ else
+ {
+ if (deactiveBasic && !ProcessManager.FindProcessByPID(PIDGoodbyeDPIBasic)) break;
+ if (deactiveAdvanced && !ProcessManager.FindProcessByPID(PIDGoodbyeDPIAdvanced)) break;
+ }
+ await Task.Delay(100);
+ }
+ });
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(10)); } catch (Exception) { }
+
+ // Update Groupbox Status
+ UpdateStatusLong();
+
+ // Write to log Basic
+ if (deactiveBasic)
{
- // Kill GoodbyeDPI
- ProcessManager.KillProcessByPID(PIDGoodbyeDPI);
+ if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBasic))
+ {
+ string msgDC = "Couldn't deactivate GoodbyeDPI (Basic). Try again." + NL;
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDC, Color.IndianRed));
+ }
+ else
+ {
+ // Set IsGoodbyeDPIBasicActive to False
+ IsGoodbyeDPIBasicActive = false;
- // Update Groupbox Status
- UpdateStatusLong();
+ string msgDC = "GoodbyeDPI (Basic) deactivated." + NL;
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDC, Color.LightGray));
+ }
+ }
- // Write to log
- if (ProcessManager.FindProcessByPID(PIDGoodbyeDPI))
+ // Write to log Advanced
+ if (deactiveAdvanced)
+ {
+ if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIAdvanced))
{
- string msgDC = "Couldn't deactivate DPI Bypass. Try again." + NL;
+ string msgDC = "Couldn't deactivate GoodbyeDPI (Advanced). Try again." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDC, Color.IndianRed));
}
else
{
- // Set IsGoodbyeDPIActive False
- IsGoodbyeDPIActive = false;
+ // Set IsGoodbyeDPIAdvancedActive to False
+ IsGoodbyeDPIAdvancedActive = false;
- string msgDC = "DPI bypass deactivated." + NL;
+ string msgDC = "GoodbyeDPI (Advanced) deactivated." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDC, Color.LightGray));
}
}
+
}
}
}
diff --git a/SecureDNSClient/Forms/Methods.cs b/SecureDNSClient/Forms/Methods.cs
index 876fcf2..867d509 100644
--- a/SecureDNSClient/Forms/Methods.cs
+++ b/SecureDNSClient/Forms/Methods.cs
@@ -1,7 +1,9 @@
-using MsmhTools;
-using MsmhTools.HTTPProxyServer;
+using CustomControls;
+using MsmhToolsClass;
+using MsmhToolsClass.HTTPProxyServer;
using System;
using System.Diagnostics;
+using System.Drawing;
using System.Net;
using System.Reflection;
@@ -57,48 +59,84 @@ private static void MoveToNewLocation()
}
}
- private void FixScreenDPI(Form form)
+ public bool IsInAction(bool showMsg, bool isCheckingForUpdate, bool isQuickConnectWorking, bool isCheckingStarted,
+ bool isConnecting, bool isDisconnecting, bool isDNSSetting, bool isDNSUnsetting,
+ bool isProxyActivating, bool isProxyDeactivating)
{
- using Graphics g = form.CreateGraphics();
+ bool isInAction = (isCheckingForUpdate && IsCheckingForUpdate) ||
+ (isQuickConnectWorking && IsQuickConnectWorking) ||
+ (isCheckingStarted && IsCheckingStarted) ||
+ (isConnecting && IsConnecting) ||
+ (isDisconnecting && IsDisconnecting) ||
+ (isDNSSetting && IsDNSSetting) ||
+ (isDNSUnsetting && IsDNSUnsetting) ||
+ (isProxyActivating && IsHttpProxyActivating) ||
+ (isProxyDeactivating && IsHttpProxyDeactivating);
+
+ if (isInAction && showMsg)
+ {
+ if (IsCheckingForUpdate)
+ CustomMessageBox.Show(this, "App is checking for update.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
+
+ else if (IsQuickConnectWorking)
+ CustomMessageBox.Show(this, "Quick Connect is in action.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
+
+ else if (IsCheckingStarted)
+ CustomMessageBox.Show(this, "App is checking DNS servers.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
- int x1 = 120; int y1 = 21;
- int splitMainD = SplitContainerMain.SplitterDistance;
- int splitTopD = SplitContainerTop.SplitterDistance;
+ else if (IsConnecting)
+ CustomMessageBox.Show(this, "App is connecting.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
- if (form.AutoScaleDimensions == form.CurrentAutoScaleDimensions)
+ else if (IsDisconnecting)
+ CustomMessageBox.Show(this, "App is disconnecting.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
+
+ else if (IsDNSSetting)
+ CustomMessageBox.Show(this, "Let DNS set.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
+
+ else if (IsDNSUnsetting)
+ CustomMessageBox.Show(this, "Let DNS unset.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
+
+ else if (IsHttpProxyActivating)
+ CustomMessageBox.Show(this, "Let HTTP Proxy activate.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
+
+ else if (IsHttpProxyDeactivating)
+ CustomMessageBox.Show(this, "Let HTTP Proxy deactivate.", "Wait...", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+
+ return isInAction;
+ }
+
+ private static void DeleteFileOnSize(string filePath, int sizeKB)
+ {
+ try
{
- // 96 = 100%
- // 120 = 125%
- // 144 = 150%
- if (g.DpiX == 120) // 125%
+ if (File.Exists(filePath))
{
- setSize(x1 + 35, y1 + 10, splitMainD, splitTopD + 100);
- }
- else if (g.DpiX == 144) // 150%
- {
- setSize(x1 + 80, y1 + 20, splitMainD, splitTopD + 450);
+ long lenth = new FileInfo(filePath).Length;
+ if (ConvertTool.ConvertSize(lenth, ConvertTool.SizeUnits.Byte, ConvertTool.SizeUnits.KB, out _) > sizeKB)
+ File.Delete(filePath);
}
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Delete {Path.GetFileName(filePath)} File: {ex.Message}");
+ }
+ }
- void setSize(int x1, int y1, int splitMainD, int splitTopD)
- {
- CustomTabControlMain.SizeMode = TabSizeMode.Fixed;
- CustomTabControlMain.ItemSize = new Size(x1, y1);
- CustomTabControlSecureDNS.SizeMode = TabSizeMode.Fixed;
- CustomTabControlSecureDNS.ItemSize = new Size(x1, y1);
- CustomTabControlDPIBasicAdvanced.SizeMode = TabSizeMode.Fixed;
- CustomTabControlDPIBasicAdvanced.ItemSize = new Size(x1, y1);
- CustomTabControlSettings.SizeMode = TabSizeMode.Fixed;
- CustomTabControlSettings.ItemSize = new Size(y1 + 9, x1);
-
- SplitContainerMain.SplitterDistance = splitMainD;
- SplitContainerTop.SplitterDistance = splitTopD;
- }
+ private void FixScreenDPI(Form form)
+ {
+ using Graphics g = form.CreateGraphics();
+ if (g.DpiX > 96 || g.DpiY > 96)
+ {
+ CustomLabelShareInfo.Font = new Font(form.Font.Name, 12f * 96f / form.CreateGraphics().DpiX, form.Font.Style, form.Font.Unit, form.Font.GdiCharSet, form.Font.GdiVerticalFont);
+ CustomLabelInfoDPIModes.Font = new Font(form.Font.Name, 10f * 96f / form.CreateGraphics().DpiX, FontStyle.Bold, form.Font.Unit, form.Font.GdiCharSet, form.Font.GdiVerticalFont);
+ CustomLabelAboutThis.Font = new Font(form.Font.Name, 19f * 96f / form.CreateGraphics().DpiX, FontStyle.Bold, form.Font.Unit, form.Font.GdiCharSet, form.Font.GdiVerticalFont);
}
}
private bool IsInternetAlive(bool writeToLog = true)
{
- if (!Network.IsInternetAlive())
+ if (!NetworkTool.IsInternetAlive())
{
string msgNet = "There is no Internet connectivity." + NL;
if (writeToLog)
@@ -128,6 +166,16 @@ private static void FlushDnsOnExit()
//ProcessManager.Execute("netsh", "winsock reset"); // Needs PC Restart
}
+ public static List GetPids(bool includeGoodbyeDpi)
+ {
+ List list = new();
+ int[] pids = { Environment.ProcessId, PIDHttpProxy, PIDFakeHttpProxy, PIDDNSProxy, PIDDNSProxyBypass, PIDDNSCrypt, PIDDNSCryptBypass };
+ int[] pidsGD = { PIDGoodbyeDPIBasic, PIDGoodbyeDPIAdvanced, PIDGoodbyeDPIBypass };
+ list.AddRange(pids);
+ if (includeGoodbyeDpi) list.AddRange(pidsGD);
+ return list.Distinct().ToList();
+ }
+
private void KillAll(bool killByName = false)
{
if (killByName)
@@ -141,13 +189,14 @@ private void KillAll(bool killByName = false)
else
{
ProcessManager.KillProcessByPID(PIDHttpProxy);
- ProcessManager.KillProcessByPID(PIDFakeProxy);
+ ProcessManager.KillProcessByPID(PIDFakeHttpProxy);
ProcessManager.KillProcessByName("dnslookup");
ProcessManager.KillProcessByPID(PIDDNSProxy);
ProcessManager.KillProcessByPID(PIDDNSProxyBypass);
ProcessManager.KillProcessByPID(PIDDNSCrypt);
ProcessManager.KillProcessByPID(PIDDNSCryptBypass);
- ProcessManager.KillProcessByPID(PIDGoodbyeDPI);
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIBasic);
+ ProcessManager.KillProcessByPID(PIDGoodbyeDPIAdvanced);
ProcessManager.KillProcessByPID(PIDGoodbyeDPIBypass);
}
}
@@ -225,34 +274,34 @@ async Task writeBinariesAsync()
Directory.CreateDirectory(SecureDNS.BinaryDirPath);
if (!File.Exists(SecureDNS.DnsLookup) || dnslookupResult == 1)
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnslookup, SecureDNS.DnsLookup);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnslookup, SecureDNS.DnsLookup);
if (!File.Exists(SecureDNS.DnsProxy) || dnsproxyResult == 1)
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnsproxy, SecureDNS.DnsProxy);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnsproxy, SecureDNS.DnsProxy);
if (!File.Exists(SecureDNS.DNSCrypt) || dnscryptResult == 1)
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnscrypt_proxyEXE, SecureDNS.DNSCrypt);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnscrypt_proxyEXE, SecureDNS.DNSCrypt);
if (!File.Exists(SecureDNS.DNSCryptConfigPath))
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnscrypt_proxyTOML, SecureDNS.DNSCryptConfigPath);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnscrypt_proxyTOML, SecureDNS.DNSCryptConfigPath);
if (!File.Exists(SecureDNS.DNSCryptConfigCloudflarePath))
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnscrypt_proxy_fakeproxyTOML, SecureDNS.DNSCryptConfigCloudflarePath);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.dnscrypt_proxy_fakeproxyTOML, SecureDNS.DNSCryptConfigCloudflarePath);
if (!File.Exists(SecureDNS.HttpProxyPath) || sdchttpproxyResult == 1)
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.SDCHttpProxy, SecureDNS.HttpProxyPath);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.SDCHttpProxy, SecureDNS.HttpProxyPath);
if (!File.Exists(SecureDNS.GoodbyeDpi) || goodbyedpiResult == 1)
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.goodbyedpi, SecureDNS.GoodbyeDpi);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.goodbyedpi, SecureDNS.GoodbyeDpi);
if (!File.Exists(SecureDNS.WinDivert))
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.WinDivert, SecureDNS.WinDivert);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.WinDivert, SecureDNS.WinDivert);
if (!File.Exists(SecureDNS.WinDivert32))
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.WinDivert32, SecureDNS.WinDivert32);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.WinDivert32, SecureDNS.WinDivert32);
if (!File.Exists(SecureDNS.WinDivert64))
- await Resource.WriteResourceToFileAsync(NecessaryFiles.Resource1.WinDivert64, SecureDNS.WinDivert64);
+ await ResourceTool.WriteResourceToFileAsync(NecessaryFiles.Resource1.WinDivert64, SecureDNS.WinDivert64);
// Update old version numbers
await File.WriteAllTextAsync(SecureDNS.BinariesVersionPath, NecessaryFiles.Resource1.versions);
@@ -279,7 +328,7 @@ public static bool IsDnsProtocolSupported(string dns)
string[] split = dns.Split(':');
string ip = split[0];
string port = split[1];
- if (Network.IsIPv4Valid(ip, out IPAddress _))
+ if (NetworkTool.IsIPv4Valid(ip, out IPAddress? _))
{
bool isPortValid = int.TryParse(port, out int outPort);
if (isPortValid && outPort >= 1 && outPort <= 65535)
@@ -294,34 +343,38 @@ private async void CheckDPIWorks(string host, int timeoutSec = 30) //Default tim
{
if (string.IsNullOrWhiteSpace(host)) return;
- // If DNS is Setting or Unsetting Return
- if (IsDNSSetting || IsDNSUnsetting) return;
+ // If there is no internet conectivity return
+ if (!IsInternetAlive()) return;
+
+ // If In Action return
+ if (IsInAction(false, false, false, true, true, true, true, true, true, true)) return;
// If user changing DPI mode fast, return.
if (StopWatchCheckDPIWorks.IsRunning) return;
// Start StopWatch
if (!StopWatchCheckDPIWorks.IsRunning)
+ {
StopWatchCheckDPIWorks.Start();
+ StopWatchCheckDPIWorks.Restart();
+ }
// Write start DPI checking to log
string msgDPI = $"Checking DPI Bypass ({host})...{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDPI, Color.LightGray));
- // Update Bools
- //UpdateBools();
- //await UpdateBoolHttpProxy();
+ // Don't Update Bools Here!!
// Wait for IsDPIActive
Task wait1 = Task.Run(async () =>
{
- while (!IsDPIActive)
+ while (true)
{
if (IsDPIActive) break;
await Task.Delay(100);
}
});
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
try
{
@@ -340,8 +393,8 @@ private async void CheckDPIWorks(string host, int timeoutSec = 30) //Default tim
// Is HTTP Proxy Direct DNS Set?!
bool isProxyDnsSet = false;
- if (ProcessManager.FindProcessByPID(PIDFakeProxy) &&
- IsSharing &&
+ if (ProcessManager.FindProcessByPID(PIDFakeHttpProxy) &&
+ IsHttpProxyRunning &&
ProxyDNSMode != HTTPProxyServer.Program.Dns.Mode.Disable &&
ProxyStaticDPIBypassMode != HTTPProxyServer.Program.DPIBypass.Mode.Disable)
isProxyDnsSet = true;
@@ -352,7 +405,7 @@ private async void CheckDPIWorks(string host, int timeoutSec = 30) //Default tim
string msgDPI1 = $"DPI Check: ";
string msgDPI2 = $"Set DNS to check.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDPI1, Color.LightGray));
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDPI2, Color.IndianRed));
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDPI2, Color.Orange));
StopWatchCheckDPIWorks.Stop();
StopWatchCheckDPIWorks.Reset();
@@ -362,18 +415,18 @@ private async void CheckDPIWorks(string host, int timeoutSec = 30) //Default tim
string url = $"https://{host}/";
Uri uri = new(url, UriKind.Absolute);
- bool isProxyPortOpen = Network.IsPortOpen(IPAddress.Loopback.ToString(), ProxyPort, 5);
- Debug.WriteLine($"Is Proxy Port Open: {isProxyPortOpen}, Port: {ProxyPort}");
+ bool isProxyPortOpen = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), HttpProxyPort, 5);
+ Debug.WriteLine($"Is Proxy Port Open: {isProxyPortOpen}, Port: {HttpProxyPort}");
- if (IsProxyDPIActive && isProxyPortOpen && ProxyProcess != null)
+ if (IsHttpProxyDpiBypassActive && isProxyPortOpen && HttpProxyProcess != null)
{
Debug.WriteLine("Proxy");
- UpdateProxyBools = false;
+ UpdateHttpProxyBools = false;
// Kill all requests before check
- ProcessManager.SendCommand(ProxyProcess, "killall");
+ ProcessManager.SendCommand(HttpProxyProcess, "killall");
- string proxyScheme = $"http://{IPAddress.Loopback}:{ProxyPort}";
+ string proxyScheme = $"http://{IPAddress.Loopback}:{HttpProxyPort}";
using SocketsHttpHandler socketsHttpHandler = new();
socketsHttpHandler.Proxy = new WebProxy(proxyScheme, true);
@@ -382,8 +435,8 @@ private async void CheckDPIWorks(string host, int timeoutSec = 30) //Default tim
httpClientWithProxy.Timeout = TimeSpan.FromSeconds(timeoutSec);
StopWatchCheckDPIWorks.Restart();
-
HttpResponseMessage r = await httpClientWithProxy.GetAsync(uri);
+ StopWatchCheckDPIWorks.Stop();
if (r.IsSuccessStatusCode || r.StatusCode == HttpStatusCode.NotFound || r.StatusCode == HttpStatusCode.Forbidden)
{
@@ -396,12 +449,14 @@ private async void CheckDPIWorks(string host, int timeoutSec = 30) //Default tim
else
{
Debug.WriteLine("No Proxy");
- using HttpClient httpClient = new();
+ using HttpClientHandler handler = new();
+ handler.UseProxy = false;
+ using HttpClient httpClient = new(handler);
httpClient.Timeout = TimeSpan.FromSeconds(timeoutSec);
StopWatchCheckDPIWorks.Restart();
-
HttpResponseMessage r = await httpClient.GetAsync(uri);
+ StopWatchCheckDPIWorks.Stop();
if (r.IsSuccessStatusCode || r.StatusCode == HttpStatusCode.NotFound || r.StatusCode == HttpStatusCode.Forbidden)
{
@@ -474,7 +529,7 @@ void msgFailed(HttpResponseMessage r)
StopWatchCheckDPIWorks.Reset();
}
- UpdateProxyBools = true;
+ UpdateHttpProxyBools = true;
}
}
diff --git a/SecureDNSClient/Forms/SavedDnsServers.cs b/SecureDNSClient/Forms/SavedDnsServers.cs
index e8770ac..f7353a5 100644
--- a/SecureDNSClient/Forms/SavedDnsServers.cs
+++ b/SecureDNSClient/Forms/SavedDnsServers.cs
@@ -1,5 +1,5 @@
-using MsmhTools;
-using MsmhTools.DnsTool;
+using MsmhToolsClass;
+using MsmhToolsClass.DnsTool;
using System;
using System.Net;
using System.Reflection;
@@ -120,7 +120,7 @@ await Task.Run(async () =>
List savedEncodedDnsList = new();
savedEncodedDnsList.LoadFromFile(SecureDNS.SavedEncodedDnsPath, true, true);
- savedEncodedDnsList.RemoveDuplicates();
+ savedEncodedDnsList = savedEncodedDnsList.RemoveDuplicates();
if (savedEncodedDnsList.Any())
{
@@ -129,11 +129,13 @@ await Task.Run(async () =>
string? fileContent = string.Empty;
if (builtInMode)
- fileContent = await Resource.GetResourceTextFileAsync("SecureDNSClient.DNS-Servers.txt", Assembly.GetExecutingAssembly());
+ fileContent = await ResourceTool.GetResourceTextFileAsync("SecureDNSClient.DNS-Servers.txt", Assembly.GetExecutingAssembly());
else
{
- FileDirectory.CreateEmptyFile(SecureDNS.CustomServersPath);
- fileContent = await File.ReadAllTextAsync(SecureDNS.CustomServersPath);
+ // Check if Custom Servers XML is NOT Valid
+ if (!XmlTool.IsValidXMLFile(SecureDNS.CustomServersXmlPath)) return;
+
+ fileContent = await ReadCustomServersXml(SecureDNS.CustomServersXmlPath, null);
}
if (!string.IsNullOrEmpty(fileContent) && !string.IsNullOrWhiteSpace(fileContent))
@@ -155,8 +157,8 @@ await Task.Run(async () =>
}
}
- WorkingDnsList.RemoveDuplicates(); // not important
- SavedDnsList.RemoveDuplicates();
+ WorkingDnsList = WorkingDnsList.RemoveDuplicates(); // not important
+ SavedDnsList = SavedDnsList.RemoveDuplicates();
}
}
@@ -217,19 +219,19 @@ private async Task SavedDnsUpdate()
if (insecure)
{
int origPort = localPortInsecure;
- bool isPortOpen1 = Network.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
+ bool isPortOpen1 = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
if (isPortOpen1)
{
- localPortInsecure = Network.GetNextPort(localPortInsecure);
- bool isPortOpen2 = Network.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
+ localPortInsecure = NetworkTool.GetNextPort(localPortInsecure);
+ bool isPortOpen2 = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
if (isPortOpen2)
{
- localPortInsecure = Network.GetNextPort(localPortInsecure);
- bool isPortOpen3 = Network.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
+ localPortInsecure = NetworkTool.GetNextPort(localPortInsecure);
+ bool isPortOpen3 = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
if (isPortOpen3)
{
- localPortInsecure = Network.GetNextPort(localPortInsecure);
- bool isPortOpen4 = Network.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
+ localPortInsecure = NetworkTool.GetNextPort(localPortInsecure);
+ bool isPortOpen4 = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), localPortInsecure, 3);
if (isPortOpen4)
{
string existingProcessName = ProcessManager.GetProcessNameByListeningPort(origPort);
@@ -327,7 +329,7 @@ await Task.Run(async () =>
string? fileContent = string.Empty;
if (builtInMode)
- fileContent = await Resource.GetResourceTextFileAsync("SecureDNSClient.DNS-Servers.txt", Assembly.GetExecutingAssembly());
+ fileContent = await ResourceTool.GetResourceTextFileAsync("SecureDNSClient.DNS-Servers.txt", Assembly.GetExecutingAssembly());
else
{
FileDirectory.CreateEmptyFile(SecureDNS.CustomServersPath);
diff --git a/SecureDNSClient/Forms/SetDNS.cs b/SecureDNSClient/Forms/SetDNS.cs
index 845bab8..58df5b5 100644
--- a/SecureDNSClient/Forms/SetDNS.cs
+++ b/SecureDNSClient/Forms/SetDNS.cs
@@ -1,5 +1,5 @@
using CustomControls;
-using MsmhTools;
+using MsmhToolsClass;
using System;
using System.Net;
using System.Net.NetworkInformation;
@@ -22,7 +22,7 @@ private async void SetDNS()
}
// Check if NIC is null
- NetworkInterface? nic = Network.GetNICByName(nicName);
+ NetworkInterface? nic = NetworkTool.GetNICByName(nicName);
if (nic == null) return;
string loopbackIP = IPAddress.Loopback.ToString();
@@ -33,6 +33,7 @@ private async void SetDNS()
if (!IsDNSSet)
{
if (IsDNSSetting || IsDNSUnsetting) return;
+
// Set DNS
IsDNSSetting = true;
@@ -72,7 +73,7 @@ private async void SetDNS()
if (ProcessManager.FindProcessByPID(PIDDNSCrypt) && CustomRadioButtonConnectDNSCrypt.Checked)
{
string msg = "Set DNS while connected via proxy is not a good idea.\nYou may break the connection.\nContinue?";
- DialogResult dr = CustomMessageBox.Show(msg, "Info", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
+ DialogResult dr = CustomMessageBox.Show(this, msg, "Info", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if (dr == DialogResult.No)
{
IsDNSSetting = false;
@@ -84,7 +85,7 @@ private async void SetDNS()
CustomRichTextBoxLog.AppendText($"Setting DNS...{NL}", Color.MediumSeaGreen);
// Set DNS
- await Task.Run(() => Network.SetDNS(nic, dnss));
+ await Task.Run(() => NetworkTool.SetDNS(nic, dnss));
IsDNSSet = true;
// Flush DNS
@@ -107,14 +108,6 @@ private async void SetDNS()
CustomRichTextBoxLog.AppendText(msg3, Color.LightGray);
CustomRichTextBoxLog.AppendText(msg4 + NL, Color.DodgerBlue);
- // Go to Check Tab
- if (ConnectAllClicked && IsConnected)
- {
- this.InvokeIt(() => CustomTabControlMain.SelectedIndex = 0);
- this.InvokeIt(() => CustomTabControlSecureDNS.SelectedIndex = 0);
- ConnectAllClicked = false;
- }
-
IsDNSSetting = false;
// Check DPI works if DPI is Active
@@ -135,18 +128,21 @@ private async void SetDNS()
if (unsetToDHCP)
{
// Unset to DHCP
- await Task.Run(() => Network.UnsetDNS(nic));
- Task.Delay(200).Wait();
- await UnsetSavedDnsDHCP();
+ if (File.Exists(SecureDNS.NicNamePath))
+ await UnsetSavedDnsDHCP();
+ else
+ await Task.Run(() => NetworkTool.UnsetDNS(nic));
}
else
{
// Unset to Static
string dns1 = CustomTextBoxSettingUnsetDns1.Text;
string dns2 = CustomTextBoxSettingUnsetDns2.Text;
- await Task.Run(() => Network.UnsetDNS(nic, dns1, dns2));
- Task.Delay(200).Wait();
- await UnsetSavedDnsStatic(dns1, dns2);
+
+ if (File.Exists(SecureDNS.NicNamePath))
+ await UnsetSavedDnsStatic(dns1, dns2);
+ else
+ await Task.Run(() => NetworkTool.UnsetDNS(nic, dns1, dns2));
}
IsDNSUnsetting = false;
@@ -196,10 +192,10 @@ private async Task UnsetSavedDnsDHCP()
string nicName = File.ReadAllText(SecureDNS.NicNamePath).Replace(NL, string.Empty);
if (nicName.Length > 0)
{
- NetworkInterface? nic = Network.GetNICByName(nicName);
+ NetworkInterface? nic = NetworkTool.GetNICByName(nicName);
if (nic != null)
{
- await Task.Run(() => Network.UnsetDNS(nic));
+ await Task.Run(() => NetworkTool.UnsetDNS(nic));
IsDNSSet = false;
}
}
@@ -214,14 +210,14 @@ private async Task UnsetSavedDnsStatic(string dns1, string dns2)
string nicName = File.ReadAllText(SecureDNS.NicNamePath).Replace(NL, string.Empty);
if (nicName.Length > 0)
{
- NetworkInterface? nic = Network.GetNICByName(nicName);
+ NetworkInterface? nic = NetworkTool.GetNICByName(nicName);
if (nic != null)
{
dns1 = dns1.Trim();
dns2 = dns2.Trim();
- if (Network.IsIPv4Valid(dns1, out IPAddress _) && Network.IsIPv4Valid(dns2, out IPAddress _))
+ if (NetworkTool.IsIPv4Valid(dns1, out IPAddress? _) && NetworkTool.IsIPv4Valid(dns2, out IPAddress? _))
{
- await Task.Run(() => Network.UnsetDNS(nic, dns1, dns2));
+ await Task.Run(() => NetworkTool.UnsetDNS(nic, dns1, dns2));
IsDNSSet = false;
}
}
diff --git a/SecureDNSClient/Forms/SetProxy.cs b/SecureDNSClient/Forms/SetProxy.cs
index c53730b..91e76d7 100644
--- a/SecureDNSClient/Forms/SetProxy.cs
+++ b/SecureDNSClient/Forms/SetProxy.cs
@@ -1,4 +1,4 @@
-using MsmhTools;
+using MsmhToolsClass;
using System;
using System.Net;
@@ -8,12 +8,12 @@ public partial class FormMain
{
private void SetProxy()
{
- if (!IsProxySet)
+ if (!IsHttpProxySet)
{
// Set Proxy
// Write Let Proxy Start to log
- if (IsProxyActivating)
+ if (IsHttpProxyActivating)
{
string msg = "Let Proxy Start." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.Orange));
@@ -21,7 +21,7 @@ private void SetProxy()
}
// Write Enable Proxy first to log
- if (!IsSharing)
+ if (!IsHttpProxyRunning)
{
string msg = "Enable Proxy first." + NL;
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
@@ -30,18 +30,18 @@ private void SetProxy()
// Get IP:Port
string ip = IPAddress.Loopback.ToString();
- int port = ProxyPort != -1 ? ProxyPort : GetHTTPProxyPortSetting();
+ int port = HttpProxyPort != -1 ? HttpProxyPort : GetHTTPProxyPortSetting();
// Start Set Proxy
- Network.SetHttpProxy(ip, port);
+ NetworkTool.SetHttpProxy(ip, port);
Task.Delay(300).Wait(); // Wait a moment
- bool isProxySet = Network.IsProxySet(out string _, out string _, out string _, out string _);
+ bool isProxySet = NetworkTool.IsProxySet(out string _, out string _, out string _, out string _);
if (isProxySet)
{
// Update bool
- IsProxySet = true;
+ IsHttpProxySet = true;
// Write Set Proxy message to log
string msg1 = "HTTP Proxy ";
@@ -70,15 +70,15 @@ private void SetProxy()
else
{
// Unset Proxy
- Network.UnsetProxy(false, true);
+ NetworkTool.UnsetProxy(false, true);
Task.Delay(300).Wait(); // Wait a moment
- bool isProxySet = Network.IsProxySet(out string _, out string _, out string _, out string _);
+ bool isProxySet = NetworkTool.IsProxySet(out string _, out string _, out string _, out string _);
if (!isProxySet)
{
// Update bool
- IsProxySet = false;
+ IsHttpProxySet = false;
// Write Unset Proxy message to log
string msg1 = "HTTP Proxy removed from system.";
diff --git a/SecureDNSClient/Forms/Share.cs b/SecureDNSClient/Forms/Share.cs
deleted file mode 100644
index 4e965de..0000000
--- a/SecureDNSClient/Forms/Share.cs
+++ /dev/null
@@ -1,796 +0,0 @@
-using MsmhTools;
-using MsmhTools.HTTPProxyServer;
-using System;
-using System.Diagnostics;
-using System.Net;
-using System.Text;
-
-namespace SecureDNSClient
-{
- public partial class FormMain
- {
- ///
- /// Apply Fake Proxy (Fake DNS and White List)
- ///
- /// HTTP Proxy
- /// Returns True if everything's ok.
- public bool ApplyFakeProxy(HTTPProxyServer proxy)
- {
- bool isOk = ApplyFakeProxyOut(out HTTPProxyServer.Program.BlackWhiteList? wListProgram, out HTTPProxyServer.Program.FakeDns? fakeDNSProgram);
- if (!isOk) return false;
- if (wListProgram == null) return false;
- if (fakeDNSProgram == null) return false;
-
- // Add Programs to Proxy
- proxy.BlockPort80 = true;
- proxy.RequestTimeoutSec = 0; // 0 = Disable
- proxy.EnableBlackWhiteList(wListProgram);
- proxy.EnableFakeDNS(fakeDNSProgram);
-
- return true;
- }
-
- ///
- /// Apply Fake Proxy (Fake DNS and White List)
- ///
- /// Process
- /// Returns True if everything's ok.
- public async Task ApplyFakeProxy(Process fakeProcess)
- {
- bool isOk = ApplyFakeProxyOut(out HTTPProxyServer.Program.BlackWhiteList? wListProgram, out HTTPProxyServer.Program.FakeDns? fakeDNSProgram);
- if (!isOk) return false;
- if (wListProgram == null) return false;
- if (fakeDNSProgram == null) return false;
-
- // Add Programs to Proxy
- // Get and set block port 80 setting
- string blockPort80Command = $"blockport80 -true";
- Debug.WriteLine(blockPort80Command);
- await ProcessManager.SendCommandAsync(fakeProcess, blockPort80Command);
-
- // Kill Request on Timeout (Sec)
- string killOnRequestTimeoutCommand = $"requesttimeout -0";
- Debug.WriteLine(killOnRequestTimeoutCommand);
- await ProcessManager.SendCommandAsync(fakeProcess, killOnRequestTimeoutCommand);
-
- string wlCommand = $"bwlistprogram -{wListProgram.ListMode} -{ConvertNewLineToN(wListProgram.TextContent)}";
- Debug.WriteLine(wlCommand);
- await ProcessManager.SendCommandAsync(fakeProcess, wlCommand);
-
- string fdCommand = $"fakednsprogram -{fakeDNSProgram.FakeDnsMode} -{ConvertNewLineToN(fakeDNSProgram.TextContent)}";
- Debug.WriteLine(fdCommand);
- await ProcessManager.SendCommandAsync(fakeProcess, fdCommand);
-
- return true;
- }
-
- public bool ApplyFakeProxyOut(out HTTPProxyServer.Program.BlackWhiteList? blackWhiteList, out HTTPProxyServer.Program.FakeDns? fakeDns)
- {
- // Get DoH Clean Ip
- string dohCleanIP = CustomTextBoxSettingFakeProxyDohCleanIP.Text;
- bool isValid = Network.IsIPv4Valid(dohCleanIP, out IPAddress _);
- if (!isValid)
- {
- string msg = $"Fake Proxy clean IP is not valid, check Settings.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- blackWhiteList = null;
- fakeDns = null;
- return false;
- }
-
- // Check IP is Clean
- bool isDohIpClean1 = Network.CanPing(dohCleanIP, 5000);
- bool isDohIpClean2 = Network.CanTcpConnect(dohCleanIP, 443, 5000);
- if (!isDohIpClean1 || !isDohIpClean2)
- {
- // CF Clean IP is not valid
- string msg = $"Fake Proxy clean IP is not clean.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- blackWhiteList = null;
- fakeDns = null;
- return false;
- }
-
- // Get Fake Proxy DoH Address
- string url = CustomTextBoxSettingFakeProxyDohAddress.Text;
- Network.GetUrlDetails(url, 443, out string host, out int _, out string _, out bool _);
- string host1 = "dns.cloudflare.com";
- string host2 = "cloudflare-dns.com";
- string host3 = "every1dns.com";
-
- // Set White List and Fake DNS Content (Rules)
- string wlContent = $"{host}\n{dohCleanIP}";
- string fdContent = $"{host}|{dohCleanIP}";
-
- if (host.Equals(host1) || host.Equals(host2) || host.Equals(host3))
- {
- wlContent = $"{host1}\n{host2}\n{host3}\n{dohCleanIP}";
- fdContent = $"{host1}|{dohCleanIP}\n{host2}|{dohCleanIP}\n{host3}|{dohCleanIP}";
- }
-
- // White List Program
- HTTPProxyServer.Program.BlackWhiteList wListProgram = new();
- wListProgram.Set(HTTPProxyServer.Program.BlackWhiteList.Mode.WhiteListText, wlContent);
-
- // Fake DNS Program
- HTTPProxyServer.Program.FakeDns fakeDNSProgram = new();
- fakeDNSProgram.Set(HTTPProxyServer.Program.FakeDns.Mode.Text, fdContent);
-
- blackWhiteList = wListProgram;
- fakeDns = fakeDNSProgram;
- return true;
- }
-
- private async void Share()
- {
- if (!IsProxyActivated && !IsSharing)
- {
- // Start Proxy
- if (IsProxyActivating || IsProxyDeactivating) return;
-
- // Write Set DNS first to log
- if (IsDNSSetting)
- {
- string msg = "Let DNS Set." + NL;
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.Orange));
- return;
- }
-
- UpdateProxyBools = false;
- IsProxyActivating = true;
-
- // Start Share
- string msgStart = $"Starting HTTP Proxy...{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgStart, Color.MediumSeaGreen));
-
- // Delete request log on > 50KB
- try
- {
- if (File.Exists(SecureDNS.HTTPProxyServerRequestLogPath))
- {
- long lenth = new FileInfo(SecureDNS.HTTPProxyServerRequestLogPath).Length;
- if (FileDirectory.ConvertSize(lenth, FileDirectory.SizeUnits.Byte, FileDirectory.SizeUnits.KB) > 50)
- File.Delete(SecureDNS.HTTPProxyServerRequestLogPath);
- }
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Delete HTTP Proxy Request log file: {ex.Message}");
- }
-
- // Check port
- int httpProxyPort = GetHTTPProxyPortSetting();
- bool isPortOk = GetListeningPort(httpProxyPort, "Change HTTP Proxy port from settings.", Color.IndianRed);
- if (!isPortOk)
- {
- IsProxyActivating = false;
- return;
- }
-
- // Kill if it's already running
- ProcessManager.KillProcessByPID(PIDHttpProxy);
-
- // Execute Http Proxy
- PIDHttpProxy = ProcessManager.ExecuteOnly(out Process process, SecureDNS.HttpProxyPath, null, true, true, SecureDNS.CurrentPath, GetCPUPriority());
- ProxyProcess = process;
-
- // Wait for HTTP Proxy
- Task wait1 = Task.Run(async () =>
- {
- while (!ProcessManager.FindProcessByPID(PIDHttpProxy))
- {
- if (ProcessManager.FindProcessByPID(PIDHttpProxy)) break;
- await Task.Delay(100);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
-
- if (!ProcessManager.FindProcessByPID(PIDHttpProxy))
- {
- string msg = $"Couldn't start Http Proxy Server. Try again.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- IsProxyActivating = false;
- return;
- }
-
- // Write Requests to Log
- if (CustomCheckBoxHTTPProxyEventShowRequest.Checked)
- {
- string done = await ProcessManager.SendCommandAndGetAnswerAsync(ProxyProcess, "writerequests -true", false);
- if (string.IsNullOrEmpty(done) && !done.Contains("Done"))
- {
- FaildSendCommandMessage();
- IsProxyActivating = false;
- return;
- }
- }
- else
- {
- string done = await ProcessManager.SendCommandAndGetAnswerAsync(ProxyProcess, "writerequests -false", false);
- if (string.IsNullOrEmpty(done) && !done.Contains("Done"))
- {
- FaildSendCommandMessage();
- IsProxyActivating = false;
- return;
- }
- }
-
- // Write Chunk Details to Log
- if (CustomCheckBoxHTTPProxyEventShowChunkDetails.Checked)
- {
- string done = await ProcessManager.SendCommandAndGetAnswerAsync(ProxyProcess, "writechunkdetails -true", false);
- if (string.IsNullOrEmpty(done) && !done.Contains("Done"))
- {
- FaildSendCommandMessage();
- IsProxyActivating = false;
- return;
- }
- }
- else
- {
- string done = await ProcessManager.SendCommandAndGetAnswerAsync(ProxyProcess, "writechunkdetails -false", false);
- if (string.IsNullOrEmpty(done) && !done.Contains("Done"))
- {
- FaildSendCommandMessage();
- IsProxyActivating = false;
- return;
- }
- }
-
- // Write Proxy Requests And Chunk Details To Log
- ProxyProcess.ErrorDataReceived -= ProxyProcess_ErrorDataReceived;
- ProxyProcess.ErrorDataReceived += ProxyProcess_ErrorDataReceived;
- ProxyProcess.BeginErrorReadLine(); // Redirects Error Output to Event
- void ProxyProcess_ErrorDataReceived(object sender, DataReceivedEventArgs e)
- {
- string? msg = e.Data;
- if (!string.IsNullOrEmpty(msg))
- {
- // Write to log
- if (!IsCheckingStarted && !IsConnecting && !IsExiting && IsProxyActivated && IsSharing)
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg + NL, Color.Gray));
-
- // Write to file
- try
- {
- FileDirectory.AppendTextLine(SecureDNS.HTTPProxyServerRequestLogPath, msg, new UTF8Encoding(false));
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Write HTTP Proxy Request log file: {ex.Message}");
- }
- }
- }
-
- // Apply DPI Bypass Support
- bool isDpiBypassApplied = ApplyPDpiChanges(ProxyProcess);
- if (!isDpiBypassApplied)
- {
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- IsProxyActivating = false;
- return;
- }
-
- // Apply UpStream Proxy Support
- bool isUpstreamOK = await ApplyPUpStreamProxy(ProxyProcess);
- if (!isUpstreamOK)
- {
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- IsProxyActivating = false;
- return;
- }
-
- // Apply DNS Support
- bool isDnsOk = await ApplyPDNS(ProxyProcess);
- if (!isDnsOk)
- {
- ProcessManager.KillProcessByPID(PIDFakeProxy);
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- IsProxyActivating = false;
- return;
- }
-
- // Apply Fake DNS Support
- bool isFakeDnsOk = await ApplyPFakeDNS(ProxyProcess);
- if (!isFakeDnsOk)
- {
- ProcessManager.KillProcessByPID(PIDFakeProxy);
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- IsProxyActivating = false;
- return;
- }
-
- // Apply Black White List Support
- bool isBlackWhiteListOk = await ApplyPBlackWhiteList(ProxyProcess);
- if (!isBlackWhiteListOk)
- {
- ProcessManager.KillProcessByPID(PIDFakeProxy);
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- IsProxyActivating = false;
- return;
- }
-
- // Apply DontBypass Support
- bool isDontBypassOk = await ApplyPDontBypass(ProxyProcess);
- if (!isDontBypassOk)
- {
- ProcessManager.KillProcessByPID(PIDFakeProxy);
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- IsProxyActivating = false;
- return;
- }
-
- // Get number of handle requests
- int handleReq = Convert.ToInt32(CustomNumericUpDownSettingHTTPProxyHandleRequests.Value);
-
- // Get and set block port 80 setting
- bool blockPort80 = CustomCheckBoxSettingProxyBlockPort80.Checked;
- string blockPort80Command = $"blockport80 -{blockPort80}";
- Debug.WriteLine(blockPort80Command);
- await ProcessManager.SendCommandAsync(ProxyProcess, blockPort80Command);
-
- // Kill Requests on overload CPU usage
- int killOnCpuUsage = Convert.ToInt32(CustomNumericUpDownSettingCpuKillProxyRequests.Value);
- string killOnCpuUsageCommand = $"killoncpuusage -{killOnCpuUsage}";
- Debug.WriteLine(killOnCpuUsageCommand);
- await ProcessManager.SendCommandAsync(ProxyProcess, killOnCpuUsageCommand);
-
- // Kill Request on Timeout (Sec)
- int reqTimeoutSec = Convert.ToInt32(CustomNumericUpDownSettingHTTPProxyKillRequestTimeout.Value);
- string killOnRequestTimeoutCommand = $"requesttimeout -{reqTimeoutSec}";
- Debug.WriteLine(killOnRequestTimeoutCommand);
- await ProcessManager.SendCommandAsync(ProxyProcess, killOnRequestTimeoutCommand);
-
- // Start Http Proxy
- string startCommand = $"start -any -{httpProxyPort} -{handleReq}";
- Debug.WriteLine(startCommand);
- await ProcessManager.SendCommandAsync(ProxyProcess, startCommand);
- await Task.Delay(500);
-
- // Check for successfull comunication with console
- ProxyProcess.StandardOutput.DiscardBufferedData();
- string outMsg = await ProcessManager.SendCommandAndGetAnswerAsync(ProxyProcess, "out", false);
- if (string.IsNullOrEmpty(outMsg) && !outMsg.StartsWith("Details"))
- {
- ProcessManager.KillProcessByPID(PIDFakeProxy);
- ProcessManager.KillProcessByPID(PIDHttpProxy);
- FaildSendCommandMessage();
- IsProxyActivating = false;
- return;
- }
-
- // Update Proxy Port
- ProxyPort = GetHTTPProxyPortSetting();
-
- // Write Sharing Address to log
- LocalIP = Network.GetLocalIPv4(); // Update Local IP
- IPAddress localIP = LocalIP ?? IPAddress.Loopback;
-
- string msgHTTPProxy1 = "Local HTTP Proxy:" + NL;
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgHTTPProxy1, Color.LightGray));
-
- string msgHTTPProxy2 = $"http://{IPAddress.Loopback}:{httpProxyPort}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgHTTPProxy2 + NL, Color.DodgerBlue));
-
- string msgHTTPProxy3 = $"http://{localIP}:{httpProxyPort}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgHTTPProxy3 + NL, Color.DodgerBlue));
-
- // Update Bools
- IsSharing = true;
- UpdateProxyBools = true;
- IsProxyActivating = false;
- ProxyProcess.StandardOutput.DiscardBufferedData();
- }
- else
- {
- // Stop Proxy
- if (IsProxyActivating || IsProxyDeactivating) return;
- IsProxyDeactivating = true;
-
- // Stop Fake Proxy
- ProcessManager.KillProcessByPID(PIDFakeProxy);
-
- // Stop HTTP Proxy
- if (ProcessManager.FindProcessByPID(PIDHttpProxy))
- {
- // Unset Proxy First
- if (IsProxySet) SetProxy();
- await Task.Delay(100);
- if (IsProxySet) Network.UnsetProxy(false, true);
-
- ProcessManager.KillProcessByPID(PIDHttpProxy);
-
- // Wait for HTTP Proxy to Exit
- Task wait1 = Task.Run(async () =>
- {
- while (ProcessManager.FindProcessByPID(PIDHttpProxy))
- {
- if (!ProcessManager.FindProcessByPID(PIDHttpProxy)) break;
- await Task.Delay(100);
- }
- });
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
-
- if (!ProcessManager.FindProcessByPID(PIDHttpProxy))
- {
- // Update Bool
- IsSharing = false;
-
- // Write deactivated message to log
- string msgDiactivated = $"HTTP Proxy Server deactivated.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDiactivated, Color.MediumSeaGreen));
- }
- else
- {
- // Couldn't stop
- string msg = $"Couldn't stop HTTP Proxy Server.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- }
- }
- else
- {
- // Already deactivated
- string msg = $"It's already deactivated.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.MediumSeaGreen));
- }
-
- IsProxyDeactivating = false;
- }
- }
-
- public void FaildSendCommandMessage()
- {
- string msg = $"Couldn't communicate with Proxy Console. Please Try again.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- }
-
- public string ConvertNewLineToN(string text)
- {
- return text.Replace(NL, "\n").Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", @"\n").Replace(@"\n\n", @"\n");
- }
-
- private bool ApplyPDpiChanges(Process process)
- {
- // Return if DNS is setting or unsetting
- if (IsDNSSetting || IsDNSUnsetting) return false;
-
- ApplyPDpiChangesOut(out HTTPProxyServer.Program.DPIBypass.Mode bypassMode, out int beforSniChunks, out HTTPProxyServer.Program.DPIBypass.ChunkMode chunkMode, out int sniChunks, out int antiPatternOffset, out int fragmentDelay);
-
- UpdateProxyBools = false;
- string command = $"staticdpibypassprogram -{bypassMode} -{beforSniChunks} -{chunkMode} -{sniChunks} -{antiPatternOffset} -{fragmentDelay}";
- Debug.WriteLine(command);
- bool isCommandSent = ProcessManager.SendCommand(process, command);
- if (!isCommandSent) return false;
- UpdateProxyBools = true;
-
- // Check DPI Works
- if (CustomCheckBoxPDpiEnableDpiBypass.Checked && IsProxyActivated && !IsProxyActivating)
- {
- if (bypassMode != HTTPProxyServer.Program.DPIBypass.Mode.Disable)
- {
- IsProxyDPIActive = true;
- IsDPIActive = true;
- }
-
- // Get blocked domain
- string blockedDomain = GetBlockedDomainSetting(out string _);
- if (!string.IsNullOrEmpty(blockedDomain))
- Task.Run(() => CheckDPIWorks(blockedDomain));
- }
-
- return true;
- }
-
- private void ApplyPDpiChangesFakeProxy(Process process)
- {
- ApplyPDpiChangesOut(out HTTPProxyServer.Program.DPIBypass.Mode bypassMode, out int beforSniChunks, out HTTPProxyServer.Program.DPIBypass.ChunkMode chunkMode, out int sniChunks, out int antiPatternOffset, out int fragmentDelay);
-
- string command = $"staticdpibypassprogram -{bypassMode} -{beforSniChunks} -{chunkMode} -{sniChunks} -{antiPatternOffset} -{fragmentDelay}";
- Debug.WriteLine(command);
- ProcessManager.SendCommand(process, command);
- }
-
- private void ApplyPDpiChangesOut(out HTTPProxyServer.Program.DPIBypass.Mode bypassMode, out int beforSniChunks, out HTTPProxyServer.Program.DPIBypass.ChunkMode chunkMode, out int sniChunks, out int antiPatternOffset, out int fragmentDelay)
- {
- // Get fragment settings
- bool enableDpiBypass = CustomCheckBoxPDpiEnableDpiBypass.Checked;
- beforSniChunks = Convert.ToInt32(CustomNumericUpDownPDpiBeforeSniChunks.Value);
- int chunkModeInt = CustomComboBoxPDpiSniChunkMode.SelectedIndex;
- chunkMode = chunkModeInt switch
- {
- 0 => HTTPProxyServer.Program.DPIBypass.ChunkMode.SNI,
- 1 => HTTPProxyServer.Program.DPIBypass.ChunkMode.SniExtension,
- 2 => HTTPProxyServer.Program.DPIBypass.ChunkMode.AllExtensions,
- _ => HTTPProxyServer.Program.DPIBypass.ChunkMode.AllExtensions,
- };
- sniChunks = Convert.ToInt32(CustomNumericUpDownPDpiSniChunks.Value);
- antiPatternOffset = Convert.ToInt32(CustomNumericUpDownPDpiAntiPatternOffset.Value);
- fragmentDelay = Convert.ToInt32(CustomNumericUpDownPDpiFragDelay.Value);
-
- bypassMode = enableDpiBypass ? HTTPProxyServer.Program.DPIBypass.Mode.Program : HTTPProxyServer.Program.DPIBypass.Mode.Disable;
- }
-
- public async Task ApplyPUpStreamProxy(Process process)
- {
- if (!CustomCheckBoxSettingHTTPProxyUpstream.Checked) return true;
-
- // Get Upstream Settings
- // Upstream Mode
- string? upstreamModeString = CustomComboBoxSettingHttpProxyUpstreamMode.SelectedItem as string;
-
- // Check if Mode is empty
- if (string.IsNullOrEmpty(upstreamModeString))
- {
- string msg = "Select the mode of upstream proxy." + NL;
- CustomRichTextBoxLog.AppendText(msg, Color.IndianRed);
- return false;
- }
-
- HTTPProxyServer.Program.UpStreamProxy.Mode upstreamMode = HTTPProxyServer.Program.UpStreamProxy.Mode.Disable;
- if (upstreamModeString.Equals("HTTP"))
- upstreamMode = HTTPProxyServer.Program.UpStreamProxy.Mode.HTTP;
- else if (upstreamModeString.Equals("SOCKS5"))
- upstreamMode = HTTPProxyServer.Program.UpStreamProxy.Mode.SOCKS5;
-
- // Upstream Host
- string upstreamHost = CustomTextBoxSettingHTTPProxyUpstreamHost.Text;
-
- // Check if Host is empty
- if (string.IsNullOrWhiteSpace(upstreamHost))
- {
- string msg = "Upstream proxy host cannot be empty." + NL;
- CustomRichTextBoxLog.AppendText(msg, Color.IndianRed);
- return false;
- }
-
- // Upstream Port
- int upstreamPort = Convert.ToInt32(CustomNumericUpDownSettingHTTPProxyUpstreamPort.Value);
-
- // Get blocked domain
- string blockedDomain = GetBlockedDomainSetting(out string _);
- if (string.IsNullOrEmpty(blockedDomain)) return false;
-
- // Get Upstream Proxy Scheme
- string upstreamProxyScheme = string.Empty;
- if (upstreamMode == HTTPProxyServer.Program.UpStreamProxy.Mode.HTTP)
- upstreamProxyScheme += "http";
- if (upstreamMode == HTTPProxyServer.Program.UpStreamProxy.Mode.SOCKS5)
- upstreamProxyScheme += "socks5";
- upstreamProxyScheme += $"://{upstreamHost}:{upstreamPort}";
-
- // Check Upstream Proxy Works
- bool isUpstreamProxyOk = await Network.CheckProxyWorks($"https://{blockedDomain}", upstreamProxyScheme, 15);
- if (!isUpstreamProxyOk)
- {
- string msg = $"Upstream proxy cannot open {blockedDomain}." + NL;
- CustomRichTextBoxLog.AppendText(msg, Color.IndianRed);
- return false;
- }
-
- // Only apply to blocked IPs
- bool onlyBlockedIPs = CustomCheckBoxSettingHTTPProxyUpstreamOnlyBlockedIPs.Checked;
-
- // Apply UpStream Proxy Program to HTTP Proxy
- string command = $"upstreamproxyprogram -{upstreamMode} -{upstreamHost} -{upstreamPort} -{onlyBlockedIPs}";
- Debug.WriteLine(command);
- await ProcessManager.SendCommandAsync(process, command);
-
- return true;
- }
-
- public async Task ApplyPDNS(Process process)
- {
- // Set timeout
- int timeoutSec = 5;
-
- if (CustomCheckBoxSettingHTTPProxyEnableFakeProxy.Checked)
- {
- // Start msg
- string msgStart = $"Starting Fake Proxy server...{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgStart, Color.Orange));
-
- // Get Fake Proxy DoH Address
- string dohUrl = CustomTextBoxSettingFakeProxyDohAddress.Text;
-
- // Get Clean Ip
- string dohCleanIP = CustomTextBoxSettingFakeProxyDohCleanIP.Text;
-
- // Get loopback
- string loopback = IPAddress.Loopback.ToString();
-
- // Check port
- int fakeProxyPort = GetFakeProxyPortSetting();
- bool isPortOk = GetListeningPort(fakeProxyPort, string.Empty, Color.Orange);
- if (!isPortOk)
- {
- fakeProxyPort = Network.GetNextPort(fakeProxyPort);
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Trying Port {fakeProxyPort}...{NL}", Color.MediumSeaGreen));
- bool isPort2Ok = GetListeningPort(fakeProxyPort, string.Empty, Color.Orange);
- if (!isPort2Ok)
- {
- fakeProxyPort = Network.GetNextPort(fakeProxyPort);
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText($"Trying Port {fakeProxyPort}...{NL}", Color.MediumSeaGreen));
- bool isPort3Ok = GetListeningPort(fakeProxyPort, "Change Fake Proxy port from settings.", Color.IndianRed);
- if (!isPort3Ok)
- {
- return false;
- }
- }
- }
-
- // Get Fake Proxy Scheme
- string fakeProxyScheme = $"http://{loopback}:{fakeProxyPort}";
-
- //============================== Start FakeProxy
- // Kill if it's already running
- ProcessManager.KillProcessByPID(PIDFakeProxy);
-
- // Execute Fake Proxy
- PIDFakeProxy = ProcessManager.ExecuteOnly(out Process fakeProcess, SecureDNS.HttpProxyPath, null, true, true, SecureDNS.CurrentPath, GetCPUPriority());
- FakeProxyProcess = fakeProcess;
-
- // Wait for Fake Proxy
- Task fakeWait = Task.Run(async () =>
- {
- while (!ProcessManager.FindProcessByPID(PIDFakeProxy))
- {
- if (ProcessManager.FindProcessByPID(PIDFakeProxy))
- break;
- await Task.Delay(100);
- }
- });
- await fakeWait.WaitAsync(TimeSpan.FromSeconds(5));
-
- if (!ProcessManager.FindProcessByPID(PIDFakeProxy)) return false;
-
- // Apply Fake DNS and White List Support to Fake Proxy
- bool isFpOk = await ApplyFakeProxy(FakeProxyProcess);
- if (!isFpOk) return false;
-
- // Apply DPI Bypass Support to Fake Proxy
- ApplyPDpiChangesFakeProxy(FakeProxyProcess);
-
- // Start Fake Proxy
- string startCommand = $"start -loopback -{fakeProxyPort} -50";
- Debug.WriteLine(startCommand);
- await ProcessManager.SendCommandAsync(FakeProxyProcess, startCommand);
-
- await Task.Delay(500);
- FakeProxyProcess.StandardOutput.DiscardBufferedData();
- //============================== End FakeProxy
-
- bool isSetCfOk = await setCloudflareIPs();
- if (!isSetCfOk) return false;
-
- // Apply DNS Program to HTTP Proxy
- string dnsCommand = $"dnsprogram -doh -{dohUrl} -{dohCleanIP} -{timeoutSec} -{fakeProxyScheme}";
- Debug.WriteLine(dnsCommand);
- await ProcessManager.SendCommandAsync(process, dnsCommand);
-
- // End msg
- string msgEnd = $"Fake Proxy Server activated. Port: {fakeProxyPort}{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgEnd, Color.MediumSeaGreen));
-
- return true;
- }
- else
- {
- bool isSetCfOk = await setCloudflareIPs();
- if (!isSetCfOk) return false;
-
- // Apply DNS Program to HTTP Proxy
- string dnsCommand = $"dnsprogram -system -null -null -{timeoutSec} -null";
- Debug.WriteLine(dnsCommand);
- await ProcessManager.SendCommandAsync(process, dnsCommand);
-
- return true;
- }
-
- async Task setCloudflareIPs()
- {
- // Add redirect all Cloudflare IPs to a clean IP
- if (CustomCheckBoxSettingHTTPProxyCfCleanIP.Checked)
- {
- // Get CF Clean IP
- string cleanIP = CustomTextBoxSettingHTTPProxyCfCleanIP.Text;
-
- // Check CF IP is valid
- bool isCleanIpValid = Network.IsIPv4Valid(cleanIP, out IPAddress _);
- if (!isCleanIpValid)
- {
- // CF Clean IP is not valid
- string msg = $"Cloudflare clean IP is not valid.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- return false;
- }
-
- // Check IP is Clean
- bool isClean1 = Network.CanPing(cleanIP, timeoutSec * 1000);
- bool isClean2 = Network.CanTcpConnect(cleanIP, 443, timeoutSec * 1000);
- if (!isClean1 || !isClean2)
- {
- // CF Clean IP is not valid
- string msg = $"Cloudflare clean IP is not clean.{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
- return false;
- }
-
- // Add to program
- string command = $"dnsprogram -setcloudflareips -true -{cleanIP} -null";
- Debug.WriteLine(command);
- await ProcessManager.SendCommandAsync(process, command);
-
- return true;
- }
- else
- return true;
- }
- }
-
- public async Task ApplyPFakeDNS(Process process)
- {
- if (CustomCheckBoxSettingHTTPProxyEnableFakeDNS.Checked)
- {
- string command = $"fakednsprogram -file -{SecureDNS.FakeDnsRulesPath}";
- Debug.WriteLine(command);
- await ProcessManager.SendCommandAsync(process, command);
- }
-
- return true;
- }
-
- public async Task ApplyPBlackWhiteList(Process process)
- {
- if (CustomCheckBoxSettingHTTPProxyEnableBlackWhiteList.Checked)
- {
- string command = $"bwlistprogram -BlackListFile -{SecureDNS.BlackWhiteListPath}";
- Debug.WriteLine(command);
- await ProcessManager.SendCommandAsync(process, command);
- }
-
- return true;
- }
-
- public async Task ApplyPDontBypass(Process process)
- {
- if (CustomCheckBoxSettingHTTPProxyEnableDontBypass.Checked)
- {
- string command = $"dontbypassprogram -file -{SecureDNS.DontBypassListPath}";
- Debug.WriteLine(command);
- await ProcessManager.SendCommandAsync(process, command);
- }
-
- return true;
- }
-
- private void WriteProxyRequestsAndChunkDetailsToLogAuto()
- {
- // Another way of reading Error output (I'm using Event instead)
- System.Timers.Timer timer = new();
- timer.Interval = 50;
- timer.Elapsed += Timer_Elapsed;
-
- void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
- {
- if (!IsCheckingStarted && !IsConnecting && IsProxyActivated && IsSharing)
- {
- if (ProxyProcess != null)
- {
- string? msg = ProxyProcess.StandardError.ReadLine();
- if (!string.IsNullOrEmpty(msg))
- {
- // Write to log
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg + NL, Color.Gray));
- }
- ProxyProcess.StandardError.DiscardBufferedData();
- }
- }
- }
-
- timer.Start();
- }
-
-
- }
-}
diff --git a/SecureDNSClient/Forms/TryToBypassFPUsingGoodbyeDPI.cs b/SecureDNSClient/Forms/TryToBypassFPUsingGoodbyeDPI.cs
index 884c2bf..931c318 100644
--- a/SecureDNSClient/Forms/TryToBypassFPUsingGoodbyeDPI.cs
+++ b/SecureDNSClient/Forms/TryToBypassFPUsingGoodbyeDPI.cs
@@ -1,7 +1,7 @@
using System;
using System.Diagnostics;
using System.Net;
-using MsmhTools;
+using MsmhToolsClass;
using SecureDNSClient.DPIBasic;
namespace SecureDNSClient
@@ -15,7 +15,7 @@ public async Task TryToBypassFakeProxyDohUsingGoodbyeDPIAsync(string clean
// Get Fake Proxy DoH Address
string dohUrl = CustomTextBoxSettingFakeProxyDohAddress.Text;
- Network.GetUrlDetails(dohUrl, 443, out string dohHost, out int _, out string _, out bool _);
+ NetworkTool.GetUrlDetails(dohUrl, 443, out _, out string dohHost, out int _, out string _, out bool _);
// It's blocked message
string msgBlocked = $"It's blocked.{NL}";
@@ -33,14 +33,14 @@ public async Task TryToBypassFakeProxyDohUsingGoodbyeDPIAsync(string clean
// Wait for CamouflageDNSServer
Task wait1 = Task.Run(async () =>
{
- while (!IsBypassDNSActive)
+ while (true)
{
- if (IsBypassDNSActive)
- break;
+ if (IsDisconnecting) break;
+ if (IsBypassDNSActive) break;
await Task.Delay(100);
}
});
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
if (IsBypassDNSActive)
{
@@ -109,14 +109,14 @@ public async Task TryToBypassFakeProxyDohUsingGoodbyeDPIAsync(string clean
// Wait for DNSProxyBypass
Task wait2 = Task.Run(async () =>
{
- while (!ProcessManager.FindProcessByPID(PIDDNSProxyBypass))
+ while (true)
{
- if (ProcessManager.FindProcessByPID(PIDDNSProxyBypass))
- break;
+ if (IsDisconnecting) break;
+ if (ProcessManager.FindProcessByPID(PIDDNSProxyBypass)) break;
await Task.Delay(100);
}
});
- await wait2.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait2.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
// Create blacklist file for GoodbyeDPI
File.WriteAllText(SecureDNS.DPIBlacklistFPPath, dohHost);
@@ -197,14 +197,14 @@ async Task bypassCFAsync(DPIBasicBypassMode bypassMode)
// Wait for DNSProxyBypass
Task wait3 = Task.Run(async () =>
{
- while (!ProcessManager.FindProcessByPID(PIDGoodbyeDPIBypass))
+ while (true)
{
- if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBypass))
- break;
+ if (IsDisconnecting) break;
+ if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBypass)) break;
await Task.Delay(100);
}
});
- await wait3.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait3.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
if (ProcessManager.FindProcessByPID(PIDGoodbyeDPIBypass))
{
@@ -214,6 +214,7 @@ async Task bypassCFAsync(DPIBasicBypassMode bypassMode)
{
// GoodbyeDPI failed to execute
string msgGoodbyeDPIFailed = $"GoodbyeDPI failed to execute. Try again.{NL}";
+ if (IsDisconnecting) msgGoodbyeDPIFailed = $"Task Canceled.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgGoodbyeDPIFailed, Color.IndianRed));
return false;
}
@@ -221,10 +222,9 @@ async Task bypassCFAsync(DPIBasicBypassMode bypassMode)
}
else
{
- if (IsDisconnecting) return false;
-
// DNSProxy failed to execute
string msgDNSProxyFailed = $"DNSProxy failed to execute. Try again.{NL}";
+ if (IsDisconnecting) msgDNSProxyFailed = $"Task Canceled.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDNSProxyFailed, Color.IndianRed));
// Kill
@@ -234,11 +234,10 @@ async Task bypassCFAsync(DPIBasicBypassMode bypassMode)
}
else
{
- if (IsDisconnecting) return false;
-
// Camouflage DNS Server couldn't start
- string msg = "Couldn't start camouflage DNS server, please try again.";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg + NL, Color.IndianRed));
+ string msg = $"Couldn't start camouflage DNS server, please try again.{NL}";
+ if (IsDisconnecting) msg = $"Task Canceled.{NL}";
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
return false;
}
diff --git a/SecureDNSClient/Forms/TryToBypassFPUsingProxyDPI.cs b/SecureDNSClient/Forms/TryToBypassFPUsingProxyDPI.cs
index 42e2f58..2694ea1 100644
--- a/SecureDNSClient/Forms/TryToBypassFPUsingProxyDPI.cs
+++ b/SecureDNSClient/Forms/TryToBypassFPUsingProxyDPI.cs
@@ -1,6 +1,6 @@
-using MsmhTools;
-using MsmhTools.DnsTool;
-using MsmhTools.HTTPProxyServer;
+using MsmhToolsClass;
+using MsmhToolsClass.DnsTool;
+using MsmhToolsClass.HTTPProxyServer;
using System;
using System.Diagnostics;
using System.Net;
@@ -16,7 +16,7 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
// Get Fake Proxy DoH Address
string dohUrl = CustomTextBoxSettingFakeProxyDohAddress.Text;
- Network.GetUrlDetails(dohUrl, 443, out string dohHost, out int _, out string _, out bool _);
+ NetworkTool.GetUrlDetails(dohUrl, 443, out _, out string dohHost, out int _, out string _, out bool _);
// It's blocked message
string msgBlocked = $"It's blocked.{NL}";
@@ -52,12 +52,12 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
//}
// Add Programs to Proxy
- if (CamouflageProxyServer.IsRunning)
- CamouflageProxyServer.Stop();
+ if (CamouflageHttpProxyServer.IsRunning)
+ CamouflageHttpProxyServer.Stop();
- CamouflageProxyServer = new();
- CamouflageProxyServer.EnableDPIBypass(dpiBypassProgram);
- bool isOk = ApplyFakeProxy(CamouflageProxyServer);
+ CamouflageHttpProxyServer = new();
+ CamouflageHttpProxyServer.EnableDPIBypass(dpiBypassProgram);
+ bool isOk = ApplyFakeProxy(CamouflageHttpProxyServer);
if (!isOk) return false;
//// Test Only
@@ -71,23 +71,23 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
if (IsDisconnecting) return false;
// Start
- CamouflageProxyServer.Start(IPAddress.Loopback, fakeProxyPort, 20000);
+ CamouflageHttpProxyServer.Start(IPAddress.Loopback, fakeProxyPort, 20000);
// Wait for CamouflageProxyServer
Task wait1 = Task.Run(async () =>
{
- while (!CamouflageProxyServer.IsRunning)
+ while (true)
{
- if (CamouflageProxyServer.IsRunning)
- break;
+ if (IsDisconnecting) break;
+ if (CamouflageHttpProxyServer.IsRunning) break;
await Task.Delay(100);
}
});
- await wait1.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait1.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
- IsBypassProxyActive = CamouflageProxyServer.IsRunning;
+ IsBypassHttpProxyActive = CamouflageHttpProxyServer.IsRunning;
- if (IsBypassProxyActive)
+ if (IsBypassHttpProxyActive)
{
if (IsDisconnecting) return false;
@@ -102,7 +102,7 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
string msg = "Error: Configuration file doesn't exist";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg + NL, Color.IndianRed));
- CamouflageProxyServer.Stop();
+ CamouflageHttpProxyServer.Stop();
return false;
}
@@ -141,7 +141,7 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
// Generate SDNS
bool isSdnsGenerateSuccess = false;
- Network.GetUrlDetails(dohUrl, 443, out string host, out int port, out string path, out bool _);
+ NetworkTool.GetUrlDetails(dohUrl, 443, out _, out string host, out int port, out string path, out bool _);
DNSCryptStampGenerator stampGenerator = new();
string host1 = "dns.cloudflare.com";
string host2 = "cloudflare-dns.com";
@@ -210,14 +210,14 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
// Wait for DNSCrypt
Task wait2 = Task.Run(async () =>
{
- while (!ProcessManager.FindProcessByPID(PIDDNSCryptBypass))
+ while (true)
{
- if (ProcessManager.FindProcessByPID(PIDDNSCryptBypass))
- break;
+ if (IsDisconnecting) break;
+ if (ProcessManager.FindProcessByPID(PIDDNSCryptBypass)) break;
await Task.Delay(100);
}
});
- await wait2.WaitAsync(TimeSpan.FromSeconds(5));
+ try { await wait2.WaitAsync(TimeSpan.FromSeconds(5)); } catch (Exception) { }
if (ProcessManager.FindProcessByPID(PIDDNSCryptBypass))
{
@@ -239,6 +239,7 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
{
string msgFailure1 = $"{NL}Failure: ";
string msgFailure2 = $"Change DPI bypass settings on Share tab and try again.{NL}";
+ if (IsDisconnecting) msgFailure2 = $"Task Canceled.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgFailure1, Color.IndianRed));
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgFailure2, Color.LightGray));
}
@@ -248,6 +249,7 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
{
string msgFailure1 = $"{NL}Failure: ";
string msgFailure2 = $"DNSCrypt crashed or closed by another application.{NL}";
+ if (IsDisconnecting) msgFailure2 = $"Task Canceled.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgFailure1, Color.IndianRed));
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgFailure2, Color.LightGray));
}
@@ -260,10 +262,9 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
}
else
{
- if (IsDisconnecting) return false;
-
// DNSCrypt-Proxy failed to execute
string msgDNSProxyFailed = $"DNSCrypt failed to execute. Try again.{NL}";
+ if (IsDisconnecting) msgDNSProxyFailed = $"Task Canceled.{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msgDNSProxyFailed, Color.IndianRed));
// Kill
@@ -276,8 +277,9 @@ public async Task TryToBypassFakeProxyDohUsingProxyDPIAsync(string cleanIP
if (IsDisconnecting) return false;
// Camouflage Proxy Server couldn't start
- string msg = "Couldn't start Fake Proxy server, please try again.";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg + NL, Color.IndianRed));
+ string msg = $"Couldn't start Fake Proxy server, please try again.{NL}";
+ if (IsDisconnecting) msg = $"Task Canceled.{NL}";
+ this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg, Color.IndianRed));
return false;
}
diff --git a/SecureDNSClient/Forms/UpdateStatusAuto.cs b/SecureDNSClient/Forms/UpdateStatusAuto.cs
index 70a8c42..2f03339 100644
--- a/SecureDNSClient/Forms/UpdateStatusAuto.cs
+++ b/SecureDNSClient/Forms/UpdateStatusAuto.cs
@@ -1,6 +1,6 @@
using CustomControls;
-using MsmhTools;
-using MsmhTools.HTTPProxyServer;
+using MsmhToolsClass;
+using MsmhToolsClass.HTTPProxyServer;
using System;
using System.Diagnostics;
using System.Media;
@@ -12,6 +12,72 @@ namespace SecureDNSClient
{
public partial class FormMain
{
+ private async void UpdateNotifyIconIconAuto()
+ {
+ NotifyIcon ni = NotifyIconMain;
+
+ await Task.Run(async () =>
+ {
+ while (true)
+ {
+ await Task.Delay(2000);
+ if (IsInAction(false, true, true, true, true, true, true, true, true, true))
+ {
+ await Task.Run(async () =>
+ {
+ while (true)
+ {
+ if (!IsInAction(false, true, true, true, true, true, true, true, true, true)) break;
+
+ ni.Text = "In Action...";
+
+ // Loading
+ ni.Icon = Properties.Resources.SecureDNSClient_B_Multi;
+ await Task.Delay(200);
+ ni.Icon = Properties.Resources.SecureDNSClient_BR_Multi;
+ await Task.Delay(200);
+ ni.Icon = Properties.Resources.SecureDNSClient_R_Multi;
+ await Task.Delay(200);
+ ni.Icon = Properties.Resources.SecureDNSClient_RB_Multi;
+ await Task.Delay(200);
+ }
+ });
+ }
+ else
+ {
+ if (!IsDNSConnected & !IsDNSSet & !IsHttpProxyRunning & !IsHttpProxySet & !IsDPIActive)
+ ni.Icon = Properties.Resources.SecureDNSClient_R_Multi;
+ else if (IsDNSConnected & IsDNSSet & IsHttpProxyRunning & IsHttpProxySet & IsDPIActive)
+ ni.Icon = Properties.Resources.SecureDNSClient_B_Multi;
+ else if (!IsDNSConnected & !IsDNSSet & IsHttpProxyRunning & IsHttpProxySet & IsDPIActive)
+ ni.Icon = Properties.Resources.SecureDNSClient_RB_Multi;
+ else if (!IsDNSConnected & !IsDNSSet & IsHttpProxyRunning & IsDPIActive)
+ ni.Icon = Properties.Resources.SecureDNSClient_RB_Multi;
+ else if (IsDNSConnected & IsDNSSet & !IsHttpProxyRunning & !IsHttpProxySet & !IsDPIActive)
+ ni.Icon = Properties.Resources.SecureDNSClient_RB_Multi;
+ else if (IsDNSConnected & IsDNSSet & !IsHttpProxyRunning & !IsDPIActive)
+ ni.Icon = Properties.Resources.SecureDNSClient_RB_Multi;
+ else
+ ni.Icon = Properties.Resources.SecureDNSClient_BR_Multi;
+
+ // Message (Max is 128 chars)
+ string msg = string.Empty;
+ if (IsDNSConnected & !IsDNSSet) msg += $"DNS: Online{NL}";
+ else if (IsDNSConnected & IsDNSSet) msg += $"DNS: Online & Set{NL}";
+ if (IsDoHConnected) msg += $"DoH: Online{NL}";
+ if (IsHttpProxyRunning & !IsHttpProxySet) msg += $"HTTP Proxy: Online{NL}";
+ else if (IsHttpProxyRunning & IsHttpProxySet) msg += $"HTTP Proxy: Online & Set{NL}";
+ if (IsDPIActive) msg += $"DPI Bypass: Active{NL}";
+
+ if (msg.EndsWith(NL)) msg = msg.TrimEnd(NL.ToCharArray());
+ if (string.IsNullOrEmpty(msg)) msg = Text;
+
+ try { ni.Text = msg; } catch (Exception) { }
+ }
+ }
+ });
+ }
+
private void CheckUpdateAuto()
{
Task.Run(async () => await CheckUpdate());
@@ -24,12 +90,12 @@ private void CheckUpdateAuto()
savedDnsUpdateTimer.Start();
}
- private async Task CheckUpdate(bool writeToLog = false)
+ private async Task CheckUpdate(bool showMsg = false)
{
if (IsCheckingStarted) return;
- if (!IsInternetAlive(false)) return;
+ if (!IsInternetAlive(true)) return;
if (IsCheckingForUpdate) return;
- if (writeToLog)
+ if (showMsg)
IsCheckingForUpdate = true;
string updateUrl = "https://github.com/msasanmh/SecureDNSClient/raw/main/update";
@@ -37,21 +103,37 @@ private async Task CheckUpdate(bool writeToLog = false)
string labelUpdate = string.Empty;
string downloadUrl = string.Empty;
- if (writeToLog)
+ if (showMsg)
{
- string checking = $"Checking update...{NL}";
+ string checking = $"{NL}Checking update...{NL}";
this.InvokeIt(() => CustomRichTextBoxLog.AppendText(checking, Color.LightGray));
}
try
{
- using HttpClient httpClient = new();
+ // Without System Proxy
+ using HttpClientHandler handler = new();
+ handler.UseProxy = false;
+ using HttpClient httpClient = new(handler);
httpClient.Timeout = TimeSpan.FromSeconds(20);
update = await httpClient.GetStringAsync(new Uri(updateUrl));
}
catch (Exception)
{
- update = string.Empty;
+ try
+ {
+ // With System Proxy
+ using HttpClientHandler handler = new();
+ handler.UseProxy = true;
+ using HttpClient httpClient = new(handler);
+ httpClient.Timeout = TimeSpan.FromSeconds(20);
+ update = await httpClient.GetStringAsync(new Uri(updateUrl));
+ }
+ catch (Exception ex)
+ {
+ update = string.Empty;
+ Debug.WriteLine("Check Update: " + ex.Message);
+ }
}
update = update.Trim();
@@ -67,24 +149,23 @@ private async Task CheckUpdate(bool writeToLog = false)
string currentVersion = Info.GetAppInfo(Assembly.GetExecutingAssembly()).ProductVersion ?? "99.99.99";
downloadUrl = split[1].Trim();
if (string.IsNullOrEmpty(downloadUrl)) downloadUrl = "https://github.com/msasanmh/SecureDNSClient/releases/latest";
-
+
int versionResult = Info.VersionCompare(newVersion, currentVersion);
if (versionResult == 1)
{
// Link Label Check Update
labelUpdate = $"There is a new version v{newVersion}";
- if (writeToLog)
+ if (showMsg)
{
string productName = Info.GetAppInfo(Assembly.GetExecutingAssembly()).ProductName ?? "Secure DNS Client";
- string msg1 = $"{NL}There is a new version of {productName}{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(msg1, Color.MediumSeaGreen));
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText("New version: ", Color.LightGray));
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(newVersion, Color.DodgerBlue));
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(", Current version: ", Color.LightGray));
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(currentVersion + NL, Color.DodgerBlue));
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText("Download: ", Color.LightGray));
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(downloadUrl + NL + NL, Color.MediumSeaGreen));
+
+ string msg = $"There is a new version of {productName}{NL}";
+ msg += $"New version: {newVersion}, Current version: {currentVersion}{NL}";
+ msg += "Open download webpage?";
+ DialogResult dr = CustomMessageBox.Show(this, msg, "New Version", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
+ if (dr == DialogResult.OK)
+ OpenLinks.OpenUrl(downloadUrl);
}
}
else
@@ -92,19 +173,19 @@ private async Task CheckUpdate(bool writeToLog = false)
// Link Label Check Update
labelUpdate = string.Empty;
- if (writeToLog)
+ if (showMsg)
{
- string uptodate = $"{NL}You are using the latest version.{NL}{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(uptodate, Color.MediumSeaGreen));
+ string uptodate = $"You are using the latest version.";
+ CustomMessageBox.Show(this, uptodate, "UpToDate", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
else
{
- if (writeToLog)
+ if (showMsg)
{
- string err = $"{NL}Error connecting to update server.{NL}{NL}";
- this.InvokeIt(() => CustomRichTextBoxLog.AppendText(err, Color.IndianRed));
+ string err = $"Error connecting to update server.";
+ CustomMessageBox.Show(this, err, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -115,14 +196,17 @@ private async Task CheckUpdate(bool writeToLog = false)
LinkLabelCheckUpdate.ActiveLinkColor = Color.MediumSeaGreen;
LinkLabelCheckUpdate.LinkColor = Color.MediumSeaGreen;
LinkLabelCheckUpdate.Text = labelUpdate;
- });
+ LinkLabelCheckUpdate.Links.Clear();
+ LinkLabelCheckUpdate.Links.Add(new LinkLabel.Link(0, LinkLabelCheckUpdate.Text.Length, downloadUrl));
- LinkLabelCheckUpdate.LinkClicked -= LinkLabelCheckUpdate_LinkClicked;
- LinkLabelCheckUpdate.LinkClicked += LinkLabelCheckUpdate_LinkClicked;
- void LinkLabelCheckUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- if (!string.IsNullOrEmpty(downloadUrl)) OpenLinks.OpenUrl(downloadUrl);
- }
+ LinkLabelCheckUpdate.LinkClicked -= LinkLabelCheckUpdate_LinkClicked;
+ LinkLabelCheckUpdate.LinkClicked += LinkLabelCheckUpdate_LinkClicked;
+ void LinkLabelCheckUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
+ string? dlUrl = e.Link.LinkData.ToString();
+ if (!string.IsNullOrEmpty(dlUrl)) OpenLinks.OpenUrl(dlUrl);
+ }
+ });
IsCheckingForUpdate = false;
}
@@ -164,7 +248,8 @@ private async void UpdateBools()
ProcessManager.FindProcessByPID(PIDDNSCryptBypass);
// In case dnsproxy or dnscrypt processes terminated
- if (!IsConnected)
+ if (!IsConnected && !IsConnecting && !IsDisconnecting &&
+ !IsQuickConnectWorking && !IsQuickConnecting && !IsQuickDisconnecting && !StopQuickConnect)
{
IsDNSConnected = IsDoHConnected = IsConnected;
LocalDnsLatency = LocalDohLatency = -1;
@@ -174,22 +259,23 @@ private async void UpdateBools()
}
// In case SDCHttpProxy terminated
- if (!IsProxyActivated && !IsSharing && IsProxySet)
+ if (!IsHttpProxyActivated && !IsHttpProxyRunning && IsHttpProxySet)
{
- Network.UnsetProxy(false, false);
+ NetworkTool.UnsetProxy(false, true);
}
// Update bool IsDnsSet
//IsDNSSet = UpdateBoolIsDnsSet(out bool _); // I need to test this on Win7 myself!
// Update bool IsProxySet
- IsProxySet = UpdateBoolIsProxySet();
+ IsHttpProxySet = UpdateBoolIsProxySet();
// Update bool IsGoodbyeDPIActive
- IsGoodbyeDPIActive = ProcessManager.FindProcessByPID(PIDGoodbyeDPI);
+ IsGoodbyeDPIBasicActive = ProcessManager.FindProcessByPID(PIDGoodbyeDPIBasic);
+ IsGoodbyeDPIAdvancedActive = ProcessManager.FindProcessByPID(PIDGoodbyeDPIAdvanced);
// Update bool IsDPIActive
- IsDPIActive = (IsProxyDPIActive || IsGoodbyeDPIActive);
+ IsDPIActive = IsHttpProxyDpiBypassActive || IsGoodbyeDPIBasicActive || IsGoodbyeDPIAdvancedActive;
}
private void UpdateBoolDnsDohAuto()
@@ -208,13 +294,13 @@ private void UpdateBoolDnsDohAuto()
});
}
- private void UpdateBoolDnsOnce(int timeout)
+ private void UpdateBoolDnsOnce(int timeoutMS)
{
if (IsConnected)
{
// DNS
CheckDns checkDns = new(false, GetCPUPriority());
- checkDns.CheckDNS("google.com", IPAddress.Loopback.ToString(), timeout);
+ checkDns.CheckDNS("google.com", IPAddress.Loopback.ToString(), timeoutMS);
LocalDnsLatency = checkDns.DnsLatency;
IsDNSConnected = LocalDnsLatency != -1;
@@ -235,7 +321,7 @@ private void UpdateBoolDnsOnce(int timeout)
}
}
- private void UpdateBoolDohOnce(int timeout)
+ private void UpdateBoolDohOnce(int timeoutMS)
{
if (IsConnected && CustomRadioButtonSettingWorkingModeDNSandDoH.Checked)
{
@@ -246,7 +332,7 @@ private void UpdateBoolDohOnce(int timeout)
else
dohServer = $"https://{IPAddress.Loopback}:{ConnectedDohPort}/dns-query";
CheckDns checkDns = new(false, GetCPUPriority());
- checkDns.CheckDNS("google.com", dohServer, timeout);
+ checkDns.CheckDNS("google.com", dohServer, timeoutMS);
LocalDohLatency = checkDns.DnsLatency;
IsDoHConnected = LocalDohLatency != -1;
@@ -275,10 +361,10 @@ private bool UpdateBoolIsDnsSet(out bool isAnotherDnsSet)
string nicName = File.ReadAllText(SecureDNS.NicNamePath).Replace(NL, string.Empty);
if (nicName.Length > 0)
{
- NetworkInterface? nic = Network.GetNICByName(nicName);
+ NetworkInterface? nic = NetworkTool.GetNICByName(nicName);
if (nic != null)
{
- bool isDnsSet = Network.IsDnsSet(nic, out string dnsServer1, out string _);
+ bool isDnsSet = NetworkTool.IsDnsSet(nic, out string dnsServer1, out string _);
if (!isDnsSet) return false; // DNS is set to DHCP
else
{
@@ -302,20 +388,20 @@ private void UpdateBoolHttpProxyAuto()
{
while (true)
{
- Task.Delay(2000).Wait();
- if (!UpdateProxyBools) continue;
+ Task.Delay(1000).Wait();
+ if (!UpdateHttpProxyBools) continue;
- IsProxyActivated = ProcessManager.FindProcessByPID(PIDHttpProxy);
+ IsHttpProxyActivated = ProcessManager.FindProcessByPID(PIDHttpProxy);
string line = string.Empty;
- if (ProxyProcess != null)
+ if (HttpProxyProcess != null)
{
- if (!UpdateProxyBools) continue;
+ if (!UpdateHttpProxyBools) continue;
try
{
- ProxyProcess.StandardOutput.DiscardBufferedData();
- ProxyProcess.StandardInput.WriteLine("out");
+ HttpProxyProcess.StandardOutput.DiscardBufferedData();
+ HttpProxyProcess.StandardInput.WriteLine("out");
}
catch (Exception)
{
@@ -326,7 +412,7 @@ private void UpdateBoolHttpProxyAuto()
{
try
{
- string l = ProxyProcess.StandardOutput.ReadLine() ?? string.Empty;
+ string l = HttpProxyProcess.StandardOutput.ReadLine() ?? string.Empty;
Task.Delay(200).Wait();
if (l.StartsWith("details")) line = l;
}
@@ -347,16 +433,16 @@ private void UpdateBoolHttpProxyAuto()
if (string.IsNullOrEmpty(line) || string.IsNullOrWhiteSpace(line))
{
- IsSharing = false; ProxyRequests = 0; ProxyMaxRequests = 250; IsProxyDPIActive = false;
+ IsHttpProxyRunning = false; HttpProxyRequests = 0; HttpProxyMaxRequests = 250; IsHttpProxyDpiBypassActive = false;
}
else if (line.StartsWith("details"))
{
string[] split = line.Split('|');
- if (bool.TryParse(split[1].ToLower(), out bool sharing)) IsSharing = sharing;
- if (int.TryParse(split[2].ToLower(), out int port)) ProxyPort = port;
- if (int.TryParse(split[3].ToLower(), out int requests)) ProxyRequests = requests;
- if (int.TryParse(split[4].ToLower(), out int maxRequests)) ProxyMaxRequests = maxRequests;
- if (bool.TryParse(split[5].ToLower(), out bool dpiActive)) IsProxyDPIActive = dpiActive;
+ if (bool.TryParse(split[1].ToLower(), out bool sharing)) IsHttpProxyRunning = sharing;
+ if (int.TryParse(split[2].ToLower(), out int port)) HttpProxyPort = port;
+ if (int.TryParse(split[3].ToLower(), out int requests)) HttpProxyRequests = requests;
+ if (int.TryParse(split[4].ToLower(), out int maxRequests)) HttpProxyMaxRequests = maxRequests;
+ if (bool.TryParse(split[5].ToLower(), out bool dpiActive)) IsHttpProxyDpiBypassActive = dpiActive;
if (split[6].ToLower().Equals("disable")) ProxyStaticDPIBypassMode = HTTPProxyServer.Program.DPIBypass.Mode.Disable;
else if (split[6].ToLower().Equals("program")) ProxyStaticDPIBypassMode = HTTPProxyServer.Program.DPIBypass.Mode.Program;
@@ -394,22 +480,19 @@ private void UpdateBoolHttpProxyAuto()
private bool UpdateBoolIsProxySet()
{
- if (IsSharing)
- {
- bool isAnyProxySet = Network.IsProxySet(out string httpProxy, out string _, out string _, out string _);
- if (isAnyProxySet)
- if (!string.IsNullOrEmpty(httpProxy))
- if (httpProxy.Contains(':'))
- {
- string[] split = httpProxy.Split(':');
- string ip = split[0];
- string portS = split[1];
- bool isPortInt = int.TryParse(portS, out int port);
- if (isPortInt)
- if (ip == IPAddress.Loopback.ToString() && port == ProxyPort)
- return true;
- }
- }
+ bool isAnyProxySet = NetworkTool.IsProxySet(out string httpProxy, out string _, out string _, out string _);
+ if (isAnyProxySet)
+ if (!string.IsNullOrEmpty(httpProxy))
+ if (httpProxy.Contains(':'))
+ {
+ string[] split = httpProxy.Split(':');
+ string ip = split[0];
+ string portS = split[1];
+ bool isPortInt = int.TryParse(portS, out int port);
+ if (isPortInt)
+ if (ip == IPAddress.Loopback.ToString() && port == HttpProxyPort)
+ return true;
+ }
return false;
}
@@ -433,36 +516,72 @@ private void UpdateStatusShort()
CustomRichTextBoxStatusWorkingServers.AppendText("Working Servers: ", ForeColor);
CustomRichTextBoxStatusWorkingServers.AppendText(NumberOfWorkingServers.ToString(), Color.DodgerBlue);
- // Check Button
- CustomButtonCheck.Enabled = !IsConnecting;
-
- // Insecure and parallel
+ // Insecure and parallel CheckBox
if (CustomCheckBoxInsecure.Checked)
CustomCheckBoxCheckInParallel.Checked = false;
- // Connect Button
- if (!CustomRadioButtonConnectCheckedServers.Checked)
- {
- CustomButtonConnect.Enabled = true;
- }
+ // Check Button Text
+ if (StopChecking) CustomButtonCheck.Text = "Stopping...";
else
+ CustomButtonCheck.Text = IsCheckingStarted ? "Stop" : "Scan";
+
+ // Check Button Enable
+ CustomButtonCheck.Enabled = !IsConnecting && !StopChecking;
+
+ // Connect to popular servers using proxy Textbox
+ CustomTextBoxHTTPProxy.Enabled = CustomRadioButtonConnectDNSCrypt.Checked;
+
+ // Connect Button Text
+ if (IsDisconnecting) CustomButtonConnect.Text = "Disconnecting...";
+ else if (IsConnecting) CustomButtonConnect.Text = "Stop";
+ else CustomButtonConnect.Text = IsConnected ? "Disconnect" : "Connect";
+
+ // Connect Button Enable
+ if (CustomRadioButtonConnectCheckedServers.Checked)
{
- if (WorkingDnsList.Any() && !IsCheckingStarted && !IsConnecting)
- CustomButtonConnect.Enabled = true;
+ if (WorkingDnsList.Any())
+ CustomButtonConnect.Enabled = !IsDisconnecting;
else
CustomButtonConnect.Enabled = IsConnected;
}
+ else
+ {
+ CustomButtonConnect.Enabled = !IsDisconnecting;
+ }
- // Connect to popular servers using proxy Textbox
- CustomTextBoxHTTPProxy.Enabled = CustomRadioButtonConnectDNSCrypt.Checked;
+ // SetDNS Button Text
+ if (IsDNSUnsetting) CustomButtonSetDNS.Text = "Unsetting...";
+ else if (IsDNSSetting) CustomButtonSetDNS.Text = "Setting...";
+ else CustomButtonSetDNS.Text = IsDNSSet ? "Unset DNS" : "Set DNS";
+
+ // SetDNS Button Enable
+ CustomButtonSetDNS.Enabled = (IsConnected && (IsDNSConnected || IsDoHConnected) && !IsDNSSetting && !IsDNSUnsetting);
+
+ // StartProxy Buttom Text
+ if (IsHttpProxyDeactivating) CustomButtonShare.Text = "Stopping...";
+ else if (IsHttpProxyActivating) CustomButtonShare.Text = "Starting...";
+ else CustomButtonShare.Text = IsHttpProxyActivated ? "Stop Proxy" : "Start Proxy";
+
+ // StartProxy Buttom Enable
+ CustomButtonShare.Enabled = !IsHttpProxyActivating && !IsHttpProxyDeactivating;
+
+ // SetProxy Button Text
+ CustomButtonSetProxy.Text = IsHttpProxySet ? "Unset Proxy" : "Set Proxy";
+
+ // SetProxy Button Enable
+ CustomButtonSetProxy.Enabled = IsHttpProxyActivated && IsHttpProxyRunning;
+
+ // GoodbyeDPI Basic Activate/Reactivate Button Text
+ CustomButtonDPIBasicActivate.Text = IsGoodbyeDPIBasicActive ? "Reactivate" : "Activate";
+
+ // GoodbyeDPI Basic Deactivate Button Enable
+ CustomButtonDPIBasicDeactivate.Enabled = IsGoodbyeDPIBasicActive;
- // SetDNS Button
- if (IsConnected && (IsDNSConnected || IsDoHConnected))
- CustomButtonSetDNS.Enabled = true;
+ // GoodbyeDPI Advanced Activate/Reactivate Button Text
+ CustomButtonDPIAdvActivate.Text = IsGoodbyeDPIAdvancedActive ? "Reactivate" : "Activate";
- // SetProxy Button
- if (IsProxyActivated && IsSharing)
- CustomButtonSetProxy.Enabled = true;
+ // GoodbyeDPI Advanced Deactivate Button Enable
+ CustomButtonDPIAdvDeactivate.Enabled = IsGoodbyeDPIAdvancedActive;
// Settings -> Share -> Advanced
CustomTextBoxSettingHTTPProxyCfCleanIP.Enabled = CustomCheckBoxSettingHTTPProxyCfCleanIP.Checked;
@@ -526,8 +645,8 @@ private void UpdateStatusLong()
this.InvokeIt(() => CustomRichTextBoxStatusIsDNSSet.AppendText(textDNS, colorDNS));
// Update Status IsSharing
- string textSharing = IsSharing ? "Yes" : "No";
- Color colorSharing = IsSharing ? Color.MediumSeaGreen : Color.IndianRed;
+ string textSharing = IsHttpProxyRunning ? "Yes" : "No";
+ Color colorSharing = IsHttpProxyRunning ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusIsSharing.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusIsSharing.AppendText("Is Sharing: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusIsSharing.AppendText(textSharing, colorSharing));
@@ -535,29 +654,29 @@ private void UpdateStatusLong()
// Update Status ProxyRequests
string textProxyRequests = "0 of 0";
Color colorProxyRequests = Color.MediumSeaGreen;
- textProxyRequests = $"{ProxyRequests} of {ProxyMaxRequests}";
- colorProxyRequests = ProxyRequests < ProxyMaxRequests ? Color.MediumSeaGreen : Color.IndianRed;
+ textProxyRequests = $"{HttpProxyRequests} of {HttpProxyMaxRequests}";
+ colorProxyRequests = HttpProxyRequests < HttpProxyMaxRequests ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusProxyRequests.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusProxyRequests.AppendText("Proxy Requests ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusProxyRequests.AppendText(textProxyRequests, colorProxyRequests));
// Update Status IsProxySet
- string textProxySet = IsProxySet ? "Yes" : "No";
- Color colorProxySet = IsProxySet ? Color.MediumSeaGreen : Color.IndianRed;
+ string textProxySet = IsHttpProxySet ? "Yes" : "No";
+ Color colorProxySet = IsHttpProxySet ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusIsProxySet.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusIsProxySet.AppendText("Is Proxy Set: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusIsProxySet.AppendText(textProxySet, colorProxySet));
// Update Status IsProxyDPIActive
- string textProxyDPI = IsProxyDPIActive ? "Active" : "Inactive";
- Color colorProxyDPI = IsProxyDPIActive ? Color.MediumSeaGreen : Color.IndianRed;
+ string textProxyDPI = IsHttpProxyDpiBypassActive ? "Active" : "Inactive";
+ Color colorProxyDPI = IsHttpProxyDpiBypassActive ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusProxyDpiBypass.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusProxyDpiBypass.AppendText("Proxy DPI Bypass: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusProxyDpiBypass.AppendText(textProxyDPI, colorProxyDPI));
// Update Status IsGoodbyeDPIActive
- string textGoodbyeDPI = IsGoodbyeDPIActive ? "Active" : "Inactive";
- Color colorGoodbyeDPI = IsGoodbyeDPIActive ? Color.MediumSeaGreen : Color.IndianRed;
+ string textGoodbyeDPI = (IsGoodbyeDPIBasicActive || IsGoodbyeDPIAdvancedActive) ? "Active" : "Inactive";
+ Color colorGoodbyeDPI = (IsGoodbyeDPIBasicActive || IsGoodbyeDPIAdvancedActive) ? Color.MediumSeaGreen : Color.IndianRed;
this.InvokeIt(() => CustomRichTextBoxStatusGoodbyeDPI.ResetText());
this.InvokeIt(() => CustomRichTextBoxStatusGoodbyeDPI.AppendText("GoodbyeDPI: ", ForeColor));
this.InvokeIt(() => CustomRichTextBoxStatusGoodbyeDPI.AppendText(textGoodbyeDPI, colorGoodbyeDPI));
@@ -592,23 +711,25 @@ private void UpdateStatusCpuUsageAuto()
private async Task GetCpuUsage(int delay)
{
float sdc = -1, sdcHttpProxy = -1, sdcFakeProxy = -1;
- float dnsproxy1 = -1, dnscrypt1 = -1, goodbyedpi1 = -1;
- float dnsproxy2 = -1, dnscrypt2 = -1, goodbyedpi2 = -1;
+ float dnsproxy1 = -1, dnscrypt1 = -1, goodbyeDpiBasic = -1, goodbyeDpiAdvanced = -1;
+ float dnsproxy2 = -1, dnscrypt2 = -1, goodbyeDpiBypass = -1;
Task a = Task.Run(async () => sdc = await ProcessManager.GetCpuUsage(Process.GetCurrentProcess(), delay));
Task b = Task.Run(async () => sdcHttpProxy = await ProcessManager.GetCpuUsage(PIDHttpProxy, delay));
- Task c = Task.Run(async () => sdcFakeProxy = await ProcessManager.GetCpuUsage(PIDFakeProxy, delay));
+ Task c = Task.Run(async () => sdcFakeProxy = await ProcessManager.GetCpuUsage(PIDFakeHttpProxy, delay));
Task d = Task.Run(async () => dnsproxy1 = await ProcessManager.GetCpuUsage(PIDDNSProxy, delay));
Task e = Task.Run(async () => dnsproxy2 = await ProcessManager.GetCpuUsage(PIDDNSProxyBypass, delay));
Task f = Task.Run(async () => dnscrypt1 = await ProcessManager.GetCpuUsage(PIDDNSCrypt, delay));
Task g = Task.Run(async () => dnscrypt2 = await ProcessManager.GetCpuUsage(PIDDNSCryptBypass, delay));
- Task h = Task.Run(async () => goodbyedpi1 = await ProcessManager.GetCpuUsage(PIDGoodbyeDPI, delay));
- Task i = Task.Run(async () => goodbyedpi2 = await ProcessManager.GetCpuUsage(PIDGoodbyeDPIBypass, delay));
+ Task h = Task.Run(async () => goodbyeDpiBasic = await ProcessManager.GetCpuUsage(PIDGoodbyeDPIBasic, delay));
+ Task i = Task.Run(async () => goodbyeDpiAdvanced = await ProcessManager.GetCpuUsage(PIDGoodbyeDPIAdvanced, delay));
+ Task j = Task.Run(async () => goodbyeDpiBypass = await ProcessManager.GetCpuUsage(PIDGoodbyeDPIBypass, delay));
- await Task.WhenAll(a, b, c, d, e, f, g, h, i);
+ await Task.WhenAll(a, b, c, d, e, f, g, h, i, j);
float sum = 0;
List list = new();
+ list.Clear();
if (sdc != -1) list.Add(sdc);
if (sdcHttpProxy != -1) list.Add(sdcHttpProxy);
if (sdcFakeProxy != -1) list.Add(sdcFakeProxy);
@@ -616,8 +737,9 @@ private async Task GetCpuUsage(int delay)
if (dnsproxy2 != -1) list.Add(dnsproxy2);
if (dnscrypt1 != -1) list.Add(dnscrypt1);
if (dnscrypt2 != -1) list.Add(dnscrypt2);
- if (goodbyedpi1 != -1) list.Add(goodbyedpi1);
- if (goodbyedpi2 != -1) list.Add(goodbyedpi2);
+ if (goodbyeDpiBasic != -1) list.Add(goodbyeDpiBasic);
+ if (goodbyeDpiAdvanced != -1) list.Add(goodbyeDpiAdvanced);
+ if (goodbyeDpiBypass != -1) list.Add(goodbyeDpiBypass);
for (int n = 0; n < list.Count; n++) sum += list[n];
double result = Math.Round(Convert.ToDouble(sum), 2);
@@ -690,7 +812,7 @@ private void PlayAudioAlert()
ProcessManager.ResumeProcess(softEtherPID);
}
- if (IsSharing && (ProxyRequests >= ProxyMaxRequests) && !AudioAlertRequestsExceeded)
+ if (IsHttpProxyRunning && (HttpProxyRequests >= HttpProxyMaxRequests) && !AudioAlertRequestsExceeded)
{
AudioAlertRequestsExceeded = true;
Task.Run(() =>
@@ -702,7 +824,7 @@ private void PlayAudioAlert()
});
}
- if (ProxyRequests < ProxyMaxRequests - 5)
+ if (HttpProxyRequests < HttpProxyMaxRequests - 5)
AudioAlertRequestsExceeded = false;
StopWatchAudioAlertDelay.Stop();
diff --git a/SecureDNSClient/NecessaryFiles/Resource1.Designer.cs b/SecureDNSClient/NecessaryFiles/Resource1.Designer.cs
index 30d9870..14c8dd5 100644
--- a/SecureDNSClient/NecessaryFiles/Resource1.Designer.cs
+++ b/SecureDNSClient/NecessaryFiles/Resource1.Designer.cs
@@ -131,9 +131,9 @@ internal static byte[] SDCHttpProxy {
}
///
- /// Looks up a localized string similar to dnscrypt-proxy 2.1.4
- ///dnslookup 1.9.1
- ///dnsproxy 0.50.2
+ /// Looks up a localized string similar to dnscrypt-proxy 2.1.5
+ ///dnslookup 1.9.2
+ ///dnsproxy 0.54.0
///sdchttpproxy 2.3.6
///goodbyedpi 0.2.2.
///
diff --git a/SecureDNSClient/NecessaryFiles/Resource1.resx b/SecureDNSClient/NecessaryFiles/Resource1.resx
index aaa8a68..b5d291f 100644
--- a/SecureDNSClient/NecessaryFiles/Resource1.resx
+++ b/SecureDNSClient/NecessaryFiles/Resource1.resx
@@ -112,12 +112,12 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
dnscrypt-proxy.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
diff --git a/SecureDNSClient/NecessaryFiles/dnscrypt-proxy.exe b/SecureDNSClient/NecessaryFiles/dnscrypt-proxy.exe
index 97299cd..5fe9fdc 100644
Binary files a/SecureDNSClient/NecessaryFiles/dnscrypt-proxy.exe and b/SecureDNSClient/NecessaryFiles/dnscrypt-proxy.exe differ
diff --git a/SecureDNSClient/NecessaryFiles/dnslookup.exe b/SecureDNSClient/NecessaryFiles/dnslookup.exe
index 0b1c09b..d153a2a 100644
Binary files a/SecureDNSClient/NecessaryFiles/dnslookup.exe and b/SecureDNSClient/NecessaryFiles/dnslookup.exe differ
diff --git a/SecureDNSClient/NecessaryFiles/dnsproxy.exe b/SecureDNSClient/NecessaryFiles/dnsproxy.exe
index abe0deb..982c57d 100644
Binary files a/SecureDNSClient/NecessaryFiles/dnsproxy.exe and b/SecureDNSClient/NecessaryFiles/dnsproxy.exe differ
diff --git a/SecureDNSClient/NecessaryFiles/versions.txt b/SecureDNSClient/NecessaryFiles/versions.txt
index e8d4c62..a22cde5 100644
--- a/SecureDNSClient/NecessaryFiles/versions.txt
+++ b/SecureDNSClient/NecessaryFiles/versions.txt
@@ -1,5 +1,5 @@
-dnscrypt-proxy 2.1.4
-dnslookup 1.9.1
-dnsproxy 0.50.2
+dnscrypt-proxy 2.1.5
+dnslookup 1.9.2
+dnsproxy 0.54.0
sdchttpproxy 2.3.6
goodbyedpi 0.2.2
\ No newline at end of file
diff --git a/SecureDNSClient/Program.cs b/SecureDNSClient/Program.cs
index 00261f5..41ffcf6 100644
--- a/SecureDNSClient/Program.cs
+++ b/SecureDNSClient/Program.cs
@@ -1,4 +1,4 @@
-using MsmhTools;
+using MsmhToolsClass;
using System.Reflection;
namespace SecureDNSClient
diff --git a/SecureDNSClient/Properties/PublishProfiles/FolderProfile.pubxml.user b/SecureDNSClient/Properties/PublishProfiles/FolderProfile.pubxml.user
index 55b5e96..2ece3c3 100644
--- a/SecureDNSClient/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/SecureDNSClient/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -4,6 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
- True|2023-08-07T07:35:28.9426536Z;True|2023-08-01T19:24:40.5252762+04:30;True|2023-08-01T19:15:41.4620135+04:30;True|2023-08-01T18:45:45.3880616+04:30;True|2023-07-31T02:12:04.5448192+04:30;True|2023-07-31T00:04:46.0894144+04:30;True|2023-07-31T00:01:33.6095925+04:30;True|2023-07-30T21:43:56.3111067+04:30;True|2023-07-30T21:12:58.0148728+04:30;True|2023-07-30T21:12:04.4089924+04:30;True|2023-07-30T21:08:02.5981217+04:30;True|2023-07-30T20:59:26.1393550+04:30;True|2023-07-30T20:49:10.0641504+04:30;True|2023-07-30T20:37:55.0060946+04:30;True|2023-07-30T19:59:45.2211753+04:30;True|2023-07-30T19:22:27.2089781+04:30;True|2023-07-30T18:59:16.4344534+04:30;True|2023-07-30T18:18:36.0414670+04:30;True|2023-07-30T17:53:16.0490028+04:30;True|2023-07-30T17:17:30.2774165+04:30;True|2023-07-30T02:41:58.4359505+04:30;True|2023-07-30T01:47:45.1815278+04:30;True|2023-07-30T01:39:19.1433492+04:30;True|2023-07-30T01:36:00.2507530+04:30;True|2023-07-30T01:29:16.5405756+04:30;True|2023-07-30T00:58:07.8090602+04:30;True|2023-07-29T23:47:20.3162431+04:30;True|2023-07-29T22:55:03.7928616+04:30;True|2023-07-17T22:32:20.6598533+04:30;True|2023-07-17T21:50:48.4709956+04:30;True|2023-07-17T21:41:55.9459002+04:30;True|2023-07-17T21:18:13.0811919+04:30;True|2023-07-04T20:14:27.5923252+04:30;True|2023-07-03T17:04:51.8596933+04:30;True|2023-06-28T20:50:29.7354161+04:30;True|2023-06-28T20:45:12.9586472+04:30;True|2023-06-28T20:36:22.0289215+04:30;True|2023-06-28T20:16:14.5797027+04:30;True|2023-06-17T16:31:05.5599274+04:30;True|2023-06-17T14:52:35.3347651+04:30;True|2023-06-04T19:48:51.8162459+04:30;True|2023-06-04T17:30:12.3301548+04:30;True|2023-06-02T21:18:20.3636677+04:30;True|2023-06-02T20:51:04.1304394+04:30;True|2023-06-02T20:25:56.5067353+04:30;True|2023-06-02T20:22:14.1787902+04:30;True|2023-06-02T17:15:42.7452611+04:30;True|2023-05-30T17:58:01.2450123+04:30;True|2023-05-29T20:36:32.5291896+04:30;True|2023-05-29T20:18:12.2031439+04:30;True|2023-05-29T19:44:46.0704739+04:30;True|2023-05-27T17:25:56.0498058+04:30;True|2023-05-27T14:50:19.0862471+04:30;True|2023-05-26T00:33:02.8133052+04:30;True|2023-05-26T00:22:55.5762345+04:30;True|2023-05-19T21:55:55.2053137+04:30;True|2023-05-04T21:14:13.1959990+04:30;True|2023-05-03T18:38:41.0925495+04:30;True|2023-05-03T18:22:56.1278337+04:30;True|2023-04-07T19:23:03.7575436+04:30;True|2023-04-07T19:01:53.8374192+04:30;True|2023-04-07T18:56:48.3465035+04:30;True|2023-02-23T19:42:36.6931238+03:30;True|2023-02-21T23:02:29.4417103+03:30;True|2023-02-21T22:58:29.4403662+03:30;True|2023-02-21T22:48:24.4128535+03:30;True|2023-02-21T22:27:17.9388815+03:30;True|2023-02-20T17:48:08.6532315+03:30;True|2023-02-16T01:42:22.8837631+03:30;True|2023-02-16T01:39:16.7954793+03:30;True|2023-02-15T21:24:18.8085514+03:30;True|2023-02-15T21:18:04.1969211+03:30;True|2023-02-15T21:15:01.3739223+03:30;True|2023-02-08T06:22:33.0414550+03:30;True|2023-02-08T05:20:18.9270105+03:30;True|2023-02-08T05:15:17.5374116+03:30;True|2023-02-08T05:03:44.0882459+03:30;True|2023-02-08T04:53:40.5516012+03:30;True|2023-02-08T02:23:19.0633758+03:30;
+ True|2023-09-06T14:14:41.6405987Z;True|2023-09-06T18:22:07.3334171+04:30;False|2023-09-06T18:18:40.3448050+04:30;True|2023-08-27T22:27:13.6015442+04:30;True|2023-08-07T12:05:28.9426536+04:30;True|2023-08-01T19:24:40.5252762+04:30;True|2023-08-01T19:15:41.4620135+04:30;True|2023-08-01T18:45:45.3880616+04:30;True|2023-07-31T02:12:04.5448192+04:30;True|2023-07-31T00:04:46.0894144+04:30;True|2023-07-31T00:01:33.6095925+04:30;True|2023-07-30T21:43:56.3111067+04:30;True|2023-07-30T21:12:58.0148728+04:30;True|2023-07-30T21:12:04.4089924+04:30;True|2023-07-30T21:08:02.5981217+04:30;True|2023-07-30T20:59:26.1393550+04:30;True|2023-07-30T20:49:10.0641504+04:30;True|2023-07-30T20:37:55.0060946+04:30;True|2023-07-30T19:59:45.2211753+04:30;True|2023-07-30T19:22:27.2089781+04:30;True|2023-07-30T18:59:16.4344534+04:30;True|2023-07-30T18:18:36.0414670+04:30;True|2023-07-30T17:53:16.0490028+04:30;True|2023-07-30T17:17:30.2774165+04:30;True|2023-07-30T02:41:58.4359505+04:30;True|2023-07-30T01:47:45.1815278+04:30;True|2023-07-30T01:39:19.1433492+04:30;True|2023-07-30T01:36:00.2507530+04:30;True|2023-07-30T01:29:16.5405756+04:30;True|2023-07-30T00:58:07.8090602+04:30;True|2023-07-29T23:47:20.3162431+04:30;True|2023-07-29T22:55:03.7928616+04:30;True|2023-07-17T22:32:20.6598533+04:30;True|2023-07-17T21:50:48.4709956+04:30;True|2023-07-17T21:41:55.9459002+04:30;True|2023-07-17T21:18:13.0811919+04:30;True|2023-07-04T20:14:27.5923252+04:30;True|2023-07-03T17:04:51.8596933+04:30;True|2023-06-28T20:50:29.7354161+04:30;True|2023-06-28T20:45:12.9586472+04:30;True|2023-06-28T20:36:22.0289215+04:30;True|2023-06-28T20:16:14.5797027+04:30;True|2023-06-17T16:31:05.5599274+04:30;True|2023-06-17T14:52:35.3347651+04:30;True|2023-06-04T19:48:51.8162459+04:30;True|2023-06-04T17:30:12.3301548+04:30;True|2023-06-02T21:18:20.3636677+04:30;True|2023-06-02T20:51:04.1304394+04:30;True|2023-06-02T20:25:56.5067353+04:30;True|2023-06-02T20:22:14.1787902+04:30;True|2023-06-02T17:15:42.7452611+04:30;True|2023-05-30T17:58:01.2450123+04:30;True|2023-05-29T20:36:32.5291896+04:30;True|2023-05-29T20:18:12.2031439+04:30;True|2023-05-29T19:44:46.0704739+04:30;True|2023-05-27T17:25:56.0498058+04:30;True|2023-05-27T14:50:19.0862471+04:30;True|2023-05-26T00:33:02.8133052+04:30;True|2023-05-26T00:22:55.5762345+04:30;True|2023-05-19T21:55:55.2053137+04:30;True|2023-05-04T21:14:13.1959990+04:30;True|2023-05-03T18:38:41.0925495+04:30;True|2023-05-03T18:22:56.1278337+04:30;True|2023-04-07T19:23:03.7575436+04:30;True|2023-04-07T19:01:53.8374192+04:30;True|2023-04-07T18:56:48.3465035+04:30;True|2023-02-23T19:42:36.6931238+03:30;True|2023-02-21T23:02:29.4417103+03:30;True|2023-02-21T22:58:29.4403662+03:30;True|2023-02-21T22:48:24.4128535+03:30;True|2023-02-21T22:27:17.9388815+03:30;True|2023-02-20T17:48:08.6532315+03:30;True|2023-02-16T01:42:22.8837631+03:30;True|2023-02-16T01:39:16.7954793+03:30;True|2023-02-15T21:24:18.8085514+03:30;True|2023-02-15T21:18:04.1969211+03:30;True|2023-02-15T21:15:01.3739223+03:30;True|2023-02-08T06:22:33.0414550+03:30;True|2023-02-08T05:20:18.9270105+03:30;True|2023-02-08T05:15:17.5374116+03:30;True|2023-02-08T05:03:44.0882459+03:30;True|2023-02-08T04:53:40.5516012+03:30;True|2023-02-08T02:23:19.0633758+03:30;
+
\ No newline at end of file
diff --git a/SecureDNSClient/Properties/Resources.Designer.cs b/SecureDNSClient/Properties/Resources.Designer.cs
index 6a7ca36..0503289 100644
--- a/SecureDNSClient/Properties/Resources.Designer.cs
+++ b/SecureDNSClient/Properties/Resources.Designer.cs
@@ -83,11 +83,101 @@ internal static System.Drawing.Bitmap FarvaharBlueRed {
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
- internal static System.Drawing.Bitmap SecureDNSClient {
+ internal static System.Drawing.Bitmap FarvaharBlueRed128x60 {
get {
- object obj = ResourceManager.GetObject("SecureDNSClient", resourceCulture);
+ object obj = ResourceManager.GetObject("FarvaharBlueRed128x60", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_B {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_B", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_B_Multi {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_B_Multi", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_BR {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_BR", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_BR_Multi {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_BR_Multi", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap SecureDNSClient_PNG {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_PNG", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_R {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_R", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_R_Multi {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_R_Multi", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_RB {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_RB", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
+
+ ///
+ /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
+ ///
+ internal static System.Drawing.Icon SecureDNSClient_RB_Multi {
+ get {
+ object obj = ResourceManager.GetObject("SecureDNSClient_RB_Multi", resourceCulture);
+ return ((System.Drawing.Icon)(obj));
+ }
+ }
}
}
diff --git a/SecureDNSClient/Properties/Resources.resx b/SecureDNSClient/Properties/Resources.resx
index b6bc2fb..aa6ea64 100644
--- a/SecureDNSClient/Properties/Resources.resx
+++ b/SecureDNSClient/Properties/Resources.resx
@@ -112,19 +112,46 @@
2.0
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
- ..\Resources\Farvahar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+ ..\SdcResources\Farvahar.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
- ..\Resources\FarvaharBlueRed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+ ..\SdcResources\FarvaharBlueRed.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
- ..\Resources\SecureDNSClient.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\SdcResources\FarvaharBlueRed128x60.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_B.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_BR.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_BR_Multi.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_B_Multi.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_PNG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_R.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_RB.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_RB_Multi.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\SdcResources\SecureDNSClient_R_Multi.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
\ No newline at end of file
diff --git a/SecureDNSClient/Resources/Farvahar.png b/SecureDNSClient/Resources/Farvahar.png
deleted file mode 100644
index 7f4b1f5..0000000
Binary files a/SecureDNSClient/Resources/Farvahar.png and /dev/null differ
diff --git a/SecureDNSClient/Resources/FarvaharBlueRed.png b/SecureDNSClient/Resources/FarvaharBlueRed.png
deleted file mode 100644
index 2c17e0f..0000000
Binary files a/SecureDNSClient/Resources/FarvaharBlueRed.png and /dev/null differ
diff --git a/SecureDNSClient/Resources/FarvaharBlueRed128x60.png b/SecureDNSClient/Resources/FarvaharBlueRed128x60.png
deleted file mode 100644
index e3b8a0c..0000000
Binary files a/SecureDNSClient/Resources/FarvaharBlueRed128x60.png and /dev/null differ
diff --git a/SecureDNSClient/Resources/SecureDNSClient.png b/SecureDNSClient/Resources/SecureDNSClient.png
deleted file mode 100644
index 26df7db..0000000
Binary files a/SecureDNSClient/Resources/SecureDNSClient.png and /dev/null differ
diff --git a/SecureDNSClient/SecureDNS/CamouflageDNSServer.cs b/SecureDNSClient/SecureDNS/CamouflageDNSServer.cs
index 1e542b4..dfc8ac2 100644
--- a/SecureDNSClient/SecureDNS/CamouflageDNSServer.cs
+++ b/SecureDNSClient/SecureDNS/CamouflageDNSServer.cs
@@ -1,9 +1,8 @@
using System;
-using System.Linq;
using ARSoft.Tools.Net;
using ARSoft.Tools.Net.Dns;
using System.Net;
-using MsmhTools;
+using MsmhToolsClass;
namespace SecureDNSClient
{
@@ -22,7 +21,7 @@ public CamouflageDNSServer(int port, string dohUrl, string dohCleanIP)
Port = port;
DohUrl = dohUrl.Trim();
DohCleanIP = dohCleanIP.Trim();
- Network.GetUrlDetails(dohUrl.Trim(), 443, out string host, out int dohPort, out string _, out bool _);
+ NetworkTool.GetUrlDetails(dohUrl.Trim(), 443, out _, out string host, out int dohPort, out string _, out bool _);
DohHost = host;
DohPort = dohPort;
}
diff --git a/SecureDNSClient/SecureDNS/CheckDns.cs b/SecureDNSClient/SecureDNS/CheckDns.cs
index 9b29f46..836b263 100644
--- a/SecureDNSClient/SecureDNS/CheckDns.cs
+++ b/SecureDNSClient/SecureDNS/CheckDns.cs
@@ -1,4 +1,4 @@
-using MsmhTools;
+using MsmhToolsClass;
using System;
using System.Diagnostics;
using System.Net;
@@ -17,11 +17,12 @@ public class CheckDns
public bool IsSafeSearch { get; private set; } = false;
public bool IsAdultFilter { get; private set; } = false;
public bool CheckForFilters { get; private set; }
+ public string AdultDomainToCheck { get; set; } = "pornhub.com";
private List SafeSearchIpList { get; set; } = new();
private List AdultIpList { get; set; } = new();
+ private string DNS = string.Empty;
private static ProcessPriorityClass ProcessPriority;
- private string AdultDomainToCheck { get; set; } = "pornhub.com";
///
/// Check DNS Servers
@@ -34,19 +35,21 @@ public CheckDns(bool checkForFilters, ProcessPriorityClass processPriorityClass)
CheckForFilters = checkForFilters;
}
+ //================================= Check DNS
+
///
/// Check DNS and get latency (ms)
///
///
///
///
- /// Returns -1 if DNS fail
public void CheckDNS(string domain, string dnsServer, int timeoutMS)
{
+ DNS = dnsServer;
IsDnsOnline = false;
Stopwatch stopwatch = new();
stopwatch.Start();
- IsDnsOnline = CheckDnsWork(domain, dnsServer, timeoutMS, ProcessPriority);
+ IsDnsOnline = CheckDnsWork(domain, DNS, timeoutMS, ProcessPriority);
stopwatch.Stop();
DnsLatency = IsDnsOnline ? Convert.ToInt32(stopwatch.ElapsedMilliseconds) : -1;
@@ -55,7 +58,7 @@ public void CheckDNS(string domain, string dnsServer, int timeoutMS)
IsAdultFilter = false;
if (CheckForFilters && IsDnsOnline)
{
- CheckDnsFilters(dnsServer, timeoutMS + 500, out bool isSafeSearch, out bool isAdultFilter);
+ CheckDnsFilters(DNS, out bool isSafeSearch, out bool isAdultFilter);
IsSafeSearch = isSafeSearch;
IsAdultFilter = isAdultFilter;
}
@@ -67,13 +70,13 @@ public void CheckDNS(string domain, string dnsServer, int timeoutMS)
///
///
///
- /// Returns -1 if DNS fail
public void CheckDNS(bool insecure, string domain, string dnsServer, int timeoutMS, int localPort, string bootstrap, int bootsratPort)
{
+ DNS = dnsServer;
IsDnsOnline = false;
Stopwatch stopwatch = new();
stopwatch.Start();
- IsDnsOnline = CheckDnsWork(insecure, domain, dnsServer, timeoutMS, localPort, bootstrap, bootsratPort, ProcessPriority);
+ IsDnsOnline = CheckDnsWork(insecure, domain, DNS, timeoutMS, localPort, bootstrap, bootsratPort, ProcessPriority);
stopwatch.Stop();
DnsLatency = IsDnsOnline ? Convert.ToInt32(stopwatch.ElapsedMilliseconds) : -1;
@@ -82,12 +85,64 @@ public void CheckDNS(bool insecure, string domain, string dnsServer, int timeout
IsAdultFilter = false;
if (CheckForFilters && IsDnsOnline)
{
- CheckDnsFilters(dnsServer, timeoutMS + 500, out bool isSafeSearch, out bool isAdultFilter);
+ CheckDnsFilters(DNS, out bool isSafeSearch, out bool isAdultFilter);
IsSafeSearch = isSafeSearch;
IsAdultFilter = isAdultFilter;
}
}
+ private static bool CheckDnsWork(string domain, string dnsServer, int timeoutMS, ProcessPriorityClass processPriorityClass)
+ {
+ var task = Task.Run(() =>
+ {
+ string args = domain + " " + dnsServer;
+ string? result = ProcessManager.Execute(out Process _, SecureDNS.DnsLookup, args, true, false, SecureDNS.CurrentPath, processPriorityClass);
+
+ if (!string.IsNullOrEmpty(result))
+ {
+ return result.Contains("ANSWER SECTION");
+ }
+ else
+ return false;
+ });
+
+ if (task.Wait(TimeSpan.FromMilliseconds(timeoutMS)))
+ return task.Result;
+ else
+ return false;
+ }
+
+ private static bool CheckDnsWork(bool insecure, string domain, string dnsServer, int timeoutMS, int localPort, string bootstrap, int bootsratPort, ProcessPriorityClass processPriorityClass)
+ {
+ Task task = Task.Run(() =>
+ {
+ // Start local server
+ string dnsProxyArgs = $"-l {IPAddress.Loopback} -p {localPort} ";
+ if (insecure) dnsProxyArgs += "--insecure ";
+ dnsProxyArgs += $"-u {dnsServer} -b {bootstrap}:{bootsratPort}";
+ int localServerPID = ProcessManager.ExecuteOnly(out Process _, SecureDNS.DnsProxy, dnsProxyArgs, true, false, SecureDNS.CurrentPath, processPriorityClass);
+
+ // Wait for DNSProxy
+ SpinWait.SpinUntil(() => ProcessManager.FindProcessByPID(localServerPID), timeoutMS + 500);
+
+ bool isOK = CheckDnsWork(domain, $"{IPAddress.Loopback}:{localPort}", timeoutMS, processPriorityClass);
+
+ ProcessManager.KillProcessByPID(localServerPID);
+
+ // Wait for DNSProxy to exit
+ SpinWait.SpinUntil(() => !ProcessManager.FindProcessByPID(localServerPID), timeoutMS + 1000);
+
+ return isOK;
+ });
+
+ if (task.Wait(TimeSpan.FromMilliseconds(timeoutMS)))
+ return task.Result;
+ else
+ return false;
+ }
+
+ //================================= Check DNS Async
+
///
/// Check DNS and get latency (ms)
///
@@ -95,13 +150,13 @@ public void CheckDNS(bool insecure, string domain, string dnsServer, int timeout
///
///
///
- /// Returns -1 if DNS fail
public async Task CheckDnsAsync(string domain, string dnsServer, int timeoutMS)
{
+ DNS = dnsServer;
IsDnsOnline = false;
Stopwatch stopwatch = new();
stopwatch.Start();
- IsDnsOnline = await CheckDnsWorkAsync(domain, dnsServer, timeoutMS, ProcessPriority);
+ IsDnsOnline = await CheckDnsWorkAsync(domain, DNS, timeoutMS, ProcessPriority);
stopwatch.Stop();
DnsLatency = IsDnsOnline ? Convert.ToInt32(stopwatch.ElapsedMilliseconds) : -1;
@@ -110,7 +165,7 @@ public async Task CheckDnsAsync(string domain, string dnsServer, int timeoutMS)
IsAdultFilter = false;
if (CheckForFilters && IsDnsOnline)
{
- CheckDnsFilters(dnsServer, timeoutMS + 500, out bool isSafeSearch, out bool isAdultFilter);
+ CheckDnsFilters(DNS, out bool isSafeSearch, out bool isAdultFilter);
IsSafeSearch = isSafeSearch;
IsAdultFilter = isAdultFilter;
}
@@ -123,50 +178,139 @@ public async Task CheckDnsAsync(string domain, string dnsServer, int timeoutMS)
///
///
///
- /// Returns -1 if DNS fail
public async Task CheckDnsAsync(bool insecure, string domain, string dnsServer, int timeoutMS, int localPort, string bootstrap, int bootsratPort)
{
+ DNS = dnsServer;
IsDnsOnline = false;
Stopwatch stopwatch = new();
stopwatch.Start();
- IsDnsOnline = await CheckDnsWorkAsync(insecure, domain, dnsServer, timeoutMS, localPort, bootstrap, bootsratPort, ProcessPriority);
+ IsDnsOnline = await CheckDnsWorkAsync(insecure, domain, DNS, timeoutMS, localPort, bootstrap, bootsratPort, ProcessPriority);
stopwatch.Stop();
-
+
DnsLatency = IsDnsOnline ? Convert.ToInt32(stopwatch.ElapsedMilliseconds) : -1;
IsSafeSearch = false;
IsAdultFilter = false;
if (CheckForFilters && IsDnsOnline)
{
- CheckDnsFilters(dnsServer, timeoutMS + 500, out bool isSafeSearch, out bool isAdultFilter);
+ CheckDnsFilters(DNS, out bool isSafeSearch, out bool isAdultFilter);
IsSafeSearch = isSafeSearch;
IsAdultFilter = isAdultFilter;
}
}
- public void GenerateGoogleSafeSearchIps(string dnsServer)
+ private static async Task CheckDnsWorkAsync(string domain, string dnsServer, int timeoutMS, ProcessPriorityClass processPriorityClass)
+ {
+ try
+ {
+ Task task = Task.Run(() =>
+ {
+ string args = domain + " " + dnsServer;
+ string? result = ProcessManager.Execute(out Process _, SecureDNS.DnsLookup, args, true, false, SecureDNS.CurrentPath, processPriorityClass);
+
+ if (!string.IsNullOrEmpty(result))
+ {
+ return result.Contains("ANSWER SECTION");
+ }
+ else
+ return false;
+ });
+
+ return await task.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS));
+ }
+ catch (TimeoutException)
+ {
+ return false;
+ }
+ }
+
+ private static async Task CheckDnsWorkAsync(bool insecure, string domain, string dnsServer, int timeoutMS, int localPort, string bootstrap, int bootsratPort, ProcessPriorityClass processPriorityClass)
+ {
+ // Start local server
+ string dnsProxyArgs = $"-l {IPAddress.Loopback} -p {localPort} ";
+ if (insecure) dnsProxyArgs += "--insecure ";
+ dnsProxyArgs += $"-u {dnsServer} -b {bootstrap}:{bootsratPort}";
+ int localServerPID = ProcessManager.ExecuteOnly(out Process _, SecureDNS.DnsProxy, dnsProxyArgs, true, false, SecureDNS.CurrentPath, processPriorityClass);
+
+ //Wait for DNSProxy
+ SpinWait.SpinUntil(() => ProcessManager.FindProcessByPID(localServerPID), timeoutMS + 500);
+
+ bool isOK = await CheckDnsWorkAsync(domain, $"{IPAddress.Loopback}:{localPort}", timeoutMS, processPriorityClass);
+
+ ProcessManager.KillProcessByPID(localServerPID);
+
+ // Wait for DNSProxy to exit
+ SpinWait.SpinUntil(() => !ProcessManager.FindProcessByPID(localServerPID), timeoutMS + 1000);
+
+ return isOK;
+ }
+
+ //================================= Check Dns as SmartDns
+
+ public bool CheckAsSmartDns(string uncensoredDns, string domain)
+ {
+ bool smart = false;
+ string realArg = $"{domain} {uncensoredDns}";
+ string realJson = GetDnsLookupJson(realArg).Result;
+ List realDomainIPs = GetDnsLookupAnswerRecordList(realJson);
+
+ string arg = $"{domain} {DNS}";
+ string json = GetDnsLookupJson(arg).Result;
+ List domainIPs = GetDnsLookupAnswerRecordList(json);
+
+ string jsonIpv6 = GetDnsLookupJson(arg, "AAAA").Result;
+ List domainIPv6s = GetDnsLookupAnswerRecordList(jsonIpv6, "AAAA");
+
+ bool isIpMatch = false, isChecked = false;
+ for (int a = 0; a < domainIPs.Count; a++)
+ {
+ string domainIP = domainIPs[a];
+
+ if (!NetworkTool.IsLocalIP(domainIP))
+ {
+ for (int b = 0; b < realDomainIPs.Count; b++)
+ {
+ string realDomainIP = realDomainIPs[b];
+ if (domainIP.Equals(realDomainIP)) isIpMatch = true;
+ if (b == realDomainIPs.Count - 1) isChecked = true;
+ }
+ }
+ }
+
+ bool realPseudo = HasExtraRecord(realJson);
+ bool pseudo = HasExtraRecord(json);
+
+ if (isChecked && !isIpMatch && !domainIPv6s.Any() && realPseudo != pseudo)
+ smart = true;
+
+ return smart;
+ }
+
+ //================================= Generate IPs
+
+ public void GenerateGoogleSafeSearchIps(string uncensoredDns)
{
if (!SafeSearchIpList.Any())
{
string websiteSS = "forcesafesearch.google.com";
- string argsSS = $"{websiteSS} {dnsServer}";
+ string argsSS = $"{websiteSS} {uncensoredDns}";
string jsonStrSS = GetDnsLookupJson(argsSS).Result;
- SafeSearchIpList = GetDnsLookupARecordList(jsonStrSS);
+ SafeSearchIpList = GetDnsLookupAnswerRecordList(jsonStrSS);
Debug.WriteLine("Safe Search IPs Generated, Count: " + SafeSearchIpList.Count);
}
}
- public void GenerateAdultDomainIps(string dnsServer)
+ public void GenerateAdultDomainIps(string uncensoredDns)
{
if (!AdultIpList.Any())
{
- string argsAD = $"{AdultDomainToCheck} {dnsServer}";
- string status = GetDnsLookupJson(argsAD, true, false).Result; // RRTYPE: TXT, Format: Text
+ string argsAD = $"{AdultDomainToCheck} {uncensoredDns}";
+ string status = GetDnsLookupJson(argsAD, "TXT", false).Result; // RRTYPE: TXT, Format: Text
if (status.Contains("status: NOERROR") && status.Contains("verification"))
{
string jsonStrAD = GetDnsLookupJson(argsAD).Result; // RRTYPE: A, Format: Json
- AdultIpList = GetDnsLookupARecordList(jsonStrAD);
- if (AdultIpList.Contains("0.0.0.0"))
+ AdultIpList = GetDnsLookupAnswerRecordList(jsonStrAD);
+ if (AdultIpList.IsContain("0.0.0.0"))
AdultIpList.Clear();
else
Debug.WriteLine("Adult IPs Generated, Count: " + AdultIpList.Count);
@@ -174,7 +318,9 @@ public void GenerateAdultDomainIps(string dnsServer)
}
}
- private void CheckDnsFilters(string dnsServer, int timeoutMS, out bool isSafeSearch, out bool isAdultFilter)
+ //================================= Check DNS Filters
+
+ private void CheckDnsFilters(string dnsServer, out bool isSafeSearch, out bool isAdultFilter)
{
bool isSafeSearchOut = false;
isSafeSearch = false;
@@ -188,7 +334,7 @@ private void CheckDnsFilters(string dnsServer, int timeoutMS, out bool isSafeSea
string websiteSS = "forcesafesearch.google.com";
string argsSS = $"{websiteSS} {dnsServer}";
string jsonStrSS = GetDnsLookupJson(argsSS).Result;
- SafeSearchIpList = GetDnsLookupARecordList(jsonStrSS);
+ SafeSearchIpList = GetDnsLookupAnswerRecordList(jsonStrSS);
}
// Check Google Force Safe Search
@@ -224,18 +370,62 @@ private void CheckDnsFilters(string dnsServer, int timeoutMS, out bool isSafeSea
}
else
{
- string status = GetDnsLookupJson(args, true, false).Result; // RRTYPE: TXT, Format: Text
+ string status = GetDnsLookupJson(args, "TXT", false).Result; // RRTYPE: TXT, Format: Text
if ((status.Contains("status:") && !status.Contains("status: NOERROR")) ||
(status.Contains("status: NOERROR") && !status.Contains("verification")))
isAdultFilterOut = true;
}
});
- task.Wait(timeoutMS);
+ try { task.Wait(); } catch (Exception) { }
+
isSafeSearch = isSafeSearchOut;
isAdultFilter = isAdultFilterOut;
}
+ private static async Task GetDnsLookupJson(string dnsLookupArgs, string rrtype = "A", bool json = true)
+ {
+ string result = string.Empty;
+ Task task = Task.Run(async () =>
+ {
+ using Process process = new();
+ process.StartInfo.FileName = SecureDNS.DnsLookup;
+ process.StartInfo.Arguments = dnsLookupArgs;
+ process.StartInfo.CreateNoWindow = true;
+ process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
+ process.StartInfo.UseShellExecute = false;
+ process.StartInfo.RedirectStandardInput = true;
+ process.StartInfo.RedirectStandardOutput = true;
+ process.StartInfo.RedirectStandardError = true;
+ process.StartInfo.WorkingDirectory = SecureDNS.CurrentPath;
+
+ // Set RRTYPE
+ process.StartInfo.EnvironmentVariables["RRTYPE"] = rrtype;
+
+ // Set JSON Output
+ if (json)
+ process.StartInfo.EnvironmentVariables["JSON"] = "1";
+ else
+ process.StartInfo.EnvironmentVariables["JSON"] = "";
+
+ process.Start();
+ process.PriorityClass = ProcessPriority;
+ // Faster than process.WaitForExit();
+ await Task.Run(() => result = process.StandardOutput.ReadToEnd().ReplaceLineEndings(Environment.NewLine));
+ });
+
+ try
+ {
+ await task.WaitAsync(TimeSpan.FromSeconds(15));
+ }
+ catch (Exception)
+ {
+ // timeout. do nothing
+ }
+
+ return result;
+ }
+
private static string GetDnsLookupARecord(string jsonStr)
{
string aRecStr = string.Empty;
@@ -251,17 +441,20 @@ private static string GetDnsLookupARecord(string jsonStr)
bool hasAnswer = json.TryGetProperty("Answer", out JsonElement answerE);
if (hasAnswer)
{
- JsonElement.ArrayEnumerator answerEArray = answerE.EnumerateArray();
- for (int n2 = 0; n2 < answerEArray.Count(); n2++)
+ if (answerE.ValueKind == JsonValueKind.Array)
{
- JsonElement answerEV = answerEArray.ToArray()[n2];
- bool hasARec = answerEV.TryGetProperty("A", out JsonElement aRec);
- if (hasARec)
+ JsonElement.ArrayEnumerator answerEArray = answerE.EnumerateArray();
+ for (int n2 = 0; n2 < answerEArray.Count(); n2++)
{
- string? aRecStrOut = aRec.GetString();
- if (!string.IsNullOrEmpty(aRecStrOut))
- aRecStr = aRecStrOut.Trim();
- break;
+ JsonElement answerEV = answerEArray.ToArray()[n2];
+ bool hasARec = answerEV.TryGetProperty("A", out JsonElement aRec);
+ if (hasARec)
+ {
+ string? aRecStrOut = aRec.GetString();
+ if (!string.IsNullOrEmpty(aRecStrOut))
+ aRecStr = aRecStrOut.Trim();
+ break;
+ }
}
}
}
@@ -274,7 +467,7 @@ private static string GetDnsLookupARecord(string jsonStr)
return aRecStr;
}
- private static List GetDnsLookupARecordList(string jsonStr)
+ private static List GetDnsLookupAnswerRecordList(string jsonStr, string rrtype = "A")
{
List aRecStr = new();
if (!string.IsNullOrEmpty(jsonStr))
@@ -289,16 +482,19 @@ private static List GetDnsLookupARecordList(string jsonStr)
bool hasAnswer = json.TryGetProperty("Answer", out JsonElement answerE);
if (hasAnswer)
{
- JsonElement.ArrayEnumerator answerEArray = answerE.EnumerateArray();
- for (int n2 = 0; n2 < answerEArray.Count(); n2++)
+ if (answerE.ValueKind == JsonValueKind.Array)
{
- JsonElement answerEV = answerEArray.ToArray()[n2];
- bool hasARec = answerEV.TryGetProperty("A", out JsonElement aRec);
- if (hasARec)
+ JsonElement.ArrayEnumerator answerEArray = answerE.EnumerateArray();
+ for (int n2 = 0; n2 < answerEArray.Count(); n2++)
{
- string? aRecStrOut = aRec.GetString();
- if (!string.IsNullOrEmpty(aRecStrOut))
- aRecStr.Add(aRecStrOut.Trim());
+ JsonElement answerEV = answerEArray.ToArray()[n2];
+ bool hasARec = answerEV.TryGetProperty(rrtype, out JsonElement aRec);
+ if (hasARec)
+ {
+ string? aRecStrOut = aRec.GetString();
+ if (!string.IsNullOrEmpty(aRecStrOut))
+ aRecStr.Add(aRecStrOut.Trim());
+ }
}
}
}
@@ -311,193 +507,34 @@ private static List GetDnsLookupARecordList(string jsonStr)
return aRecStr;
}
- private static async Task GetDnsLookupJson(string dnsLookupArgs, bool rrtypeTXT = false, bool json = true)
+ private static bool HasExtraRecord(string jsonStr)
{
- string result = string.Empty;
- Task task = Task.Run(async () =>
- {
- using Process process = new();
- process.StartInfo.FileName = SecureDNS.DnsLookup;
- process.StartInfo.Arguments = dnsLookupArgs;
- process.StartInfo.CreateNoWindow = true;
- process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.RedirectStandardInput = true;
- process.StartInfo.RedirectStandardOutput = true;
- process.StartInfo.RedirectStandardError = true;
- process.StartInfo.WorkingDirectory = SecureDNS.CurrentPath;
-
- // Set RRTYPE
- if (rrtypeTXT)
- process.StartInfo.EnvironmentVariables["RRTYPE"] = "TXT";
- else
- process.StartInfo.EnvironmentVariables["RRTYPE"] = "A";
-
- // Set JSON Output
- if (json)
- process.StartInfo.EnvironmentVariables["JSON"] = "1";
- else
- process.StartInfo.EnvironmentVariables["JSON"] = "";
-
- process.Start();
- process.PriorityClass = ProcessPriority;
- // Faster than process.WaitForExit();
- await Task.Run(() => result = process.StandardOutput.ReadToEnd().ReplaceLineEndings(Environment.NewLine));
- });
-
- try
- {
- await task.WaitAsync(TimeSpan.FromSeconds(15));
- }
- catch (Exception)
- {
- // timeout. do nothing
- }
-
- return result;
- }
-
- private static bool CheckDnsWork(string domain, string dnsServer, int timeoutMS, ProcessPriorityClass processPriorityClass)
- {
- var task = Task.Run(() =>
- {
- string args = domain + " " + dnsServer;
- string? result = ProcessManager.Execute(out Process _, SecureDNS.DnsLookup, args, true, false, SecureDNS.CurrentPath, processPriorityClass);
-
- if (!string.IsNullOrEmpty(result))
- {
- return result.Contains("ANSWER SECTION");
- }
- else
- return false;
- });
-
- if (task.Wait(TimeSpan.FromMilliseconds(timeoutMS)))
- return task.Result;
- else
- return false;
- }
-
- private static bool CheckDnsWork(bool insecure, string domain, string dnsServer, int timeoutMS, int localPort, string bootstrap, int bootsratPort, ProcessPriorityClass processPriorityClass)
- {
- Task task = Task.Run(async () =>
+ if (!string.IsNullOrEmpty(jsonStr))
{
- // Start local server
- string dnsProxyArgs = $"-l {IPAddress.Loopback} -p {localPort} ";
- if (insecure) dnsProxyArgs += "--insecure ";
- dnsProxyArgs += $"-u {dnsServer} -b {bootstrap}:{bootsratPort}";
- int localServerPID = ProcessManager.ExecuteOnly(out Process _, SecureDNS.DnsProxy, dnsProxyArgs, true, false, SecureDNS.CurrentPath, processPriorityClass);
-
- // Wait for DNSProxy
- Task wait1 = Task.Run(() =>
- {
- while (!ProcessManager.FindProcessByPID(localServerPID))
- {
- if (ProcessManager.FindProcessByPID(localServerPID))
- break;
- }
- return Task.CompletedTask;
- });
- await wait1.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS));
-
- string args = $"{domain} {IPAddress.Loopback}:{localPort}";
- string? result = ProcessManager.Execute(out Process _, SecureDNS.DnsLookup, args, true, false, SecureDNS.CurrentPath, processPriorityClass);
-
- if (!string.IsNullOrEmpty(result))
+ try
{
- ProcessManager.KillProcessByPID(localServerPID);
+ JsonDocumentOptions jsonDocumentOptions = new();
+ jsonDocumentOptions.AllowTrailingCommas = true;
+ JsonDocument jsonDocument = JsonDocument.Parse(jsonStr, jsonDocumentOptions);
+ JsonElement json = jsonDocument.RootElement;
- // Wait for DNSProxy to exit
- Task wait2 = Task.Run(() =>
+ bool hasExtra = json.TryGetProperty("Extra", out JsonElement extraE);
+ if (hasExtra)
{
- while (ProcessManager.FindProcessByPID(localServerPID))
+ if (extraE.ValueKind == JsonValueKind.Array)
{
- if (!ProcessManager.FindProcessByPID(localServerPID))
- break;
+ JsonElement.ArrayEnumerator extraEArray = extraE.EnumerateArray();
+ return extraEArray.Any();
}
- return Task.CompletedTask;
- });
- await wait2.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS));
-
- return result.Contains("ANSWER SECTION");
- }
- else
- return false;
- });
-
- if (task.Wait(TimeSpan.FromMilliseconds(timeoutMS)))
- return task.Result;
- else
- return false;
- }
-
- private static async Task CheckDnsWorkAsync(string domain, string dnsServer, int timeoutMS, ProcessPriorityClass processPriorityClass)
- {
- try
- {
- var task = Task.Run(() =>
- {
- string args = domain + " " + dnsServer;
- string? result = ProcessManager.Execute(out Process _, SecureDNS.DnsLookup, args, true, false, SecureDNS.CurrentPath, processPriorityClass);
-
- if (!string.IsNullOrEmpty(result))
- {
- return result.Contains("ANSWER SECTION");
}
- else
- return false;
- });
-
- if (await task.WaitAsync(TimeSpan.FromMilliseconds(timeoutMS)))
- return task.Result;
- else
- return false;
- }
- catch (TimeoutException)
- {
- return false;
- }
- }
-
- private static async Task CheckDnsWorkAsync(bool insecure, string domain, string dnsServer, int timeoutMS, int localPort, string bootstrap, int bootsratPort, ProcessPriorityClass processPriorityClass)
- {
- // Start local server
- string dnsProxyArgs = $"-l {IPAddress.Loopback} -p {localPort} ";
- if (insecure) dnsProxyArgs += "--insecure ";
- dnsProxyArgs += $"-u {dnsServer} -b {bootstrap}:{bootsratPort}";
- int localServerPID = ProcessManager.ExecuteOnly(out Process _, SecureDNS.DnsProxy, dnsProxyArgs, true, false, SecureDNS.CurrentPath, processPriorityClass);
-
- // Wait for DNSProxy
- await Task.Run(() =>
- {
- while (!ProcessManager.FindProcessByPID(localServerPID))
- {
- if (ProcessManager.FindProcessByPID(localServerPID))
- break;
}
- });
-
- string args = $"{domain} {IPAddress.Loopback}:{localPort}";
- string? result = ProcessManager.Execute(out Process _, SecureDNS.DnsLookup, args, true, false, SecureDNS.CurrentPath, processPriorityClass);
-
- if (!string.IsNullOrEmpty(result))
- {
- ProcessManager.KillProcessByPID(localServerPID);
-
- // Wait for DNSProxy to exit
- await Task.Run(() =>
+ catch (Exception ex)
{
- while (ProcessManager.FindProcessByPID(localServerPID))
- {
- if (!ProcessManager.FindProcessByPID(localServerPID))
- break;
- }
- });
-
- return result.Contains("ANSWER SECTION");
+ Debug.WriteLine("GetDnsLookupARecord: " + ex.Message);
+ }
}
- else
- return false;
+ return false;
}
+
}
}
diff --git a/SecureDNSClient/SecureDNS/IpScanner.cs b/SecureDNSClient/SecureDNS/IpScanner.cs
index 4089391..f3a4544 100644
--- a/SecureDNSClient/SecureDNS/IpScanner.cs
+++ b/SecureDNSClient/SecureDNS/IpScanner.cs
@@ -1,13 +1,8 @@
-using MsmhTools;
-using MsmhTools.HTTPProxyServer;
+using MsmhToolsClass;
+using MsmhToolsClass.HTTPProxyServer;
using System;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.IO.Compression;
-using System.Linq;
using System.Net;
-using System.Text;
-using System.Threading.Tasks;
namespace SecureDNSClient
{
@@ -202,7 +197,7 @@ public void Start()
string[] split = CheckWebsite.Split("://");
urlScheme = $"{split[0].Trim().ToLower()}://";
}
- Network.GetUrlDetails(CheckWebsite, CheckPort, out string host, out int _, out string _, out bool _);
+ NetworkTool.GetUrlDetails(CheckWebsite, CheckPort, out _, out string host, out int _, out string _, out bool _);
string url = $"{urlScheme}{host}:{CheckPort}";
Uri uri = new(url, UriKind.Absolute);
@@ -249,7 +244,7 @@ public void Start()
{
Stopwatch pingDelay = new();
pingDelay.Start();
- Network.CanPing(ipOut, Timeout);
+ NetworkTool.CanPing(ipOut, Timeout);
pingDelay.Stop();
pingDelayOut = Convert.ToInt32(pingDelay.ElapsedMilliseconds);
@@ -266,7 +261,7 @@ public void Start()
{
Stopwatch tcpDelay = new();
tcpDelay.Start();
- Network.CanTcpConnect(ipOut, CheckPort, Timeout);
+ NetworkTool.CanTcpConnect(ipOut, CheckPort, Timeout);
tcpDelay.Stop();
tcpDelayOut = Convert.ToInt32(tcpDelay.ElapsedMilliseconds);
diff --git a/SecureDNSClient/SecureDNS/SecureDNS.cs b/SecureDNSClient/SecureDNS/SecureDNS.cs
index 46b570e..ca3ee36 100644
--- a/SecureDNSClient/SecureDNS/SecureDNS.cs
+++ b/SecureDNSClient/SecureDNS/SecureDNS.cs
@@ -4,14 +4,15 @@
using CustomControls;
using System.Net.NetworkInformation;
using System.Reflection;
-using System.Text.Json;
-using MsmhTools;
-using MsmhTools.DnsTool;
+using MsmhToolsClass;
+using MsmhToolsClass.DnsTool;
namespace SecureDNSClient
{
public class SecureDNS
{
+ // App Name Without Extension
+ private static readonly string appNameWithoutExtension = Path.GetFileNameWithoutExtension(Application.ExecutablePath);
// App Directory Path
public static readonly string CurrentPath = Path.GetFullPath(AppContext.BaseDirectory);
@@ -51,21 +52,25 @@ public class SecureDNS
// User Data
private const string UDN = "user";
public static readonly string UserDataDirPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN));
- public static readonly string SettingsXmlPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, Info.ApplicationNameWithoutExtension + ".xml")); // Settings XML path
+ public static readonly string SettingsXmlPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, appNameWithoutExtension + ".xml")); // Settings XML path
public static readonly string SettingsXmlDnsLookup = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "DnsLookupSettings.xml"));
public static readonly string SettingsXmlIpScanner = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "IpScannerSettings.xml"));
+ public static readonly string SettingsXmlDnsScanner = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "DnsScannerSettings.xml"));
+ public static readonly string SettingsXmlDnsScannerExport = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "DnsScannerExportSettings.xml"));
public static readonly string UserIdPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "uid.txt"));
public static readonly string FakeDnsRulesPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "FakeDnsRules.txt"));
public static readonly string BlackWhiteListPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "BlackWhiteList.txt"));
public static readonly string DontBypassListPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "DontBypassList.txt"));
public static readonly string CustomServersPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "CustomServers.txt"));
+ public static readonly string CustomServersXmlPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "CustomServers.xml"));
public static readonly string WorkingServersPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "CustomServers_Working.txt"));
public static readonly string DPIBlacklistPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "DPIBlacklist.txt"));
public static readonly string NicNamePath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "NicName.txt"));
public static readonly string SavedEncodedDnsPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "SavedEncodedDns.txt"));
+ public static readonly string LogWindowPath = Path.GetFullPath(Path.Combine(CurrentPath, UDN, "LogWindow.txt"));
// User Data Old Path
- public static readonly string OldSettingsXmlPath = Path.GetFullPath(Info.ApplicationFullPathWithoutExtension + ".xml");
+ public static readonly string OldSettingsXmlPath = Path.GetFullPath(appNameWithoutExtension + ".xml");
public static readonly string OldSettingsXmlDnsLookup = Path.GetFullPath(CurrentPath + "DnsLookupSettings.xml");
public static readonly string OldSettingsXmlIpScanner = Path.GetFullPath(CurrentPath + "IpScannerSettings.xml");
public static readonly string OldUserIdPath = Path.GetFullPath(Path.Combine(CurrentPath, "uid.txt"));
@@ -103,11 +108,11 @@ public static void GenerateUid(Control control)
uid = uid.Trim();
if (string.IsNullOrEmpty(uid)) return;
- string counterUrl = "https://msasanmh.html-5.me/counter.php";
+ string counterUrl = "https://msmh.html-5.me/counter.php";
string productVersion = Info.GetAppInfo(Assembly.GetExecutingAssembly()).ProductVersion ?? "0.0.0";
string args = $"{counterUrl}?uid={uid}&sdcver={productVersion}";
- if (!Network.IsInternetAlive()) return;
+ if (!NetworkTool.IsInternetAlive()) return;
control.InvokeIt(() =>
{
@@ -208,7 +213,7 @@ public static async Task HostToCompanyOffline(string host)
string company = "Couldn't retrieve information.";
if (!string.IsNullOrWhiteSpace(host))
{
- string? fileContent = await Resource.GetResourceTextFileAsync("SecureDNSClient.HostToCompany.txt", Assembly.GetExecutingAssembly()); // Load from Embedded Resource
+ string? fileContent = await ResourceTool.GetResourceTextFileAsync("SecureDNSClient.HostToCompany.txt", Assembly.GetExecutingAssembly()); // Load from Embedded Resource
if (!string.IsNullOrWhiteSpace(fileContent))
{
List split = fileContent.SplitToLines();
@@ -232,7 +237,7 @@ public static async Task HostToCompanyOffline(string host)
public static async Task UrlToCompanyOffline(string url)
{
- Network.GetUrlDetails(url, 53, out string host, out int _, out string _, out bool _);
+ NetworkTool.GetUrlDetails(url, 53, out _, out string host, out int _, out string _, out bool _);
return await HostToCompanyOffline(host);
}
@@ -268,17 +273,17 @@ public static async Task StampToCompanyOffline(string stampUrl)
public static async Task UrlToCompanyAsync(string url, string? proxyScheme = null)
{
string company = "Couldn't retrieve information.";
- Network.GetUrlDetails(url, 443, out string host, out int _, out string _, out bool _);
+ NetworkTool.GetUrlDetails(url, 443, out _, out string host, out int _, out string _, out bool _);
if (!string.IsNullOrWhiteSpace(host))
{
- IPAddress? ipAddress = Network.HostToIP(host);
+ string ipStr = GetIP.GetIpFromSystem(host);
string? companyFull;
- if (ipAddress != null)
+ if (!string.IsNullOrEmpty(ipStr))
{
if (proxyScheme == null)
- companyFull = await Network.IpToCompanyAsync(ipAddress);
+ companyFull = await NetworkTool.IpToCompanyAsync(ipStr);
else
- companyFull = await Network.IpToCompanyAsync(ipAddress, proxyScheme);
+ companyFull = await NetworkTool.IpToCompanyAsync(ipStr, proxyScheme);
if (!string.IsNullOrWhiteSpace(companyFull))
{
company = string.Empty;
@@ -300,7 +305,7 @@ public static async Task UrlToCompanyAsync(string url, string? proxySche
public static void UpdateNICs(CustomComboBox customComboBox)
{
customComboBox.Items.Clear();
- List nics = Network.GetNetworkInterfacesIPv4();
+ List nics = NetworkTool.GetNetworkInterfacesIPv4();
if (nics == null || nics.Count < 1)
{
Debug.WriteLine("There is no Network Interface.");
@@ -349,7 +354,7 @@ public static async Task HostToCompanyAsync(string hostsFilePath)
string company = await UrlToCompanyAsync(dns);
if (!company.Contains("Couldn't retrieve information."))
{
- Network.GetUrlDetails(dns, 443, out string host, out int _, out string _, out bool _);
+ NetworkTool.GetUrlDetails(dns, 443, out _, out string host, out int _, out string _, out bool _);
object hostToCom = host + "|" + company;
HostToCompanyList.Add(hostToCom);
Debug.WriteLine(hostToCom);
diff --git a/SecureDNSClient/SecureDNS/SettingsWindow.cs b/SecureDNSClient/SecureDNS/SettingsWindow.cs
index 6b11026..a65959b 100644
--- a/SecureDNSClient/SecureDNS/SettingsWindow.cs
+++ b/SecureDNSClient/SecureDNS/SettingsWindow.cs
@@ -3,7 +3,7 @@
using System.Linq;
using System.Net;
using System.Text;
-using MsmhTools;
+using MsmhToolsClass;
namespace SecureDNSClient
{
@@ -15,7 +15,7 @@ public IPAddress GetBootstrapSetting(out int bootstrapPort)
// Get Bootstrap IP and Port
IPAddress bootstrap = SecureDNS.BootstrapDnsIPv4;
int bootstrapPortD = SecureDNS.BootstrapDnsPort;
- bool isBootstrap = Network.IsIPv4Valid(CustomTextBoxSettingBootstrapDnsIP.Text, out IPAddress? bootstrapIP);
+ bool isBootstrap = NetworkTool.IsIPv4Valid(CustomTextBoxSettingBootstrapDnsIP.Text, out IPAddress? bootstrapIP);
if (isBootstrap && bootstrapIP != null)
{
bootstrap = bootstrapIP;
@@ -71,7 +71,7 @@ public int GetCamouflageDnsPortSetting()
/// Returns True if everything's ok
public bool GetListeningPort(int portToCheck, string message, Color color)
{
- bool isPortOpen = Network.IsPortOpen(IPAddress.Loopback.ToString(), portToCheck, 3);
+ bool isPortOpen = NetworkTool.IsPortOpen(IPAddress.Loopback.ToString(), portToCheck, 3);
if (isPortOpen)
{
string existingProcessName = ProcessManager.GetProcessNameByListeningPort(portToCheck);
diff --git a/SecureDNSClient/SecureDNSClient.csproj b/SecureDNSClient/SecureDNSClient.csproj
index d5cc790..a79a59e 100644
--- a/SecureDNSClient/SecureDNSClient.csproj
+++ b/SecureDNSClient/SecureDNSClient.csproj
@@ -9,16 +9,17 @@
app.manifest
MSasanMH
SDC - Secure DNS Client
- $(VersionPrefix)2.3.7
+ $(VersionPrefix)2.6.0
SecureDNSClient.png
SecureDNSClientMulti.ico
- False
+ True
+
@@ -38,6 +39,7 @@
+
@@ -66,7 +68,8 @@
-
+
+
@@ -91,6 +94,11 @@
True
Resources.resx
+
+ True
+ True
+ Settings.settings
+
@@ -108,4 +116,11 @@
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
\ No newline at end of file
diff --git a/SecureDNSClient/SecureDNSClient.csproj.user b/SecureDNSClient/SecureDNSClient.csproj.user
index 96c636d..0e20260 100644
--- a/SecureDNSClient/SecureDNSClient.csproj.user
+++ b/SecureDNSClient/SecureDNSClient.csproj.user
@@ -22,15 +22,33 @@
Form
+
+ Form
+
+
+ Form
+
+
+ Form
+
Form
+
+ Form
+
+
+ Form
+
Form
Form
+
+ Form
+
Form
@@ -43,6 +61,9 @@
Form
+
+ Form
+
Form
@@ -52,7 +73,7 @@
Form
-
+
Form
diff --git a/SecureDNSClient/app.manifest b/SecureDNSClient/app.manifest
index 438ee0d..674df45 100644
--- a/SecureDNSClient/app.manifest
+++ b/SecureDNSClient/app.manifest
@@ -54,8 +54,9 @@
diff --git a/SecureDNSClientPortable/Properties/PublishProfiles/FolderProfile.pubxml.user b/SecureDNSClientPortable/Properties/PublishProfiles/FolderProfile.pubxml.user
index e599f0a..887c026 100644
--- a/SecureDNSClientPortable/Properties/PublishProfiles/FolderProfile.pubxml.user
+++ b/SecureDNSClientPortable/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -4,6 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
- True|2023-08-07T07:34:58.2158763Z;True|2023-08-01T18:47:06.6654646+04:30;True|2023-07-29T22:56:36.3830251+04:30;True|2023-07-17T21:17:33.7464374+04:30;True|2023-07-03T17:04:13.0193508+04:30;True|2023-06-28T20:15:06.4877499+04:30;True|2023-06-17T16:30:29.1914633+04:30;True|2023-06-17T14:51:54.4241557+04:30;True|2023-06-04T19:48:08.0977577+04:30;True|2023-06-04T17:29:38.8482141+04:30;True|2023-06-02T21:17:38.0623106+04:30;True|2023-06-02T20:50:27.6325136+04:30;True|2023-06-02T20:25:16.8004627+04:30;True|2023-06-02T20:21:33.2641926+04:30;True|2023-06-02T17:14:48.5208600+04:30;True|2023-05-30T17:57:19.0001069+04:30;True|2023-05-29T20:17:44.2223328+04:30;True|2023-05-29T19:43:15.8911213+04:30;True|2023-05-27T17:25:27.9631407+04:30;True|2023-05-27T14:50:40.9938592+04:30;True|2023-05-26T00:22:04.4226759+04:30;True|2023-05-19T21:55:03.6988953+04:30;True|2023-05-04T21:13:44.0531282+04:30;True|2023-05-03T18:20:58.6158351+04:30;True|2023-04-07T19:22:18.1443242+04:30;True|2023-04-07T19:01:23.1687551+04:30;True|2023-04-07T18:56:25.8534493+04:30;True|2023-02-23T19:42:03.7111255+03:30;True|2023-02-21T22:26:35.4429594+03:30;True|2023-02-20T17:47:25.0792312+03:30;True|2023-02-16T01:42:37.6467629+03:30;True|2023-02-15T22:16:38.0474815+03:30;True|2023-02-15T21:50:25.4952184+03:30;True|2023-02-15T21:49:01.8562159+03:30;
+ True|2023-09-06T13:48:07.5831910Z;True|2023-08-27T22:21:59.9308143+04:30;True|2023-08-07T12:04:58.2158763+04:30;True|2023-08-01T18:47:06.6654646+04:30;True|2023-07-29T22:56:36.3830251+04:30;True|2023-07-17T21:17:33.7464374+04:30;True|2023-07-03T17:04:13.0193508+04:30;True|2023-06-28T20:15:06.4877499+04:30;True|2023-06-17T16:30:29.1914633+04:30;True|2023-06-17T14:51:54.4241557+04:30;True|2023-06-04T19:48:08.0977577+04:30;True|2023-06-04T17:29:38.8482141+04:30;True|2023-06-02T21:17:38.0623106+04:30;True|2023-06-02T20:50:27.6325136+04:30;True|2023-06-02T20:25:16.8004627+04:30;True|2023-06-02T20:21:33.2641926+04:30;True|2023-06-02T17:14:48.5208600+04:30;True|2023-05-30T17:57:19.0001069+04:30;True|2023-05-29T20:17:44.2223328+04:30;True|2023-05-29T19:43:15.8911213+04:30;True|2023-05-27T17:25:27.9631407+04:30;True|2023-05-27T14:50:40.9938592+04:30;True|2023-05-26T00:22:04.4226759+04:30;True|2023-05-19T21:55:03.6988953+04:30;True|2023-05-04T21:13:44.0531282+04:30;True|2023-05-03T18:20:58.6158351+04:30;True|2023-04-07T19:22:18.1443242+04:30;True|2023-04-07T19:01:23.1687551+04:30;True|2023-04-07T18:56:25.8534493+04:30;True|2023-02-23T19:42:03.7111255+03:30;True|2023-02-21T22:26:35.4429594+03:30;True|2023-02-20T17:47:25.0792312+03:30;True|2023-02-16T01:42:37.6467629+03:30;True|2023-02-15T22:16:38.0474815+03:30;True|2023-02-15T21:50:25.4952184+03:30;True|2023-02-15T21:49:01.8562159+03:30;
+
\ No newline at end of file
diff --git a/SecureDNSClientPortable/SecureDNSClientPortable.csproj b/SecureDNSClientPortable/SecureDNSClientPortable.csproj
index 3d97de7..72dacfb 100644
--- a/SecureDNSClientPortable/SecureDNSClientPortable.csproj
+++ b/SecureDNSClientPortable/SecureDNSClientPortable.csproj
@@ -7,7 +7,7 @@
true
enable
SecureDNSClientMulti.ico
- $(VersionPrefix)2.3.7
+ $(VersionPrefix)2.6.0
MSasanMH
app.manifest