System.Configuration.ConfigurationElement.IsLockAttributeName C# (CSharp) Метод

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

static private IsLockAttributeName ( string name ) : bool
name string
Результат bool
        internal static bool IsLockAttributeName(string name) {
            // optimize for common case that attribute name does not start with "lock"
            if (!StringUtil.StartsWith(name, "lock")) {
                return false;
            }

            foreach (string lockAttributeName in s_lockAttributeNames) {
                if (name == lockAttributeName) {
                    return true;
                }
            }

            return false;
        }
    }

Usage Example

Пример #1
0
            private static void CheckForLockAttributes(string sectionName, XmlNode xmlNode)
            {
                XmlAttributeCollection attributes = xmlNode.Attributes;

                if (attributes != null)
                {
                    foreach (XmlAttribute attribute in attributes)
                    {
                        if (ConfigurationElement.IsLockAttributeName(attribute.Name))
                        {
                            throw new ConfigurationErrorsException(System.Configuration.SR.GetString("Config_element_locking_not_supported", new object[] { sectionName }), attribute);
                        }
                    }
                }
                foreach (XmlNode node in xmlNode.ChildNodes)
                {
                    if (xmlNode.NodeType == XmlNodeType.Element)
                    {
                        CheckForLockAttributes(sectionName, node);
                    }
                }
            }
All Usage Examples Of System.Configuration.ConfigurationElement::IsLockAttributeName