コード例 #1
0
        private void ConvertProject(string fileNameAndFilePath, esSettings settings)
        {
            esProject2010 project2010 = new esProject2010();

            project2010.Load(fileNameAndFilePath, settings);

            ConvertProjectNodeSettings(project2010.RootNode);

            esProject project = new esProject();

            // Manually copy root node of tree into new project
            project.RootNode          = new esProjectNode();
            project.RootNode.Name     = project2010.RootNode.Name;
            project.RootNode.IsFolder = project2010.RootNode.IsFolder;
            project.RootNode.Children = project2010.RootNode.Children;
            project.RootNode.Settings = project2010.RootNode.Settings;

            FileInfo fileInfo = new FileInfo(fileNameAndFilePath);

            string backup = fileInfo.Name.Replace(fileInfo.Extension, "");

            backup += "_original" + fileInfo.Extension;
            backup  = fileInfo.DirectoryName + "\\" + backup;

            File.Copy(fileNameAndFilePath, backup, true);

            // Now Save it in our new format
            project.Save(fileNameAndFilePath, settings);
        }
コード例 #2
0
        private void ConvertProject(string fileNameAndFilePath, esSettings settings)
        {
            esProject2010 project2010 = new esProject2010();
            project2010.Load(fileNameAndFilePath, settings);

            ConvertProjectNodeSettings(project2010.RootNode);

            esProject project = new esProject();

            // Manually copy root node of tree into new project
            project.RootNode = new esProjectNode();
            project.RootNode.Name = project2010.RootNode.Name;
            project.RootNode.IsFolder = project2010.RootNode.IsFolder;
            project.RootNode.Children = project2010.RootNode.Children;
            project.RootNode.Settings = project2010.RootNode.Settings;

            FileInfo fileInfo = new FileInfo(fileNameAndFilePath);

            string backup = fileInfo.Name.Replace(fileInfo.Extension, "");
            backup += "_original" + fileInfo.Extension;
            backup = fileInfo.DirectoryName + "\\" + backup;

            File.Copy(fileNameAndFilePath, backup, true);

            // Now Save it in our new format
            project.Save(fileNameAndFilePath, settings);
        }