private void findWhatButton_Click(object sender, EventArgs e) { if (searchWhatTextBox.Text.Length != 0) { DataLogSearchForm.GetInstance().searchLogListBox.Items.Clear(); if (DataLogSearchForm.GetInstance().Visible == false) { DataLogSearchForm.GetInstance().Show(this); } else { DataLogSearchForm.GetInstance().Activate(); } List <string> strLogArray = new List <string>(); foreach (string log in strLogRawArray) { if (log.Contains(searchWhatTextBox.Text) == true) { strLogArray.Add(log); } } DataLogSearchForm.GetInstance().searchLogListBox.Items.AddRange(strLogArray.ToArray()); } else { MessageBox.Show(this, "The input string is empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static DataLogSearchForm GetInstance() { if (singlaton == null) { singlaton = new DataLogSearchForm(); } return(singlaton); }
private void DataLogSearchForm_FormClosed(object sender, FormClosedEventArgs e) { singlaton = null; }
private void closeButton_Click(object sender, EventArgs e) { this.Close(); this.Dispose(); singlaton = null; }