예제 #1
0
        private void ProjectSettingsModify(ProjectSettingsViewModel obj)
        {
            XmlDocument doc  = new XmlDocument();
            var         path = App.LocalRPAStudioDir + @"\Config\RecentProjects.xml";

            doc.Load(path);
            var rootNode = doc.DocumentElement;

            var projectNodes = rootNode.SelectNodes("Project");

            foreach (XmlElement dir in projectNodes)
            {
                var filePath    = dir.GetAttribute("FilePath");
                var name        = dir.GetAttribute("Name");
                var description = dir.GetAttribute("Description");

                if (obj.CurrentProjectJsonFile == filePath)
                {
                    if (obj.ProjectName != name || obj.ProjectDescription != description)
                    {
                        dir.SetAttribute("Name", obj.ProjectName);
                        dir.SetAttribute("Description", obj.ProjectDescription);

                        doc.Save(path);

                        InitRecentProjects();
                        break;
                    }
                }
            }
        }
예제 #2
0
        private void ProjectSettingsModify(ProjectSettingsViewModel vm)
        {
            ProjectName        = vm.ProjectName;
            ProjectDescription = vm.ProjectDescription;

            RootProjectTreeItem.Name = ProjectName;
        }