Esempio n. 1
0
        public bool Equals(PrefixHandle prefix2)
        {
            if (ReferenceEquals(prefix2, null))
            {
                return(false);
            }
            PrefixHandleType type1 = _type;
            PrefixHandleType type2 = prefix2._type;

            if (type1 != type2)
            {
                return(false);
            }
            if (type1 != PrefixHandleType.Buffer)
            {
                return(true);
            }
            if (_bufferReader == prefix2._bufferReader)
            {
                return(_bufferReader.Equals2(_offset, _length, prefix2._offset, prefix2._length));
            }
            else
            {
                return(_bufferReader.Equals2(_offset, _length, prefix2._bufferReader, prefix2._offset, prefix2._length));
            }
        }
Esempio n. 2
0
        private bool Equals2(int offset2, int length2, XmlBufferReader bufferReader2)
        {
            StringHandleType type = _type;

            if (type == StringHandleType.Dictionary)
            {
                return(bufferReader2.Equals2(offset2, length2, _bufferReader.GetDictionaryString(_key).Value));
            }
            if (type == StringHandleType.UTF8)
            {
                return(_bufferReader.Equals2(_offset, _length, bufferReader2, offset2, length2));
            }
            DiagnosticUtility.DebugAssert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString, "");
            return(GetString() == _bufferReader.GetString(offset2, length2));
        }