public void SaveRequiresThirdParamForBrainz() { string tempFileName = GetTempFileNameWithExt(".brainz"); Assert.Throws <ArgumentNullException>(() => ProjectLoader.SaveProject(tempFileName, "foobar", null)); }
public void SavesSomethingZipped() { string tempFileName = GetTempFileNameWithExt(".brainz"); ProjectLoader.SaveProject(tempFileName, "foobar", GetDataPath()); Assert.True(File.Exists(tempFileName)); }
public void SavesSomething() { string tempFileName = GetTempFileNameWithExt(".brain"); ProjectLoader.SaveProject(tempFileName, "foobar", null); Assert.True(File.Exists(tempFileName)); }
public void SavesAndLoadsZippedBrain() { string tempFileName = GetTempFileNameWithExt(".brainz"); ProjectLoader.SaveProject(tempFileName, "something_zipped", GetDataPath()); string content = ProjectLoader.LoadProject(tempFileName, GetDataPath()); Assert.Equal("something_zipped", content); }
public void SaveProject() { Action onStop = delegate { MapEditor.StopEditing(); ProjectLoader.SaveProject(); }; NodeEditor.StopEditing(onStop); }
/// <summary> /// Saves project to given path /// </summary> /// <param name="path">Path for saving .brain/.brainz file</param> public void SaveProject(string path) { MyLog.INFO.WriteLine("Saving project: " + path); try { string fileContent = Project.Serialize(Path.GetDirectoryName(path)); ProjectLoader.SaveProject(path, fileContent, MyMemoryBlockSerializer.GetTempStorage(Project)); } catch (Exception e) { MyLog.ERROR.WriteLine("Project saving failed: " + e.Message); throw; } }
private void SaveProject(object sender, EventArgs e) { try { if (!IsProjectSelected(_errorsList.SelectedItems)) { return; } var loader = new ProjectLoader(); // REVIEW: DI loader.SaveProject(CurrentProject, CurrentProject.FullPath); CleanErrorListAfterSaveProject(); } catch (Exception ex) { ShowError(ex.ToString(), ErrorsResources.ErrorSavingProjects); } }
/// <summary> /// Saves project to given path /// </summary> /// <param name="path">Path for saving .brain/.brainz file</param> public void SaveProject(string path = null) { if (!string.IsNullOrEmpty(path)) { Project.FileName = path; } MyLog.INFO.WriteLine("Saving project: " + Project.FileName); try { string fileContent = Project.Serialize(); ProjectLoader.SaveProject(Project.FileName, fileContent, MyMemoryBlockSerializer.GetTempStorage(Project)); } catch (Exception e) { MyLog.ERROR.WriteLine("Project saving failed: " + e.Message); throw; } }