делает мелкие правки

- переименовывает label1 в resultCountLabel
- добавляет очистку предыдущего результата перед вызовом алгоритма
This commit is contained in:
Maxim Slipenko 2022-05-16 15:54:54 +03:00
parent bc0d2385f7
commit 3ed395fab8
Signed by: Maks1mS
GPG Key ID: 7461AF39A8705FB8
2 changed files with 18 additions and 13 deletions

24
MainForm.Designer.cs generated
View File

@ -31,7 +31,7 @@
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.resultCountLabel = new System.Windows.Forms.Label();
this.resultStatusStrip = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
@ -81,17 +81,17 @@
this.executeButton.UseVisualStyleBackColor = true;
this.executeButton.Click += new System.EventHandler(this.executeButton_Click);
//
// label1
// resultCountLabel
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
this.resultCountLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| 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, 323);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(303, 24);
this.label1.TabIndex = 3;
this.label1.Text = "Количество e-mail-ов в тексте: 3";
this.resultCountLabel.AutoSize = true;
this.resultCountLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.resultCountLabel.Location = new System.Drawing.Point(12, 323);
this.resultCountLabel.Name = "resultCountLabel";
this.resultCountLabel.Size = new System.Drawing.Size(303, 24);
this.resultCountLabel.TabIndex = 3;
this.resultCountLabel.Text = "Количество e-mail-ов в тексте: 3";
//
// resultStatusStrip
//
@ -140,7 +140,7 @@
this.Controls.Add(this.executeButton);
this.Controls.Add(this.resultStatusStrip);
this.Controls.Add(this.menuStrip1);
this.Controls.Add(this.label1);
this.Controls.Add(this.resultCountLabel);
this.Controls.Add(this.sourceRichTextBox);
this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(642, 438);
@ -160,7 +160,7 @@
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.Label resultCountLabel;
private System.Windows.Forms.StatusStrip resultStatusStrip;
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;

View File

@ -19,6 +19,11 @@ namespace AwesomeEmailExtractor
private void executeButton_Click(object sender, EventArgs e)
{
// Чистим предыдущий результат
toolStripStatusLabel.Text = "";
resultCountLabel.Text = "";
uniqueListBox.DataSource = null;
// Объявляем список уникальных e-mail-ов
List<string> uniqueEmails = new List<string>();
@ -30,7 +35,7 @@ namespace AwesomeEmailExtractor
// Выводим результат
toolStripStatusLabel.Text = "Успех!";
label1.Text = $"Количество e-mail-ов в тексте: {count}";
resultCountLabel.Text = $"Количество e-mail-ов в тексте: {count}";
uniqueListBox.DataSource = uniqueEmails;
}
}