private async void messages_select_Click(object sender, EventArgs e) { try { OpenFileDialog op = new OpenFileDialog(); op.Multiselect = true; op.Filter = "Text Files Only|*.txt"; if (op.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var files = op.FileNames; await MessageContent.PrepateMessages(MessagesContect, files); MessagesCount.Text = MessagesContect.Messages.Count.ToString(); } } catch (Exception ex) { MessageBox.Show("UnExpected Error, Contact me ASAP please..." + Environment.NewLine + ex.Message, "UnExpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public MainDialog() { InitializeComponent(); MessagesContect = new MessageContent(); }