Esempio n. 1
0
 /// <summary>
 /// Attempts to retrieve an extension element based on the xml namespace provided. Returns true if one was found.
 /// </summary>
 /// <param name="xmlnamesace"></param>
 /// <param name="found"></param>
 /// <returns></returns>
 public bool TryGetMapping(string xmlnamesace, out SchemaMappingElement found)
 {
     if (this.Count == 0)
     {
         found = null;
         return(false);
     }
     else
     {
         found = this.BaseGet(xmlnamesace) as SchemaMappingElement;
         return(null != found);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Adds a new extension to this collection (removing any existing entry first).
        /// </summary>
        /// <param name="xmlNamespace"></param>
        /// <param name="runtimeNamespace"></param>
        /// <param name="runtimeAssembly"></param>
        protected virtual void AddMapping(string xmlNamespace, string runtimeNamespace, string runtimeAssembly)
        {
            ConfigurationElement alreadyThere = this.BaseGet(xmlNamespace);

            if (null != alreadyThere)
            {
                this.BaseRemove(xmlNamespace);
            }

            SchemaMappingElement ele = new SchemaMappingElement();

            ele.XmlNamespace     = xmlNamespace;
            ele.RuntimeNamespace = runtimeNamespace;
            ele.RuntimeAssembly  = runtimeAssembly;
            this.BaseAdd(ele);
        }