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

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

static private RemoveAttribute ( XmlNode node, string name ) : string
node System.Xml.XmlNode
name string
Результат string
        internal static string RemoveAttribute(XmlNode node, string name) {

            XmlNode attribute = node.Attributes.RemoveNamedItem(name);

            if (attribute != null) {
                return attribute.Value;
            }

            return null;
        }

Usage Example

        public virtual object Create(object parent, object context, XmlNode section)
        {
            Hashtable hashtable;

            if (parent == null)
            {
                hashtable = new Hashtable(StringComparer.OrdinalIgnoreCase);
            }
            else
            {
                hashtable = (Hashtable)((Hashtable)parent).Clone();
            }
            HandlerBase.CheckForUnrecognizedAttributes(section);
            foreach (XmlNode node in section.ChildNodes)
            {
                if (!HandlerBase.IsIgnorableAlsoCheckForNonElement(node))
                {
                    if (node.Name == "add")
                    {
                        string str2;
                        HandlerBase.CheckForChildNodes(node);
                        string str = HandlerBase.RemoveRequiredAttribute(node, this.KeyAttributeName);
                        if (this.ValueRequired)
                        {
                            str2 = HandlerBase.RemoveRequiredAttribute(node, this.ValueAttributeName);
                        }
                        else
                        {
                            str2 = HandlerBase.RemoveAttribute(node, this.ValueAttributeName);
                        }
                        HandlerBase.CheckForUnrecognizedAttributes(node);
                        if (str2 == null)
                        {
                            str2 = "";
                        }
                        hashtable[str] = str2;
                    }
                    else if (node.Name == "remove")
                    {
                        HandlerBase.CheckForChildNodes(node);
                        string key = HandlerBase.RemoveRequiredAttribute(node, this.KeyAttributeName);
                        HandlerBase.CheckForUnrecognizedAttributes(node);
                        hashtable.Remove(key);
                    }
                    else if (node.Name.Equals("clear"))
                    {
                        HandlerBase.CheckForChildNodes(node);
                        HandlerBase.CheckForUnrecognizedAttributes(node);
                        hashtable.Clear();
                    }
                    else
                    {
                        HandlerBase.ThrowUnrecognizedElement(node);
                    }
                }
            }
            return(hashtable);
        }
All Usage Examples Of System.Configuration.HandlerBase::RemoveAttribute