public static void Main(string[] args) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Title = "Open Circuit File"; openFileDialog.Filter = "Text Files (.txt)|*.txt|All Files(*.*)|*.*"; openFileDialog.FilterIndex = 1; openFileDialog.Multiselect = false; DialogResult dialogResult = openFileDialog.ShowDialog(); if (dialogResult == DialogResult.OK) { CircuitFileParser.Parse(openFileDialog.FileName); } Console.Read(); }
/// <summary> /// Handles clicking the 'Open...' entry in the window's menu. /// </summary> /// <param name="sender">The sender of this event.</param> /// <param name="routedEventArgs">The arguments of this event.</param> protected void OnOpenCircuitFile(object sender, RoutedEventArgs routedEventArgs) { openFileDialog = new OpenFileDialog { Title = @"Open Circuit File", Filter = @"Text Files Only (.txt)|*.txt", FilterIndex = 1, Multiselect = false }; var dialogResult = openFileDialog.ShowDialog(); if (dialogResult == System.Windows.Forms.DialogResult.OK) { circuit = CircuitFileParser.Parse(openFileDialog.FileName); } ThreadManager.IsThreadsDone += PrintResults; circuit.Start(); //ThreadManager.StartWait(); }