public void Create(Version version) { this._dependencyProducts = new DependencyProducts(); this._version = version; this._created = true; this.Save(); }
public static DependencyProducts Load(XmlElement xmlElement) { DependencyProducts dependencyProducts = new DependencyProducts(); foreach (XmlElement child in xmlElement.ChildNodes) { if (child.Name.Equals("DependencyProduct")) { dependencyProducts.Add(DependencyProduct.Load(child)); } } return(dependencyProducts); }
public static BetaData 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("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; foreach (XmlElement child in documentElement.ChildNodes) { if (child.Name.Equals("DependencyProducts")) { beta.DependencyProducts = DependencyProducts.Load(child); } } return(beta); }
private Dictionary <DependencyProduct, string> CreateBeta(string path, out string message) { List <string> folders = new List <string>(); Dictionary <DependencyProduct, string> betaNames = new Dictionary <DependencyProduct, string>(); string name = this.BetaData.Name; string betaName = string.Empty; string folder = string.Empty; string destinationFolder = string.Empty; DependencyProducts dependencyProducts = this.BetaData.DependencyProducts; foreach (DependencyProduct dependencyproduct in dependencyProducts) { betaName = SVNManager.Instance.CreateBeta(dependencyproduct.Name, dependencyproduct.Version); if (string.IsNullOrEmpty(betaName)) { message = string.Format("{0} - {1}", TranslationManager.GetManager().Translate("Failed to create beta."), betaName); return(betaNames); } betaNames.Add(dependencyproduct, betaName); folder = SVNManager.Instance.DownloadRelease(dependencyproduct.Name, betaName); if (string.IsNullOrEmpty(folder)) { message = TranslationManager.GetManager().Translate("Failed to download the release"); return(betaNames); } folders.Add(string.Format(@"{0}\{1}\{2}\Promob5", folder, dependencyproduct.Name, betaName)); } foreach (string source in folders) { try { if (string.IsNullOrEmpty(name)) { name = TranslationManager.GetManager().Translate("Custom"); } destinationFolder = string.Format(@"{0}\{1}", path, name); if (!System.IO.Directory.Exists(destinationFolder)) { System.IO.Directory.CreateDirectory(destinationFolder); } Promob.Builder.IO.IOHelper.MoveDirectoryContent(source, destinationFolder); } catch (IOException ex) { message = TranslationManager.GetManager().Translate("Failed to move temporary files", ex.Message, ex.StackTrace); return(betaNames); } } message = string.Empty; return(betaNames); }