Beispiel #1
0
        /// <summary>
        /// Gets, the Base type handler collection elements.
        /// </summary>
        /// <param name="section">The config section group and section name.</param>
        /// <returns>The base type handler; else null.</returns>
        public static BaseTypeHandlerCollection BaseTypeHandlerCollection(string section = "NequeoHandlerGroup/BaseTypeHandlerDefaultSection")
        {
            try
            {
                // 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.
                BaseTypeHandlerDefaultSection baseHandler =
                    (BaseTypeHandlerDefaultSection)System.Configuration.ConfigurationManager.GetSection(section);

                // Return the element.
                return(baseHandler.HostSection);
            }
            catch { }
            {
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Gets sets, the Base type handler elements.
        /// </summary>
        /// <param name="section">The config section group and section name.</param>
        /// <returns>The base type handler; else null.</returns>
        public static BaseTypeHandlerElement[] BaseTypeHandlerElements(string section = "NequeoHandlerGroup/BaseTypeHandlerDefaultSection")
        {
            try
            {
                // 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.
                BaseTypeHandlerDefaultSection baseHandler =
                    (BaseTypeHandlerDefaultSection)System.Configuration.ConfigurationManager.GetSection(section);

                // Return the collection.
                BaseTypeHandlerElement[] items = new BaseTypeHandlerElement[baseHandler.HostSection.Count];
                baseHandler.HostSection.CopyTo(items, 0);
                return(items.Where(q => (q.Name != "default")).ToArray());
            }
            catch { }
            {
                return(null);
            }
        }