public void SaveEditorModel(EditorModel model) { var container = new FileContainer { MontageModel = model.Montage, WindowState = model.WindowState }; HeadedJsonFormat.Write(model.ModelFileLocation, container); }
public static void Save(EditorModel model) { var container = new FileContainer { MontageModel = model.Montage, WindowState = model.WindowState }; HeadedJsonFormat.Write<FileContainer>(model.Locations.LocalFilePath, localFileHeader, CurrentLocalVersion, container); }
EditorModel LoadExistingModel(FileContainer container, FileInfo file, DirectoryInfo rawLocation) { if (rawLocation != null) { container.MontageModel.DisplayedRawLocation = MyPath.RelativeTo(rawLocation.FullName, RawFolder.FullName); } else { container.MontageModel.DisplayedRawLocation = file.Name; rawLocation = new DirectoryInfo("Z:\\"); } if (container.MontageModel.Patches == null) { container.MontageModel.Patches = new List <Patch>(); } var model = new EditorModel(file, rawLocation, this, container.MontageModel, container.WindowState); SaveEditorModel(model); return(model); }