/// <summary> /// Creates a new configuration handler and adds it to the section handler collection. /// </summary> /// <param name="parent">The configuration settings in a corresponding parent configuration section. </param> /// <param name="configContext">The virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is a null reference </param> /// <param name="section">The XmlNode that contains the configuration information to be handled. Provides direct access to the XML contents of the configuration section. </param> /// <returns></returns> public object Create(object parent, object configContext, System.Xml.XmlNode section) { MigrationSettings settings = new MigrationSettings(); string ID; VersionSetting setting; foreach (XmlNode version in section.ChildNodes) { if (version.Name == "CurrentVersion") { ID = version.Attributes["ID"].Value.Trim(); if (ID == "") { throw new ApplicationException("CurrentVersion ID can not be empty"); } setting = new VersionSetting(ID); foreach (XmlNode step in version.ChildNodes) { if (step.Name == "Step") { setting.AddStep(step.Attributes["Description"].Value, step.Attributes["Script"].Value); } } settings.AddVersion(ID, setting); } } return(settings); }