aangepast
08c0e7ca74d4113f9ec77f87d255483c69ee6d0d
2 files changed
GrokCatter/Form1.Designer.csGrokCatter/Form1.cs
diff --git a/GrokCatter/Form1.Designer.cs b/GrokCatter/Form1.Designer.cs
index 699023f..9989769 100644
--- a/GrokCatter/Form1.Designer.cs
+++ b/GrokCatter/Form1.Designer.cs
@@ -29,12 +29,9 @@
private void InitializeComponent()
{
textBox1 = new TextBox();
- textBox2 = new TextBox();
listView1 = new ListView();
button2 = new Button();
- button3 = new Button();
checkBox1 = new CheckBox();
- button4 = new Button();
splitContainer1 = new SplitContainer();
listView2 = new ListView();
comboBox1 = new ComboBox();
@@ -50,23 +47,10 @@
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
textBox1.Location = new Point(12, 12);
textBox1.Name = "textBox1";
- textBox1.Size = new Size(900, 23);
+ textBox1.Size = new Size(657, 23);
textBox1.TabIndex = 1;
textBox1.TextChanged += TextBox1_TextChanged;
//
- // textBox2
- //
- textBox2.AcceptsReturn = true;
- textBox2.AcceptsTab = true;
- textBox2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
- textBox2.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, 0);
- textBox2.Location = new Point(159, 3);
- textBox2.Multiline = true;
- textBox2.Name = "textBox2";
- textBox2.ScrollBars = ScrollBars.Both;
- textBox2.Size = new Size(579, 384);
- textBox2.TabIndex = 2;
- //
// listView1
//
listView1.CheckBoxes = true;
@@ -75,7 +59,7 @@
listView1.HeaderStyle = ColumnHeaderStyle.None;
listView1.Location = new Point(0, 0);
listView1.Name = "listView1";
- listView1.Size = new Size(150, 390);
+ listView1.Size = new Size(325, 390);
listView1.TabIndex = 3;
listView1.UseCompatibleStateImageBehavior = false;
listView1.View = View.Details;
@@ -84,25 +68,15 @@
//
// button2
//
- button2.Location = new Point(396, 40);
+ button2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
+ button2.Location = new Point(598, 39);
button2.Name = "button2";
button2.Size = new Size(73, 23);
button2.TabIndex = 4;
- button2.Text = "Cat";
+ button2.Text = "CatCopy";
button2.UseVisualStyleBackColor = true;
button2.Click += Button2_Click;
//
- // button3
- //
- button3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- button3.Location = new Point(728, 40);
- button3.Name = "button3";
- button3.Size = new Size(79, 23);
- button3.TabIndex = 5;
- button3.Text = "Clear";
- button3.UseVisualStyleBackColor = true;
- button3.Click += Button3_Click;
- //
// checkBox1
//
checkBox1.AutoSize = true;
@@ -114,17 +88,6 @@
checkBox1.UseVisualStyleBackColor = true;
checkBox1.CheckedChanged += CheckBox1_CheckedChanged;
//
- // button4
- //
- button4.Anchor = AnchorStyles.Top | AnchorStyles.Right;
- button4.Location = new Point(833, 40);
- button4.Name = "button4";
- button4.Size = new Size(79, 23);
- button4.TabIndex = 7;
- button4.Text = "Copy";
- button4.UseVisualStyleBackColor = true;
- button4.Click += Button4_Click;
- //
// splitContainer1
//
splitContainer1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
@@ -139,21 +102,20 @@
// splitContainer1.Panel2
//
splitContainer1.Panel2.Controls.Add(listView2);
- splitContainer1.Panel2.Controls.Add(textBox2);
- splitContainer1.Size = new Size(903, 390);
- splitContainer1.SplitterDistance = 150;
+ splitContainer1.Size = new Size(660, 390);
+ splitContainer1.SplitterDistance = 325;
splitContainer1.SplitterWidth = 8;
splitContainer1.TabIndex = 8;
//
// listView2
//
- listView2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
+ listView2.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
listView2.CheckBoxes = true;
listView2.GridLines = true;
listView2.HeaderStyle = ColumnHeaderStyle.None;
listView2.Location = new Point(3, 3);
listView2.Name = "listView2";
- listView2.Size = new Size(150, 384);
+ listView2.Size = new Size(321, 384);
listView2.TabIndex = 4;
listView2.UseCompatibleStateImageBehavior = false;
listView2.View = View.Details;
@@ -162,7 +124,7 @@
//
comboBox1.FormattingEnabled = true;
comboBox1.Items.AddRange(new object[] { "example1" });
- comboBox1.Location = new Point(172, 39);
+ comboBox1.Location = new Point(119, 39);
comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(151, 23);
comboBox1.TabIndex = 9;
@@ -170,7 +132,7 @@
//
// button5
//
- button5.Location = new Point(329, 40);
+ button5.Location = new Point(276, 39);
button5.Name = "button5";
button5.Size = new Size(47, 23);
button5.TabIndex = 10;
@@ -182,13 +144,11 @@
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
- ClientSize = new Size(927, 471);
+ ClientSize = new Size(684, 471);
Controls.Add(button5);
Controls.Add(comboBox1);
Controls.Add(splitContainer1);
- Controls.Add(button4);
Controls.Add(checkBox1);
- Controls.Add(button3);
Controls.Add(button2);
Controls.Add(textBox1);
MinimumSize = new Size(700, 0);
@@ -196,7 +156,6 @@
Text = "Cat the files";
splitContainer1.Panel1.ResumeLayout(false);
splitContainer1.Panel2.ResumeLayout(false);
- splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
splitContainer1.ResumeLayout(false);
ResumeLayout(false);
@@ -205,12 +164,9 @@
#endregion
private TextBox textBox1;
- private TextBox textBox2;
private ListView listView1;
private Button button2;
- private Button button3;
private CheckBox checkBox1;
- private Button button4;
private SplitContainer splitContainer1;
private ListView listView2;
private ComboBox comboBox1;
diff --git a/GrokCatter/Form1.cs b/GrokCatter/Form1.cs
index b47b720..ca9aed0 100644
--- a/GrokCatter/Form1.cs
+++ b/GrokCatter/Form1.cs
@@ -1,4 +1,5 @@
using System.Diagnostics;
+using System.Text;
using System.Text.Json;
namespace GrokCatter
@@ -70,13 +71,9 @@ namespace GrokCatter
}
}
- private void Button3_Click(object sender, EventArgs e)
- {
- this.textBox2.Clear();
- }
-
private async void Button2_Click(object sender, EventArgs e)
{
+ var sb = new StringBuilder();
var selectedItems = listView2.Items.Cast<ListViewItem>().ToList();
foreach (var selectedItem in selectedItems)
{
@@ -84,11 +81,12 @@ namespace GrokCatter
if (file == null)
continue;
var text = await File.ReadAllTextAsync(file);
- this.textBox2.AppendText(Environment.NewLine);
- this.textBox2.AppendText($"// {Path.GetFileName(file)}{Environment.NewLine}");
- this.textBox2.AppendText($"// ------------------------{Environment.NewLine}");
- this.textBox2.AppendText(text);
+ sb.AppendLine();
+ sb.AppendLine($"// {Path.GetFileName(file)}");
+ sb.AppendLine($"// ------------------------");
+ sb.AppendLine(text);
}
+ Clipboard.SetText(sb.ToString());
}
private void CheckBox1_CheckedChanged(object sender, EventArgs e)
@@ -99,11 +97,6 @@ namespace GrokCatter
}
}
- private void Button4_Click(object sender, EventArgs e)
- {
- Clipboard.SetText(this.textBox2.Text);
- }
-
private void ListView1_ItemChecked(object sender, ItemCheckedEventArgs e)
{
var item = this.listView2