System.CodeDom.Compiler.HandlerBase.CheckForUnrecognizedAttributes C# (CSharp) Method

CheckForUnrecognizedAttributes() static private method

static private CheckForUnrecognizedAttributes ( XmlNode node ) : void
node System.Xml.XmlNode
return void
        internal static void CheckForUnrecognizedAttributes(XmlNode node) {
            if (node.Attributes.Count != 0) {
                throw new ConfigurationErrorsException(
                                SR.GetString(SR.Config_base_unrecognized_attribute, node.Attributes[0].Name),
                                node.Attributes[0]);
            }
        }

Usage Example

            internal static object CreateStatic(object inheritedObject, XmlNode node)
            {
                CodeDomCompilationConfiguration inherited = (CodeDomCompilationConfiguration)inheritedObject;
                CodeDomCompilationConfiguration result;

                if (inherited == null)
                {
                    result = new CodeDomCompilationConfiguration();
                }
                else
                {
                    result = new CodeDomCompilationConfiguration(inherited);
                }

                HandlerBase.CheckForUnrecognizedAttributes(node);

                //
                // Handle child elements (if they exist)
                //   - compilers
                //
                foreach (XmlNode child in node.ChildNodes)
                {
                    // skip whitespace and comments
                    // reject nonelements
                    if (HandlerBase.IsIgnorableAlsoCheckForNonElement(child))
                    {
                        continue;
                    }

                    // handle <compilers>
                    if (child.Name == "compilers")
                    {
                        ProcessCompilersElement(result, child);
                    }
                    else
                    {
                        HandlerBase.ThrowUnrecognizedElement(child);
                    }
                }

                return(result);
            }
All Usage Examples Of System.CodeDom.Compiler.HandlerBase::CheckForUnrecognizedAttributes