public void Add(HostMappingConfigurationElement hostMapping)
        {
            hostMapping.Initialize();

            HostMappingConfigurationElement element = (HostMappingConfigurationElement)base.BaseGet(hostMapping.Host);
            if (element == null)
            {
                BaseAdd(hostMapping);
            }
            else
            {
                element.Alias = hostMapping.Alias;
                int index = BaseIndexOf(element);
                BaseRemoveAt(index);
                BaseAdd(index, element);
            }
        }
Example #2
0
        /// <summary>
        /// Adds the specified host mapping.
        /// </summary>
        /// <param name="hostMapping">The host mapping.</param>
        public void Add(HostMappingConfigurationElement hostMapping)
        {
            hostMapping.Initialize();

            HostMappingConfigurationElement element = (HostMappingConfigurationElement)base.BaseGet(hostMapping.Host);

            if (element == null)
            {
                BaseAdd(hostMapping);
            }
            else
            {
                element.Alias = hostMapping.Alias;
                int index = BaseIndexOf(element);
                BaseRemoveAt(index);
                BaseAdd(index, element);
            }
        }
Example #3
0
        /// <summary>
        /// Adds the specified host name and alias pair.
        /// </summary>
        /// <param name="host">The host name.</param>
        /// <param name="alias">The alias that corresponds to this host.</param>
        public void Add(string host, string alias)
        {
            HostMappingConfigurationElement keyValue = new HostMappingConfigurationElement(host, alias);

            Add(keyValue);
        }
 /// <summary>
 /// Adds the specified host name and alias pair.
 /// </summary>
 /// <param name="host">The host name.</param>
 /// <param name="alias">The alias that corresponds to this host.</param>
 public void Add(string host, string alias)
 {
     HostMappingConfigurationElement keyValue = new HostMappingConfigurationElement(host, alias);
     Add(keyValue);
 }