protected override void LoadEnvironmentCommandImplementation() { var dlg = ViewModels.Ioc.SimpleIoc <IFileDialog> .GetInstance("OpenFile"); dlg.AddExtension = true; dlg.DefaultExt = "jEnv"; dlg.Filter = "Environment (JSON) |*.jEnv"; var b = dlg.ShowDialog(); if (b.HasValue && b.Value) { if (ZipArchiveHelper.ImportEnvironment(dlg.FileName, out string machineFile, out string toolsFile, out string toolingFile)) { LoadMachine(machineFile, (m) => { if (m != null) { Kernel.Machines.Add(m.ToViewModel()); _lastMachineFile = machineFile; LoadTooling(toolingFile, (tooling) => { var toolset = LoadTools(tooling.Tools); SetTooling(tooling, toolset); _lastToolingFile = tooling.Tools; }); } }); } } }
protected override void SaveEnvironmentCommandImplementation() { var dlg = ViewModels.Ioc.SimpleIoc <IFileDialog> .GetInstance("SaveFile"); dlg.AddExtension = true; dlg.DefaultExt = "jEnv"; dlg.Filter = "Environment (JSON) |*.jEnv"; var b = dlg.ShowDialog(); if (b.HasValue && b.Value) { ZipArchiveHelper.ExportEnvironment(dlg.FileName, _lastMachineFile, _lastToolsFile, _lastToolingFile); } }