/// <summary> /// Loads the instance configuration from the XML node. /// </summary> public void LoadFromXml(XmlNode xmlNode) { if (xmlNode == null) { throw new ArgumentNullException("xmlNode"); } Name = xmlNode.GetChildAsString("Name"); if (xmlNode.SelectSingleNode("ServerApp") is XmlElement serverAppElem) { ServerApp.LoadFromXml(serverAppElem); } if (xmlNode.SelectSingleNode("CommApp") is XmlElement commAppElem) { CommApp.LoadFromXml(commAppElem); } if (xmlNode.SelectSingleNode("WebApp") is XmlElement webAppElem) { WebApp.LoadFromXml(webAppElem); } DeploymentProfile = xmlNode.GetChildAsString("DeploymentProfile"); }
/// <summary> /// Initializes a new instance of the class. /// </summary> public Instance() { Name = ""; ServerApp = new ServerApp(); CommApp = new CommApp(); WebApp = new WebApp(); DeploymentProfile = ""; InstanceDir = ""; AppSettingsLoaded = false; }
private string instanceDir; // the instance directory inside the project /// <summary> /// Initializes a new instance of the class. /// </summary> public ProjectInstance() { ID = 0; Name = ""; ServerApp = new ServerApp(); CommApp = new CommApp(); WebApp = new WebApp(); AllApps = new ProjectApp[] { ServerApp, CommApp, WebApp }; DeploymentProfile = ""; InstanceDir = ""; }
/// <summary> /// Saves the instance configuration into the XML node. /// </summary> public void SaveToXml(XmlElement xmlElem) { if (xmlElem == null) { throw new ArgumentNullException("xmlElem"); } xmlElem.AppendElem("Name", Name); ServerApp.SaveToXml(xmlElem.AppendElem("ServerApp")); CommApp.SaveToXml(xmlElem.AppendElem("CommApp")); WebApp.SaveToXml(xmlElem.AppendElem("WebApp")); xmlElem.AppendElem("DeploymentProfile", DeploymentProfile); }
/// <summary> /// Loads the application settings if needed. /// </summary> public bool LoadAppSettings(out string errMsg) { if (AppSettingsLoaded) { errMsg = ""; return(true); } else if ((!ServerApp.Enabled || ServerApp.LoadSettings(out errMsg)) && (!CommApp.Enabled || CommApp.LoadSettings(out errMsg))) { AppSettingsLoaded = true; errMsg = ""; return(true); } else { return(false); } }