예제 #1
0
 public void Save(ISettingsStore settings)
 {
     settings.Set(Constants.Settings.Version, CurrentVersion);
     settings.Set(Constants.Settings.Include.Folders, string.Join("|", IncludedFolders.Select(p => p.FullPath)));
     settings.Set(Constants.Settings.Include.Extensions, string.Join("|", IncludedExtensions));
     settings.Set(Constants.Settings.Exclude.Folders, string.Join("|", ExcludedFolders.Select(p => p.FullPath)));
     settings.Set(Constants.Settings.Exclude.Patterns, string.Join("|", ExcludedPatterns));
 }
예제 #2
0
        public override void ReadProject(string filepath)
        {
            ProjFilepath = filepath;
            var proj = new XmlDocument();

            proj.Load(filepath);

            var node = proj.SelectSingleNode("//Project");

            this.ToolVer = node.Attributes["ToolVer"].Value;
            this.GameVer = node.Attributes["GameVer"].Value;

            if (node.Attributes["Platform"].Value == "WiiU")
            {
                this.Platform = ProjPlatform.WiiU;
            }
            else if (node.Attributes["Platform"].Value == "3DS")
            {
                this.Platform = ProjPlatform.ThreeDS;
            }

            var nodes = proj.SelectNodes("//Project/FileGroup");

            foreach (XmlNode n in nodes)
            {
                foreach (XmlNode child in n.ChildNodes)
                {
                    var item = new ProjectItem();
                    item.RelativePath = Runtime.CanonicalizePath(child.Attributes["Include"].Value);
                    item.RealPath     = Runtime.CanonicalizePath(Path.Combine(ProjDirectory, item.RelativePath));
                    if (child.HasChildNodes)
                    {
                        foreach (XmlNode child2 in child.ChildNodes)
                        {
                            if (child2.LocalName == "DependsUpon")
                            {
                                var path = Runtime.CanonicalizePath(Path.Combine(Path.GetDirectoryName(item.RelativePath), child2.InnerText));
                                item.Depends.Add(IncludedFiles.Find(x => x.RelativePath == path));
                            }
                        }
                    }
                    if (child.Name == "Folder")
                    {
                        IncludedFolders.Add(item);
                    }
                    else
                    {
                        IncludedFiles.Add(item);
                    }
                }
            }
            ProjFile = proj;
        }