System.Xml.Schema.XmlSchemaValidator.GetExpectedAttributes C# (CSharp) 메소드

GetExpectedAttributes() 공개 메소드

public GetExpectedAttributes ( ) : System.Xml.Schema.XmlSchemaAttribute[]
리턴 System.Xml.Schema.XmlSchemaAttribute[]
        public XmlSchemaAttribute[] GetExpectedAttributes()
        {
            if (_currentState == ValidatorState.Element || _currentState == ValidatorState.Attribute)
            {
                SchemaElementDecl elementDecl = _context.ElementDecl;
                ArrayList attList = new ArrayList();
                if (elementDecl != null)
                {
                    foreach (SchemaAttDef attDef in elementDecl.AttDefs.Values)
                    {
                        if (_attPresence[attDef.Name] == null)
                        {
                            attList.Add(attDef.SchemaAttribute);
                        }
                    }
                }
                if (_nsResolver.LookupPrefix(_nsXsi) != null)
                { //Xsi namespace defined
                    AddXsiAttributes(attList);
                }
                return attList.ToArray(typeof(XmlSchemaAttribute)) as XmlSchemaAttribute[];
            }
            else if (_currentState == ValidatorState.Start)
            {
                if (_partialValidationType != null)
                {
                    XmlSchemaAttribute attribute = _partialValidationType as XmlSchemaAttribute;
                    if (attribute != null)
                    {
                        return new XmlSchemaAttribute[1] { attribute };
                    }
                }
            }
            return s_emptyAttributeArray;
        }