예제 #1
0
        public static BetaData Load(Version parent, string path)
        {
            FileInfo fileinfo = new FileInfo(path);

            if (!fileinfo.Exists)
            {
                return(null);
            }

            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(path);

            if (!xmlDocument.DocumentElement.Name.Equals("BetaData"))
            {
                return(null);
            }

            XmlElement   documentElement = xmlDocument.DocumentElement;
            XmlAttribute name            = documentElement.Attributes["Name"];

            BetaData beta = new BetaData();

            beta._created = true;
            beta._name    = name.Value;
            beta._path    = path;

            if (parent != null)
            {
                beta._parent = parent;
                beta._url    = string.Format("{0}/{1}/{2}/beta.data", SVNManager.VERSIONS_URL, parent.Plugin.Name, parent.Name);
            }

            foreach (XmlElement child in documentElement.ChildNodes)
            {
                if (child.Name.Equals("DependencyProducts"))
                {
                    beta.DependencyProducts = DependencyProducts.Load(child);
                }
            }

            return(beta);
        }
예제 #2
0
        public static ProductData Load(string path)
        {
            FileInfo fileinfo = new FileInfo(path);

            if (!fileinfo.Exists)
            {
                return(null);
            }

            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(path);

            if (!xmlDocument.DocumentElement.Name.Equals("ProductData"))
            {
                return(null);
            }

            XmlElement   documentElement = xmlDocument.DocumentElement;
            XmlAttribute name            = documentElement.Attributes["Name"];

            ProductData product = new ProductData();

            product._created = true;
            product._name    = name.Value;
            product.Path     = path;

            foreach (XmlElement child in documentElement.ChildNodes)
            {
                if (child.Name.Equals("DependencyProducts"))
                {
                    product.DependencyProducts = DependencyProducts.Load(child);
                }
            }

            return(product);
        }