From bc998d767671410b9dda707459eea5eb074ccb76 Mon Sep 17 00:00:00 2001 From: Ace Olszowka Date: Sun, 18 Oct 2020 20:27:14 -0600 Subject: [PATCH] Ran the Formatter (#14) --- .../AboutManipulativeReplacerBox.cs | 12 ++-- .../BindableToolStripMenuItem.cs | 14 ++--- ManipulativeReplacer/MainForm.cs | 62 +++++++++---------- ManipulativeReplacer/Pattern.cs | 4 +- 4 files changed, 46 insertions(+), 46 deletions(-) diff --git a/ManipulativeReplacer/AboutManipulativeReplacerBox.cs b/ManipulativeReplacer/AboutManipulativeReplacerBox.cs index f5e9afd..e838d18 100644 --- a/ManipulativeReplacer/AboutManipulativeReplacerBox.cs +++ b/ManipulativeReplacer/AboutManipulativeReplacerBox.cs @@ -14,12 +14,12 @@ partial class AboutManipulativeReplacerBox : Form public AboutManipulativeReplacerBox() { InitializeComponent(); - this.Text = String.Format("About {0}", AssemblyTitle); - this.labelProductName.Text = AssemblyProduct; - this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); - this.labelCopyright.Text = AssemblyCopyright; - this.labelCompanyName.Text = AssemblyCompany; - this.textBoxDescription.Text = AssemblyDescription; + Text = String.Format("About {0}", AssemblyTitle); + labelProductName.Text = AssemblyProduct; + labelVersion.Text = String.Format("Version {0}", AssemblyVersion); + labelCopyright.Text = AssemblyCopyright; + labelCompanyName.Text = AssemblyCompany; + textBoxDescription.Text = AssemblyDescription; } #region Assembly Attribute Accessors diff --git a/ManipulativeReplacer/BindableToolStripMenuItem.cs b/ManipulativeReplacer/BindableToolStripMenuItem.cs index 516180b..2693d62 100644 --- a/ManipulativeReplacer/BindableToolStripMenuItem.cs +++ b/ManipulativeReplacer/BindableToolStripMenuItem.cs @@ -25,16 +25,16 @@ public BindingContext BindingContext { get { - if (this.bindingContext == null) + if (bindingContext == null) { - this.bindingContext = new BindingContext(); + bindingContext = new BindingContext(); } - return this.bindingContext; + return bindingContext; } set { - this.bindingContext = value; + bindingContext = value; } } @@ -46,12 +46,12 @@ public ControlBindingsCollection DataBindings { get { - if (this.dataBindings == null) + if (dataBindings == null) { - this.dataBindings = new ControlBindingsCollection(this); + dataBindings = new ControlBindingsCollection(this); } - return this.dataBindings; + return dataBindings; } } diff --git a/ManipulativeReplacer/MainForm.cs b/ManipulativeReplacer/MainForm.cs index 197abeb..241c8f8 100644 --- a/ManipulativeReplacer/MainForm.cs +++ b/ManipulativeReplacer/MainForm.cs @@ -30,14 +30,14 @@ public MainForm() InitializeComponent(); // Set our default font (Consolas) - this.fontDialog.Font = + fontDialog.Font = new Font("Consolas", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.SetTextBoxFont(this.fontDialog.Font); + SetTextBoxFont(fontDialog.Font); // Bind the Advanced Pattern Saver - this.comboBoxInputPatternSaver.ComboBox.DataSource = this.avaliablePatterns; - this.comboBoxInputPatternSaver.ComboBox.DisplayMember = "Name"; - this.comboBoxInputPatternSaver.ComboBox.ValueMember = "Value"; + comboBoxInputPatternSaver.ComboBox.DataSource = avaliablePatterns; + comboBoxInputPatternSaver.ComboBox.DisplayMember = "Name"; + comboBoxInputPatternSaver.ComboBox.ValueMember = "Value"; // Bind the Additional Program Settings BindProgramSettings(); @@ -147,7 +147,7 @@ private static string _PerformReplacement(string inputPattern, string inputRepla private static IEnumerable _PerformReplacement(string inputPattern, string inputReplacement) { // Split the input string on the new line character - var replacementEntries = + string[] replacementEntries = inputReplacement.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries); // Perform the replacement @@ -167,9 +167,9 @@ private static IEnumerable _PerformReplacement(string inputPattern, stri /// The font to set the text boxes to private void SetTextBoxFont(Font font) { - this.patternInputTextBox.Font = font; - this.replacementInputTextBox.Font = font; - this.outputTextBox.Font = font; + patternInputTextBox.Font = font; + replacementInputTextBox.Font = font; + outputTextBox.Font = font; } /// @@ -179,7 +179,7 @@ private void SetTextBoxFont(Font font) /// The arguments to the EventHandler. private void fontDialog_Apply(object sender, EventArgs e) { - this.SetTextBoxFont(this.fontDialog.Font); + SetTextBoxFont(fontDialog.Font); } #endregion @@ -194,14 +194,14 @@ private void fontDialog_Apply(object sender, EventArgs e) private void changeFontToolStripMenuItem_Click(object sender, EventArgs e) { // Save off the previous font - Font previousFontValue = this.fontDialog.Font; + Font previousFontValue = fontDialog.Font; - if (this.fontDialog.ShowDialog() == DialogResult.Cancel) + if (fontDialog.ShowDialog() == DialogResult.Cancel) { - this.fontDialog.Font = previousFontValue; + fontDialog.Font = previousFontValue; } - this.SetTextBoxFont(this.fontDialog.Font); + SetTextBoxFont(fontDialog.Font); } /// @@ -211,7 +211,7 @@ private void changeFontToolStripMenuItem_Click(object sender, EventArgs e) /// The arguments to this event. private void exitToolStripMenuItem_Click(object sender, EventArgs e) { - this.Close(); + Close(); } /// @@ -267,7 +267,7 @@ private void outputPanelWordWrapToolStripMenuItem_CheckedChanged(object sender, private void outputPanelSingleLineToolStripMenuItem_CheckedChanged(object sender, EventArgs e) { Settings.Default.OutputPanelSingleLine = ((ToolStripMenuItem)sender).Checked; - this.OnInputsChanged(sender, e); + OnInputsChanged(sender, e); } /// @@ -314,7 +314,7 @@ private void resetSettingsToolStripMenuItem_Click(object sender, EventArgs e) /// The arguments to this event. private void inputPanelDeleteButton_Click(object sender, EventArgs e) { - this.avaliablePatterns.RemoveAt(this.comboBoxInputPatternSaver.ComboBox.SelectedIndex); + avaliablePatterns.RemoveAt(comboBoxInputPatternSaver.ComboBox.SelectedIndex); } /// @@ -324,14 +324,14 @@ private void inputPanelDeleteButton_Click(object sender, EventArgs e) /// The arguments to this event. private void inputPatternSaveButton_Click(object sender, EventArgs e) { - string patternName = this.comboBoxInputPatternSaver.ComboBox.Text; - string patternValue = this.patternInputTextBox.Text; + string patternName = comboBoxInputPatternSaver.ComboBox.Text; + string patternValue = patternInputTextBox.Text; // Save the Pattern Pattern newPattern = new Pattern(patternName, patternValue); - this.avaliablePatterns.Add(newPattern); - this.comboBoxInputPatternSaver.ComboBox.SelectedIndex = - this.avaliablePatterns.IndexOf(newPattern); + avaliablePatterns.Add(newPattern); + comboBoxInputPatternSaver.ComboBox.SelectedIndex = + avaliablePatterns.IndexOf(newPattern); } /// @@ -342,8 +342,8 @@ private void inputPatternSaveButton_Click(object sender, EventArgs e) private void comboBoxInputPatternSaver_SelectedIndexChanged(object sender, EventArgs e) { Pattern selectedPattern = - this.avaliablePatterns[this.comboBoxInputPatternSaver.ComboBox.SelectedIndex]; - this.patternInputTextBox.Text = selectedPattern.Value; + avaliablePatterns[comboBoxInputPatternSaver.ComboBox.SelectedIndex]; + patternInputTextBox.Text = selectedPattern.Value; } #endregion @@ -356,16 +356,16 @@ private void comboBoxInputPatternSaver_SelectedIndexChanged(object sender, Event /// private void BindProgramSettings() { - this.patternPanelWordWrapToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "PatternPanelWordWrap"); - this.patternInputTextBox.DataBindings.Add("WordWrap", Settings.Default, "PatternPanelWordWrap"); + patternPanelWordWrapToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "PatternPanelWordWrap"); + patternInputTextBox.DataBindings.Add("WordWrap", Settings.Default, "PatternPanelWordWrap"); - this.inputPanelWordWrapToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "InputPanelWordWrap"); - this.replacementInputTextBox.DataBindings.Add("WordWrap", Settings.Default, "InputPanelWordWrap"); + inputPanelWordWrapToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "InputPanelWordWrap"); + replacementInputTextBox.DataBindings.Add("WordWrap", Settings.Default, "InputPanelWordWrap"); - this.outputPanelWordWrapToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "OutputPanelWordWrap"); - this.outputTextBox.DataBindings.Add("WordWrap", Settings.Default, "OutputPanelWordWrap"); + outputPanelWordWrapToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "OutputPanelWordWrap"); + outputTextBox.DataBindings.Add("WordWrap", Settings.Default, "OutputPanelWordWrap"); - this.outputPanelSingleLineToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "OutputPanelSingleLine"); + outputPanelSingleLineToolStripMenuItem.DataBindings.Add("Checked", Settings.Default, "OutputPanelSingleLine"); } #endregion diff --git a/ManipulativeReplacer/Pattern.cs b/ManipulativeReplacer/Pattern.cs index e917b77..89c4cc9 100644 --- a/ManipulativeReplacer/Pattern.cs +++ b/ManipulativeReplacer/Pattern.cs @@ -19,8 +19,8 @@ public class Pattern /// The pattern. public Pattern(string name, string value) { - this.Name = name; - this.Value = value; + Name = name; + Value = value; } ///