diff --git a/TGit/Helpers/ProcessHelper.cs b/TGit/Helpers/ProcessHelper.cs index d4c4aab..a1bc6b4 100644 --- a/TGit/Helpers/ProcessHelper.cs +++ b/TGit/Helpers/ProcessHelper.cs @@ -199,9 +199,9 @@ private void OutputDataHandler(object sendingProcess, DataReceivedEventArgs outL var text = outLine.Data + Environment.NewLine; - _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.AppendText(text, text.StartsWith(">")))); - _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.Select(_outputBox.richTextBox1.TextLength - text.Length + 1, 0))); - _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.ScrollToCaret())); + _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.AppendText(text, text.StartsWith(">")))); + _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.Select(_outputBox.richTextBox.TextLength - text.Length + 1, 0))); + _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.ScrollToCaret())); } private void process_Exited(object sender, EventArgs e) @@ -214,12 +214,12 @@ private void process_Exited(object sender, EventArgs e) var exitCodeText = process.ExitCode == 0 ? "Succes" : "Error"; var summaryText = $"{Environment.NewLine}{exitCodeText} ({_stopwatch.ElapsedMilliseconds} ms @ {process.StartTime})"; - _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.AppendText( + _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.AppendText( summaryText, process.ExitCode == 0 ? Color.Blue : Color.Red, true))); - _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.Select(_outputBox.richTextBox1.TextLength - summaryText.Length + Environment.NewLine.Length, 0))); - _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox1.ScrollToCaret())); + _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.Select(_outputBox.richTextBox.TextLength - summaryText.Length + Environment.NewLine.Length, 0))); + _outputBox.BeginInvoke((Action) (() => _outputBox.richTextBox.ScrollToCaret())); _outputBox.BeginInvoke((Action) (() => _outputBox.okButton.Enabled = true)); } } diff --git a/TGit/OutputBox.Designer.cs b/TGit/OutputBox.Designer.cs index 5203a42..6f7767e 100644 --- a/TGit/OutputBox.Designer.cs +++ b/TGit/OutputBox.Designer.cs @@ -30,9 +30,8 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OutputBox)); this.okButton = new System.Windows.Forms.Button(); - this.textBox = new System.Windows.Forms.TextBox(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.richTextBox = new System.Windows.Forms.RichTextBox(); this.flowLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // @@ -49,22 +48,6 @@ private void InitializeComponent() this.okButton.UseVisualStyleBackColor = true; this.okButton.Click += new System.EventHandler(this.okButton_Click); // - // textBox - // - this.textBox.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.textBox.BackColor = System.Drawing.SystemColors.Window; - this.textBox.Location = new System.Drawing.Point(12, 12); - this.textBox.Multiline = true; - this.textBox.Name = "textBox"; - this.textBox.ReadOnly = true; - this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBox.Size = new System.Drawing.Size(476, 274); - this.textBox.TabIndex = 2; - this.textBox.WordWrap = false; - this.textBox.TextChanged += new System.EventHandler(this.textBox_TextChanged); - // // flowLayoutPanel1 // this.flowLayoutPanel1.Controls.Add(this.okButton); @@ -74,18 +57,18 @@ private void InitializeComponent() this.flowLayoutPanel1.Size = new System.Drawing.Size(476, 32); this.flowLayoutPanel1.TabIndex = 4; // - // richTextBox1 + // richTextBox // - this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.richTextBox.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.richTextBox1.BackColor = System.Drawing.SystemColors.Window; - this.richTextBox1.Location = new System.Drawing.Point(12, 12); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.ReadOnly = true; - this.richTextBox1.Size = new System.Drawing.Size(476, 274); - this.richTextBox1.TabIndex = 2; - this.richTextBox1.Text = ""; + this.richTextBox.BackColor = System.Drawing.SystemColors.Window; + this.richTextBox.Location = new System.Drawing.Point(12, 12); + this.richTextBox.Name = "richTextBox"; + this.richTextBox.ReadOnly = true; + this.richTextBox.Size = new System.Drawing.Size(476, 274); + this.richTextBox.TabIndex = 2; + this.richTextBox.Text = ""; // // OutputBox // @@ -93,8 +76,7 @@ private void InitializeComponent() this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(500, 327); this.Controls.Add(this.flowLayoutPanel1); - this.Controls.Add(this.richTextBox1); - this.Controls.Add(this.textBox); + this.Controls.Add(this.richTextBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "OutputBox"; @@ -102,15 +84,13 @@ private void InitializeComponent() this.Text = "TGit"; this.flowLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); } #endregion public System.Windows.Forms.Button okButton; - public System.Windows.Forms.TextBox textBox; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - public System.Windows.Forms.RichTextBox richTextBox1; + public System.Windows.Forms.RichTextBox richTextBox; } } \ No newline at end of file diff --git a/TGit/OutputBox.cs b/TGit/OutputBox.cs index fabcd03..b37f1b7 100644 --- a/TGit/OutputBox.cs +++ b/TGit/OutputBox.cs @@ -21,7 +21,7 @@ public OutputBox(DTE dte) private void okButton_Click(object sender, EventArgs e) { Close(); - textBox.Clear(); + richTextBox.Clear(); okButton.Enabled = false; } @@ -43,9 +43,9 @@ private void StashButton_Click(object sender, EventArgs e) private void textBox_TextChanged(object sender, EventArgs e) { - if (!textBox.Text.ToLower().Contains("error")) return; + if (!richTextBox.Text.ToLower().Contains("error")) return; - if (textBox.Text.ToLower().Contains("fix conflicts") && !flowLayoutPanel1.Controls.Find("Resolve", true).Any()) + if (richTextBox.Text.ToLower().Contains("fix conflicts") && !flowLayoutPanel1.Controls.Find("Resolve", true).Any()) { var resolveButton = new Button { @@ -57,7 +57,7 @@ private void textBox_TextChanged(object sender, EventArgs e) flowLayoutPanel1.Controls.Add(resolveButton); } - if (textBox.Text.ToLower().Contains("stash") && !flowLayoutPanel1.Controls.Find("Stash", true).Any()) + if (richTextBox.Text.ToLower().Contains("stash") && !flowLayoutPanel1.Controls.Find("Stash", true).Any()) { var stashButton = new Button {