From aa46c723b88106d6e83fb90e8fc74e0331011bb8 Mon Sep 17 00:00:00 2001 From: Jaex Date: Tue, 9 Oct 2018 14:30:22 +0300 Subject: [PATCH] Removed unnecessary this. usages --- ShareX.HelpersLib/Colors/ColorPicker.cs | 42 +++++++-------- ShareX.HelpersLib/Forms/ImageViewer.cs | 46 ++++++++--------- ShareX.HelpersLib/Forms/InputBox.cs | 62 +++++++++++------------ ShareX.UploadersLib/Forms/OCRSpaceForm.cs | 2 +- ShareX/CaptureHelpers/CaptureBase.cs | 2 +- ShareX/Forms/DropForm.cs | 10 ++-- ShareX/Forms/NotificationForm.cs | 38 +++++++------- 7 files changed, 101 insertions(+), 101 deletions(-) diff --git a/ShareX.HelpersLib/Colors/ColorPicker.cs b/ShareX.HelpersLib/Colors/ColorPicker.cs index c143d76af..71025f7ed 100644 --- a/ShareX.HelpersLib/Colors/ColorPicker.cs +++ b/ShareX.HelpersLib/Colors/ColorPicker.cs @@ -135,36 +135,36 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { - this.colorBox = new HelpersLib.ColorBox(); - this.colorSlider = new HelpersLib.ColorSlider(); - this.SuspendLayout(); + colorBox = new HelpersLib.ColorBox(); + colorSlider = new HelpersLib.ColorSlider(); + SuspendLayout(); // // colorBox // - this.colorBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.colorBox.DrawStyle = HelpersLib.DrawStyle.Hue; - this.colorBox.Location = new System.Drawing.Point(0, 0); - this.colorBox.Name = "colorBox"; - this.colorBox.Size = new System.Drawing.Size(258, 258); - this.colorBox.TabIndex = 0; + colorBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + colorBox.DrawStyle = HelpersLib.DrawStyle.Hue; + colorBox.Location = new System.Drawing.Point(0, 0); + colorBox.Name = "colorBox"; + colorBox.Size = new System.Drawing.Size(258, 258); + colorBox.TabIndex = 0; // // colorSlider // - this.colorSlider.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.colorSlider.DrawStyle = HelpersLib.DrawStyle.Hue; - this.colorSlider.Location = new System.Drawing.Point(257, 0); - this.colorSlider.Name = "colorSlider"; - this.colorSlider.Size = new System.Drawing.Size(32, 258); - this.colorSlider.TabIndex = 1; + colorSlider.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + colorSlider.DrawStyle = HelpersLib.DrawStyle.Hue; + colorSlider.Location = new System.Drawing.Point(257, 0); + colorSlider.Name = "colorSlider"; + colorSlider.Size = new System.Drawing.Size(32, 258); + colorSlider.TabIndex = 1; // // ColorPicker // - this.AutoSize = true; - this.Controls.Add(this.colorBox); - this.Controls.Add(this.colorSlider); - this.Name = "ColorPicker"; - this.Size = new System.Drawing.Size(292, 261); - this.ResumeLayout(false); + AutoSize = true; + Controls.Add(colorBox); + Controls.Add(colorSlider); + Name = "ColorPicker"; + Size = new System.Drawing.Size(292, 261); + ResumeLayout(false); } #endregion Component Designer generated code diff --git a/ShareX.HelpersLib/Forms/ImageViewer.cs b/ShareX.HelpersLib/Forms/ImageViewer.cs index f6f9d0623..97079844d 100644 --- a/ShareX.HelpersLib/Forms/ImageViewer.cs +++ b/ShareX.HelpersLib/Forms/ImageViewer.cs @@ -120,35 +120,35 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.pbPreview = new MyPictureBox(); - this.SuspendLayout(); + pbPreview = new MyPictureBox(); + SuspendLayout(); - this.BackColor = SystemColors.Window; - this.Bounds = CaptureHelpers.GetActiveScreenBounds(); - this.DoubleBuffered = true; - this.FormBorderStyle = FormBorderStyle.None; - this.Text = "ShareX - Image viewer"; - this.TopMost = true; - this.WindowState = FormWindowState.Normal; - this.StartPosition = FormStartPosition.Manual; + BackColor = SystemColors.Window; + Bounds = CaptureHelpers.GetActiveScreenBounds(); + DoubleBuffered = true; + FormBorderStyle = FormBorderStyle.None; + Text = "ShareX - Image viewer"; + TopMost = true; + WindowState = FormWindowState.Normal; + StartPosition = FormStartPosition.Manual; - this.pbPreview.Cursor = Cursors.Hand; - this.pbPreview.Dock = System.Windows.Forms.DockStyle.Fill; - this.pbPreview.DrawCheckeredBackground = true; - this.pbPreview.FullscreenOnClick = false; - this.pbPreview.Location = new System.Drawing.Point(0, 0); - this.pbPreview.Name = "pbPreview"; - this.pbPreview.Size = new System.Drawing.Size(96, 100); - this.pbPreview.TabIndex = 0; - this.pbPreview.LoadImage(screenshot); - this.Controls.Add(this.pbPreview); + pbPreview.Cursor = Cursors.Hand; + pbPreview.Dock = System.Windows.Forms.DockStyle.Fill; + pbPreview.DrawCheckeredBackground = true; + pbPreview.FullscreenOnClick = false; + pbPreview.Location = new System.Drawing.Point(0, 0); + pbPreview.Name = "pbPreview"; + pbPreview.Size = new System.Drawing.Size(96, 100); + pbPreview.TabIndex = 0; + pbPreview.LoadImage(screenshot); + Controls.Add(pbPreview); - this.Shown += new System.EventHandler(this.ShowScreenshot_Shown); - this.Deactivate += new System.EventHandler(this.ShowScreenshot_Deactivate); + Shown += new System.EventHandler(ShowScreenshot_Shown); + Deactivate += new System.EventHandler(ShowScreenshot_Deactivate); pbPreview.MouseDown += pbPreview_MouseDown; pbPreview.KeyDown += pbPreview_KeyDown; - this.ResumeLayout(false); + ResumeLayout(false); } private MyPictureBox pbPreview; diff --git a/ShareX.HelpersLib/Forms/InputBox.cs b/ShareX.HelpersLib/Forms/InputBox.cs index 8bf4a185e..d2ea957ae 100644 --- a/ShareX.HelpersLib/Forms/InputBox.cs +++ b/ShareX.HelpersLib/Forms/InputBox.cs @@ -49,8 +49,8 @@ public InputBox(string title = null, string inputText = null, string okText = nu private void InputBox_Shown(object sender, EventArgs e) { this.ForceActivate(); - this.MinimumSize = new Size(384, this.Size.Height); - this.MaximumSize = new Size(1000, this.Size.Height); + MinimumSize = new Size(384, Size.Height); + MaximumSize = new Size(1000, Size.Height); txtInputText.SelectionLength = txtInputText.Text.Length; } @@ -98,48 +98,48 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InputBox)); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.txtInputText = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); + btnOK = new System.Windows.Forms.Button(); + btnCancel = new System.Windows.Forms.Button(); + txtInputText = new System.Windows.Forms.TextBox(); + SuspendLayout(); // // btnOK // - resources.ApplyResources(this.btnOK, "btnOK"); - this.btnOK.Name = "btnOK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + resources.ApplyResources(btnOK, "btnOK"); + btnOK.Name = "btnOK"; + btnOK.UseVisualStyleBackColor = true; + btnOK.Click += new System.EventHandler(btnOK_Click); // // btnCancel // - resources.ApplyResources(this.btnCancel, "btnCancel"); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + resources.ApplyResources(btnCancel, "btnCancel"); + btnCancel.Name = "btnCancel"; + btnCancel.UseVisualStyleBackColor = true; + btnCancel.Click += new System.EventHandler(btnCancel_Click); // // txtInputText // - resources.ApplyResources(this.txtInputText, "txtInputText"); - this.txtInputText.Name = "txtInputText"; + resources.ApplyResources(txtInputText, "txtInputText"); + txtInputText.Name = "txtInputText"; // // InputBox // - this.AcceptButton = this.btnOK; + AcceptButton = btnOK; resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.Window; - this.Controls.Add(this.txtInputText); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "InputBox"; - this.ShowInTaskbar = false; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.TopMost = true; - this.Shown += new System.EventHandler(this.InputBox_Shown); - this.ResumeLayout(false); - this.PerformLayout(); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + BackColor = System.Drawing.SystemColors.Window; + Controls.Add(txtInputText); + Controls.Add(btnCancel); + Controls.Add(btnOK); + MaximizeBox = false; + MinimizeBox = false; + Name = "InputBox"; + ShowInTaskbar = false; + SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + TopMost = true; + Shown += new System.EventHandler(InputBox_Shown); + ResumeLayout(false); + PerformLayout(); } private System.Windows.Forms.Button btnOK; diff --git a/ShareX.UploadersLib/Forms/OCRSpaceForm.cs b/ShareX.UploadersLib/Forms/OCRSpaceForm.cs index 9004be3db..beb3d91da 100644 --- a/ShareX.UploadersLib/Forms/OCRSpaceForm.cs +++ b/ShareX.UploadersLib/Forms/OCRSpaceForm.cs @@ -130,7 +130,7 @@ private void llAttribution_LinkClicked(object sender, LinkLabelLinkClickedEventA private void llGoogleTranslate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { URLHelpers.OpenURL("https://translate.google.com/#auto/en/" + Uri.EscapeDataString(txtResult.Text)); - this.Close(); + Close(); } } } \ No newline at end of file diff --git a/ShareX/CaptureHelpers/CaptureBase.cs b/ShareX/CaptureHelpers/CaptureBase.cs index 3a5472a50..f26fa9b11 100644 --- a/ShareX/CaptureHelpers/CaptureBase.cs +++ b/ShareX/CaptureHelpers/CaptureBase.cs @@ -107,7 +107,7 @@ private void AfterCapture(ImageInfo imageInfo, TaskSettings taskSettings) } if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture && - this.GetType() != typeof(CaptureRegion) && this.GetType() != typeof(CaptureLastRegion)) + GetType() != typeof(CaptureRegion) && GetType() != typeof(CaptureLastRegion)) { taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects); } diff --git a/ShareX/Forms/DropForm.cs b/ShareX/Forms/DropForm.cs index 228068a5d..e7a2ac447 100644 --- a/ShareX/Forms/DropForm.cs +++ b/ShareX/Forms/DropForm.cs @@ -190,11 +190,11 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Cursor = Cursors.SizeAll; - this.Text = "DropForm"; - this.AllowDrop = true; + components = new System.ComponentModel.Container(); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + Cursor = Cursors.SizeAll; + Text = "DropForm"; + AllowDrop = true; MouseDown += DropForm_MouseDown; MouseUp += DropForm_MouseUp; diff --git a/ShareX/Forms/NotificationForm.cs b/ShareX/Forms/NotificationForm.cs index ceca92458..2a60f031a 100644 --- a/ShareX/Forms/NotificationForm.cs +++ b/ShareX/Forms/NotificationForm.cs @@ -287,34 +287,34 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.tDuration = new System.Windows.Forms.Timer(this.components); - this.tOpacity = new System.Windows.Forms.Timer(this.components); - this.SuspendLayout(); + components = new System.ComponentModel.Container(); + tDuration = new System.Windows.Forms.Timer(components); + tOpacity = new System.Windows.Forms.Timer(components); + SuspendLayout(); // // tDuration // - this.tDuration.Tick += new System.EventHandler(this.tDuration_Tick); + tDuration.Tick += new System.EventHandler(tDuration_Tick); // // tOpacity // - this.tOpacity.Tick += new System.EventHandler(this.tOpacity_Tick); + tOpacity.Tick += new System.EventHandler(tOpacity_Tick); // // NotificationForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(400, 300); - this.Cursor = System.Windows.Forms.Cursors.Hand; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Name = "NotificationForm"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; - this.Text = "NotificationForm"; - this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.NotificationForm_MouseClick); - this.MouseEnter += new System.EventHandler(this.NotificationForm_MouseEnter); - this.MouseLeave += new System.EventHandler(this.NotificationForm_MouseLeave); - this.ResumeLayout(false); + AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + ClientSize = new System.Drawing.Size(400, 300); + Cursor = System.Windows.Forms.Cursors.Hand; + FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + Name = "NotificationForm"; + ShowInTaskbar = false; + StartPosition = System.Windows.Forms.FormStartPosition.Manual; + Text = "NotificationForm"; + MouseClick += new System.Windows.Forms.MouseEventHandler(NotificationForm_MouseClick); + MouseEnter += new System.EventHandler(NotificationForm_MouseEnter); + MouseLeave += new System.EventHandler(NotificationForm_MouseLeave); + ResumeLayout(false); } #endregion Windows Form Designer generated code