示例#1
0
        public void SaveEditorModel(EditorModel model)
        {
            var container = new FileContainer {
                MontageModel = model.Montage, WindowState = model.WindowState
            };

            HeadedJsonFormat.Write(model.ModelFileLocation, container);
        }
示例#2
0
 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);
 }
示例#3
0
        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);
        }