public BasicResult SaveProgress(SaveProgressRequest request) { string jsonFile = request.JsonFile; try { if (!Path.IsPathRooted(jsonFile)) { jsonFile = Path.Combine(ExePath, jsonFile); } SavedProgress progress = new SavedProgress(); progress.DiscoveredElements = _ElementsDiscovered; progress.WorkbenchState = request.WorkbenchState; using (JsonTextWriter jsonWriter = new JsonTextWriter(new StreamWriter(jsonFile))) { new JsonSerializer().Serialize(jsonWriter, progress); } ProgressDirty = false; return(new BasicResult { Success = true, Exception = null }); } catch (Exception ex) { return(new BasicResult { Success = false, Exception = ex }); } }
public BasicResult SaveProgress(SaveProgressRequest request) { string jsonFile = request.JsonFile; try { if (!Path.IsPathRooted(jsonFile)) { jsonFile = Path.Combine(ExePath, jsonFile); } SavedProgress progress = new SavedProgress(); progress.DiscoveredElements = _ElementsDiscovered; progress.WorkbenchState = request.WorkbenchState; using (JsonTextWriter jsonWriter = new JsonTextWriter(new StreamWriter(jsonFile))) { new JsonSerializer().Serialize(jsonWriter, progress); } ProgressDirty = false; return new BasicResult { Success = true, Exception = null }; } catch (Exception ex) { return new BasicResult { Success = false, Exception = ex }; } }