private void button_open_Click(object sender, EventArgs e) { try { ti = this.GetFile(); this.button_convert.Enabled = true; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public TuringInfo GetFile() { TuringInfo ti = new TuringInfo(); System.Windows.Forms.OpenFileDialog openfile = new System.Windows.Forms.OpenFileDialog(); openfile.Filter = "EMT files|*.alg"; var result = openfile.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { ti = Контейнер.GetTuringInfo(openfile.FileName); } else { throw new FileLoadException("file weren't chosen"); } return(ti); }