示例#1
0
        private void GetBaseFiles(XmlDocument doc)
        {
            XmlNodeList baseNodes = doc.GetElementsByTagName("requiredInstallFiles");

            if (baseNodes.Count > 0)
            {
                BaseFiles = FomodFile.FromNodes(baseNodes[0].ChildNodes);
            }
        }
示例#2
0
        public FomodPattern(XmlNode node)
        {
            XmlNode filesNode = node["files"];

            if (filesNode != null)
            {
                Files = FomodFile.FromNodes(filesNode.ChildNodes);
            }

            XmlNode dependenciesNode = node["dependencies"];

            if (dependenciesNode != null)
            {
                Dependencies = FomodFlagDependency.FromNodes(dependenciesNode.ChildNodes);
            }
        }
示例#3
0
        public FomodPlugin(XmlNode node)
        {
            XmlAttribute nameAttribute = node.Attributes["name"];

            if (nameAttribute != null)
            {
                Name = nameAttribute.Value;
            }

            GetVisibleNode(node);
            XmlNode groupNode = node.ParentNode.ParentNode;

            if (groupNode != null)
            {
                // parse group information for determining whether or not the mod option is default
                XmlAttribute typeAttribute = groupNode.Attributes["type"];
                if (typeAttribute != null)
                {
                    GroupType = typeAttribute.Value;
                }
                SiblingCount = node.ParentNode.ChildNodes.Count - 1;

                // append group name to plugin name
                nameAttribute = groupNode.Attributes["name"];
                if (nameAttribute != null)
                {
                    Name = nameAttribute.Value + " - " + Name;
                }
            }

            XmlNode filesNode = node["files"];

            Files = (filesNode == null) ? new List <FomodFile>() : FomodFile.FromNodes(filesNode.ChildNodes);

            XmlNode flagsNode = node["conditionFlags"];

            Flags = (flagsNode == null) ? new List <FomodFlag>() : FomodFlag.FromNodes(flagsNode.ChildNodes);
        }