System.Security.Util.TokenizerStream.Reset C# (CSharp) Method

Reset() private method

private Reset ( ) : void
return void
        internal void Reset()
        {
            m_lastTokens = null;
            m_currentTokens = m_headTokens;
            m_currentStrings = m_headStrings;
            m_indexTokens = 0;
            m_indexStrings = 0;
#if _DEBUG
            m_bLastWasCStr = false;
#endif
        }

Usage Example

Beispiel #1
0
        private void ParseContents()
        {
            TokenizerStream stream = new TokenizerStream();

            this._t.GetTokens(stream, 2, false);
            stream.Reset();
            int format = this.DetermineFormat(stream);

            stream.GoToPosition(format);
            this._t.GetTokens(stream, -1, false);
            stream.Reset();
            int index = 0;

            this.GetRequiredSizes(stream, ref index);
            this._doc = new SecurityDocument(index);
            int position = 0;

            stream.Reset();
            for (short nextFullToken = stream.GetNextFullToken(); (int)nextFullToken != -1; nextFullToken = stream.GetNextFullToken())
            {
                if (((int)nextFullToken & 16384) == 16384)
                {
                    switch ((short)((int)nextFullToken & 65280))
                    {
                    case 17408:
                        this._doc.AddToken((byte)4, ref position);
                        continue;

                    case 20480:
                        stream.ThrowAwayNextString();
                        continue;

                    case 25344:
                        this._doc.AppendString(" ", ref position);
                        this._doc.AppendString(stream.GetNextString(), ref position);
                        continue;

                    case 16640:
                        this._doc.AddToken((byte)1, ref position);
                        this._doc.AddString(stream.GetNextString(), ref position);
                        continue;

                    case 16896:
                        this._doc.AddToken((byte)2, ref position);
                        this._doc.AddString(stream.GetNextString(), ref position);
                        this._doc.AddString(stream.GetNextString(), ref position);
                        continue;

                    case 17152:
                        this._doc.AddToken((byte)3, ref position);
                        this._doc.AddString(stream.GetNextString(), ref position);
                        continue;

                    default:
                        throw new XmlSyntaxException();
                    }
                }
            }
        }
All Usage Examples Of System.Security.Util.TokenizerStream::Reset