BExIS.Xml.Helpers.Mapping.XmlSchemaManager.GetAttributes C# (CSharp) Метод

GetAttributes() публичный Метод

Get a list of all attributes from the xmlnode
public GetAttributes ( XmlNode node ) : List
node System.Xml.XmlNode
Результат List
        public List<XmlSchemaAttribute> GetAttributes(XmlNode node)
        {
            List<XmlSchemaAttribute> listOfAttributes = new List<XmlSchemaAttribute>();

            XmlSchemaElement element = Elements.Where(e => e.Name.Equals(node.LocalName)).FirstOrDefault();
            if (element != null)
            {
                XmlSchemaComplexType type = element.ElementSchemaType as XmlSchemaComplexType;
                if (type != null)
                {
                    // If the complex type has any attributes, get an enumerator
                    // and write each attribute name to the Debug.
                    if (type.AttributeUses.Count > 0)
                    {
                        foreach (XmlSchemaObject obj in type.AttributeUses.Values)
                        {
                            XmlSchemaAttribute attr = (XmlSchemaAttribute)obj;
                            listOfAttributes.Add(attr);

                        }
                    }
                }
            }

            return listOfAttributes;
        }