System.Xml.DtdParser.ParseNotationDecl C# (CSharp) Méthode

ParseNotationDecl() private méthode

private ParseNotationDecl ( ) : void
Résultat void
        private void ParseNotationDecl()
        {
            // notation name
            if (GetToken(true) != Token.Name)
            {
                OnUnexpectedError();
            }

            XmlQualifiedName notationName = GetNameQualified(false);
#if !SILVERLIGHT
            SchemaNotation notation = null;
            if (!_schemaInfo.Notations.ContainsKey(notationName.Name))
            {
                if (_undeclaredNotations != null)
                {
                    _undeclaredNotations.Remove(notationName.Name);
                }
                notation = new SchemaNotation(notationName);
                _schemaInfo.Notations.Add(notation.Name.Name, notation);
            }
            else
            {
                // duplicate notation
                if (_validate)
                {
                    SendValidationEvent(_curPos - notationName.Name.Length, XmlSeverityType.Error, SR.Sch_DupNotation, notationName.Name);
                }
            }
#endif

            // public / system id
            Token token = GetToken(true);
            if (token == Token.SYSTEM || token == Token.PUBLIC)
            {
                string notationPublicId, notationSystemId;

                ParseExternalId(token, Token.NOTATION, out notationPublicId, out notationSystemId);

#if !SILVERLIGHT
                if (notation != null)
                {
                    notation.SystemLiteral = notationSystemId;
                    notation.Pubid = notationPublicId;
                }
#endif
            }
            else
            {
                OnUnexpectedError();
            }

            if (GetToken(false) != Token.GreaterThan)
                OnUnexpectedError();
        }