From 878a1f26573bf50e4973f595af5412f613d151cc Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Mon, 16 May 2022 15:42:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B8=D0=BD=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B8=D0=BD=D1=82=D0=B5=D0=B3=D1=80=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D1=82=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - переименовывает элементы для улучшения DX - добавляет обработчик к executeButton --- MainForm.Designer.cs | 144 +++++++++++++++++++++---------------------- MainForm.cs | 4 ++ MainForm.resx | 2 +- 3 files changed, 77 insertions(+), 73 deletions(-) diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 1a9b505..866012e 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -28,57 +28,58 @@ /// private void InitializeComponent() { - this.listBox1 = new System.Windows.Forms.ListBox(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.button1 = new System.Windows.Forms.Button(); + this.uniqueListBox = new System.Windows.Forms.ListBox(); + this.sourceRichTextBox = new System.Windows.Forms.RichTextBox(); + this.executeButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.resultStatusStrip = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.файлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.справкаToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.statusStrip1.SuspendLayout(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.resultStatusStrip.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // - // listBox1 + // uniqueListBox // - this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.uniqueListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); - this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.listBox1.FormattingEnabled = true; - this.listBox1.ItemHeight = 20; - this.listBox1.Items.AddRange(new object[] { + this.uniqueListBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.uniqueListBox.FormattingEnabled = true; + this.uniqueListBox.ItemHeight = 20; + this.uniqueListBox.Items.AddRange(new object[] { "alice@example.com", "bob@example.com"}); - this.listBox1.Location = new System.Drawing.Point(411, 32); - this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(225, 384); - this.listBox1.TabIndex = 0; + this.uniqueListBox.Location = new System.Drawing.Point(424, 32); + this.uniqueListBox.Name = "uniqueListBox"; + this.uniqueListBox.Size = new System.Drawing.Size(225, 304); + this.uniqueListBox.TabIndex = 0; // - // richTextBox1 + // sourceRichTextBox // - this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.sourceRichTextBox.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.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.richTextBox1.Location = new System.Drawing.Point(12, 32); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(393, 350); - this.richTextBox1.TabIndex = 1; - this.richTextBox1.Text = "Алиса (alice@example.com) послылает Бобу (bob@example.com) сообщение.\nАдрес bob@e" + + this.sourceRichTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.sourceRichTextBox.Location = new System.Drawing.Point(12, 32); + this.sourceRichTextBox.Name = "sourceRichTextBox"; + this.sourceRichTextBox.Size = new System.Drawing.Size(406, 288); + this.sourceRichTextBox.TabIndex = 1; + this.sourceRichTextBox.Text = "Алиса (alice@example.com) послылает Бобу (bob@example.com) сообщение.\nАдрес bob@e" + "xample.com Алиса нашла на сайте example.com"; // - // button1 + // executeButton // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.executeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.button1.Location = new System.Drawing.Point(12, 412); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(393, 24); - this.button1.TabIndex = 2; - this.button1.Text = "Выполнить"; - this.button1.UseVisualStyleBackColor = true; + this.executeButton.Location = new System.Drawing.Point(12, 350); + this.executeButton.Name = "executeButton"; + this.executeButton.Size = new System.Drawing.Size(406, 24); + this.executeButton.TabIndex = 2; + this.executeButton.Text = "Выполнить"; + this.executeButton.UseVisualStyleBackColor = true; + this.executeButton.Click += new System.EventHandler(this.executeButton_Click); // // label1 // @@ -86,68 +87,67 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.label1.Location = new System.Drawing.Point(12, 385); + this.label1.Location = new System.Drawing.Point(12, 323); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(303, 24); this.label1.TabIndex = 3; this.label1.Text = "Количество e-mail-ов в тексте: 3"; // - // statusStrip1 + // resultStatusStrip // - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabel1}); - this.statusStrip1.Location = new System.Drawing.Point(0, 439); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(648, 22); - this.statusStrip1.TabIndex = 4; - this.statusStrip1.Text = "statusStrip1"; + this.resultStatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel}); + this.resultStatusStrip.Location = new System.Drawing.Point(0, 377); + this.resultStatusStrip.Name = "resultStatusStrip"; + this.resultStatusStrip.Size = new System.Drawing.Size(661, 22); + this.resultStatusStrip.TabIndex = 4; // - // toolStripStatusLabel1 + // toolStripStatusLabel // - this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; - this.toolStripStatusLabel1.Size = new System.Drawing.Size(42, 17); - this.toolStripStatusLabel1.Text = "Успех!"; + this.toolStripStatusLabel.Name = "toolStripStatusLabel"; + this.toolStripStatusLabel.Size = new System.Drawing.Size(42, 17); + this.toolStripStatusLabel.Text = "Успех!"; // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.файлToolStripMenuItem, - this.справкаToolStripMenuItem}); + this.fileToolStripMenuItem, + this.helpToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(648, 24); + this.menuStrip1.Size = new System.Drawing.Size(661, 24); this.menuStrip1.TabIndex = 5; this.menuStrip1.Text = "menuStrip1"; // - // файлToolStripMenuItem + // fileToolStripMenuItem // - this.файлToolStripMenuItem.Name = "файлToolStripMenuItem"; - this.файлToolStripMenuItem.Size = new System.Drawing.Size(48, 20); - this.файлToolStripMenuItem.Text = "Файл"; + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.fileToolStripMenuItem.Text = "Файл"; // - // справкаToolStripMenuItem + // helpToolStripMenuItem // - this.справкаToolStripMenuItem.Name = "справкаToolStripMenuItem"; - this.справкаToolStripMenuItem.Size = new System.Drawing.Size(65, 20); - this.справкаToolStripMenuItem.Text = "Справка"; + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(65, 20); + this.helpToolStripMenuItem.Text = "Справка"; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(648, 461); - this.Controls.Add(this.listBox1); - this.Controls.Add(this.button1); - this.Controls.Add(this.statusStrip1); + this.ClientSize = new System.Drawing.Size(661, 399); + this.Controls.Add(this.uniqueListBox); + this.Controls.Add(this.executeButton); + this.Controls.Add(this.resultStatusStrip); this.Controls.Add(this.menuStrip1); this.Controls.Add(this.label1); - this.Controls.Add(this.richTextBox1); + this.Controls.Add(this.sourceRichTextBox); this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(642, 438); this.Name = "MainForm"; this.Text = "Main Form"; - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); + this.resultStatusStrip.ResumeLayout(false); + this.resultStatusStrip.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); @@ -157,15 +157,15 @@ #endregion - private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.RichTextBox richTextBox1; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.ListBox uniqueListBox; + private System.Windows.Forms.RichTextBox sourceRichTextBox; + private System.Windows.Forms.Button executeButton; private System.Windows.Forms.Label label1; - private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.StatusStrip resultStatusStrip; private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem файлToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem справкаToolStripMenuItem; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; } } diff --git a/MainForm.cs b/MainForm.cs index 5354a22..dcf9355 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -16,5 +16,9 @@ namespace AwesomeEmailExtractor { InitializeComponent(); } + + private void executeButton_Click(object sender, EventArgs e) + { + } } } diff --git a/MainForm.resx b/MainForm.resx index 6beaffa..f9962f8 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17