public static async Task <TestcaseBlockerDataset> LoadDataset() { Console.Write("Enter filename without extension: "); string filename = Console.ReadLine(); var path = Path.Combine(GetDataPath(), filename + ".json"); if (!File.Exists(path)) { Console.WriteLine($"File not found at {path}"); return(null); } Console.WriteLine("Loading dataset..."); var dataset = await IOOperations.LoadAsync <TestcaseBlockerDataset>(path); Console.WriteLine(dataset.ToString()); return(dataset); }
private async void LoadDataset() { var dlg = new OpenFileDialog { Filter = "Json (*.json)|*.json" }; if (dlg.ShowDialog() == true) { try { Dataset = await IOOperations.LoadAsync <TestcaseBlockerDataset>(dlg.FileName); SetStatusMessage("Dataset loaded."); } catch { Dataset = null; SetStatusMessage("Loading dataset failed. Please check the data format."); } } }