Пример #1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public HttpHandlerDataCollection()
        {
            // Get the current host element.
            HttpHandlerDataExtensionElement host =
                (HttpHandlerDataExtensionElement)CreateNewElement();

            // Add the element to the collection.
            Add(host);
        }
Пример #2
0
        /// <summary>
        /// Gets sets, the http handler state elements.
        /// </summary>
        /// <param name="section">The config section group and section name.</param>
        /// <returns>The http handler collection; else null.</returns>
        public static HttpHandlerDataExtensionElement[] HttpHandlerExtensionElements(string section = "HttpHandlerExtensionGroup/HttpHandlerDataExtensions")
        {
            // Refreshes the named section so the next time that it is retrieved it will be re-read from disk.
            System.Configuration.ConfigurationManager.RefreshSection(section);

            // Get the default element
            // configuration information
            // from the configuration manager.
            HttpHandlerDataExtensions baseHandler =
                (HttpHandlerDataExtensions)System.Configuration.ConfigurationManager.GetSection(section);

            // Return the collection.
            HttpHandlerDataExtensionElement[] items = new HttpHandlerDataExtensionElement[baseHandler.HostSection.Count];
            baseHandler.HostSection.CopyTo(items, 0);
            return(items.Where(q => (q.Name != "default")).ToArray());
        }
Пример #3
0
 /// <summary>
 /// Add a new host element type to the collection.
 /// </summary>
 /// <param name="element">The current host element.</param>
 public void Add(HttpHandlerDataExtensionElement element)
 {
     // Add the element to the base
     // ConfigurationElementCollection type.
     BaseAdd(element);
 }