Serialize() public method

Given a Project serializes it into a Project_v4.
public Serialize ( string projectAbsPath, Project project ) : Project_v4
projectAbsPath string
project Project
return Project_v4
Exemplo n.º 1
0
        /// <summary>
        /// Saves the project. 
        /// </summary>
        /// <returns>False if the user cancelled the save, true otherwise.</returns>
        public bool Save()
        {
            if (decompilerSvc.Decompiler == null)
                return true;
            if (string.IsNullOrEmpty(this.ProjectFileName))
            {
                string newName = PromptForFilename(
                    Path.ChangeExtension(
                        decompilerSvc.Decompiler.Project.Programs[0].Filename,
                        Project_v3.FileExtension));
                if (newName == null)
                    return false;
                ProjectFileName = newName;
                mru.Use(newName);
            }

            var fsSvc = Services.RequireService<IFileSystemService>();
            using (var xw = fsSvc.CreateXmlWriter(ProjectFileName))
            {
                var saver = new ProjectSaver(sc);
                var sProject = saver.Serialize(ProjectFileName, decompilerSvc.Decompiler.Project);
                saver.Save(sProject, xw);
            }
            return true;
        }