System.Configuration.HandlerBase.CheckForChildNodes C# (CSharp) Метод

CheckForChildNodes() статический приватный Метод

static private CheckForChildNodes ( XmlNode node ) : void
node System.Xml.XmlNode
Результат void
        internal static void CheckForChildNodes(XmlNode node) {
            if (node.HasChildNodes) {
                throw new ConfigurationErrorsException(
                                SR.GetString(SR.Config_base_no_child_nodes),
                                node.FirstChild);                
            }
        }

Usage Example

Пример #1
0
        /**
         * Create
         *
         * Given a partially composed config object (possibly null)
         * and some input from the config system, return a
         * further partially composed config object
         */
        public virtual object Create(object parent, object context, XmlNode section)
        {
            Hashtable result;

            // start result off as a shallow clone of the parent

            if (parent == null)
            {
                result = new Hashtable();
            }
            else
            {
                result = new Hashtable((IDictionary)parent);
            }

            // verify that there are no children

            HandlerBase.CheckForChildNodes(section);

            // iterate through each XML section in order and apply the directives

            foreach (XmlAttribute attribute in section.Attributes)
            {
                // handle name-value pairs
                result[attribute.Name] = attribute.Value;
            }

            return(result);
        }
All Usage Examples Of System.Configuration.HandlerBase::CheckForChildNodes