private bool LoadBeta() { string url = string.Format("{0}/{1}/{2}/beta.data", SVNManager.VERSIONS_URL, this.Product.Name, this.VersionNumber); string path = string.Empty; if (SVNManager.Instance.Exists(url)) { path = SVNManager.Instance.Download(url); if (System.IO.File.Exists(path)) { this._betaData = BetaData.Load(path); System.IO.File.Delete(path); this._betaData.Path = string.Empty; this._betaData.Url = string.Empty; this._betaData.Version = this; return(true); } } else { this.BetaData.Create(this); return(true); } return(false); }
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); }