private static bool ParseQualifiedName(string text, out string prefix, out string name)
        {
            int startIndex = 0;
            int index      = text.IndexOf(':');

            prefix = string.Empty;
            name   = string.Empty;

            if (index != -1)
            {
                prefix = text.Substring(startIndex, index).Trim();
                if (prefix.Length == 0 || !XamlParseUtils.IsNameValid(prefix))
                {
                    return(false);
                }

                startIndex = index + 1;
            }

            name = (startIndex == 0) ? text : text.Substring(startIndex).Trim();
            if (name.Length == 0)
            {
                return(false);
            }

            if (!XamlParseUtils.IsNameValid_WithPlus(name))
            {
                return(false);
            }

            return(true);
        }
        private bool AdvanceOverWhitespace()
        {
            bool flag = true;

            while (!IsAtEndOfInput && XamlParseUtils.IsWhitespaceChar(CurrentChar))
            {
                flag = true;
                Advance();
            }

            return(flag);
        }
        private void State_Start()
        {
            AdvanceOverWhitespace();

            if (IsAtEndOfInput)
            {
                _token = XamlTypeNameLexerToken.NONE;
            }
            else
            {
                switch (CurrentChar)
                {
                case '(':
                    _token = XamlTypeNameLexerToken.ROUND_BRACKET_OPEN;
                    break;

                case ')':
                    _token = XamlTypeNameLexerToken.ROUND_BRACKET_CLOSE;
                    break;

                case '[':
                    _token = XamlTypeNameLexerToken.SQUARE_BRACKET_OPEN;
                    break;

                case ']':
                    _token = XamlTypeNameLexerToken.SQUARE_BRACKET_CLOSE;
                    break;

                case ',':
                    _token = XamlTypeNameLexerToken.COMMA;
                    break;

                case ':':
                    _token = XamlTypeNameLexerToken.COLON;
                    break;

                default:
                    if (XamlParseUtils.IsValidNameStartChar(CurrentChar))
                    {
                        StartMultiCharToken();
                        _state = State.INNAME;
                    }
                    else
                    {
                        _token = XamlTypeNameLexerToken.ERROR;
                    }
                    break;
                }

                _lastChar = CurrentChar;
                Advance();
            }
        }
        private void State_InName()
        {
            if ((IsAtEndOfInput || XamlParseUtils.IsWhitespaceChar(CurrentChar)) || (CurrentChar == '['))
            {
                _token = XamlTypeNameLexerToken.NAME;
                _state = State.START;
            }
            else
            {
                switch (CurrentChar)
                {
                case '(':
                    _pushedBackSymbol = XamlTypeNameLexerToken.ROUND_BRACKET_OPEN;
                    _token            = XamlTypeNameLexerToken.NAME;
                    _state            = State.START;
                    break;

                case ')':
                    _pushedBackSymbol = XamlTypeNameLexerToken.ROUND_BRACKET_CLOSE;
                    _token            = XamlTypeNameLexerToken.NAME;
                    _state            = State.START;
                    break;

                case ',':
                    _pushedBackSymbol = XamlTypeNameLexerToken.COMMA;
                    _token            = XamlTypeNameLexerToken.NAME;
                    _state            = State.START;
                    break;

                case ':':
                    _pushedBackSymbol = XamlTypeNameLexerToken.COLON;
                    _token            = XamlTypeNameLexerToken.NAME;
                    _state            = State.START;
                    break;

                default:
                    if (XamlParseUtils.IsValidQualifiedNameChar(CurrentChar))
                    {
                        AddToMultiCharToken();
                    }
                    else
                    {
                        _token = XamlTypeNameLexerToken.ERROR;
                    }
                    break;
                }

                _lastChar = CurrentChar;
                Advance();
            }
        }