System.Xml.XmlBufferReader.ReadDictionaryKey C# (CSharp) Méthode

ReadDictionaryKey() public méthode

public ReadDictionaryKey ( ) : int
Résultat int
        public int ReadDictionaryKey()
        {
            int key = ReadMultiByteUInt31();
            if ((key & 1) != 0)
            {
                if (_session == null)
                    XmlExceptionHelper.ThrowInvalidBinaryFormat(_reader);
                int sessionKey = (key >> 1);
                XmlDictionaryString xmlString;
                if (!_session.TryLookup(sessionKey, out xmlString))
                {
                    if (sessionKey < XmlDictionaryString.MinKey || sessionKey > XmlDictionaryString.MaxKey)
                        XmlExceptionHelper.ThrowXmlDictionaryStringIDOutOfRange(_reader);
                    XmlExceptionHelper.ThrowXmlDictionaryStringIDUndefinedSession(_reader, sessionKey);
                }
            }
            else
            {
                if (_dictionary == null)
                    XmlExceptionHelper.ThrowInvalidBinaryFormat(_reader);
                int staticKey = (key >> 1);
                XmlDictionaryString xmlString;
                if (!_dictionary.TryLookup(staticKey, out xmlString))
                {
                    if (staticKey < XmlDictionaryString.MinKey || staticKey > XmlDictionaryString.MaxKey)
                        XmlExceptionHelper.ThrowXmlDictionaryStringIDOutOfRange(_reader);
                    XmlExceptionHelper.ThrowXmlDictionaryStringIDUndefinedStatic(_reader, staticKey);
                }
            }
            return key;
        }