Ejemplo n.º 1
0
        public XamlTypeName ParseName(string text, out string error)
        {
            error      = string.Empty;
            _scanner   = new GenericTypeNameScanner(text);
            _inputText = text;

            StartStack();

            try
            {
                _scanner.Read();
                P_XamlTypeName();
                if (_scanner.Token != GenericTypeNameScannerToken.NONE)
                {
                    ThrowOnBadInput();
                }
            }
            catch (TypeNameParserException ex)
            {
                error = ex.Message;
            }

            XamlTypeName typeName = null;

            if (String.IsNullOrEmpty(error))
            {
                typeName = CollectNameFromStack();
            }
            return(typeName);
        }
        public XamlTypeName ParseName(string text, out string error)
        {
            error           = string.Empty;
            this._scanner   = new GenericTypeNameScanner(text);
            this._inputText = text;
            this.StartStack();
            try
            {
                this._scanner.Read();
                this.P_XamlTypeName();
                if (this._scanner.Token != GenericTypeNameScannerToken.NONE)
                {
                    this.ThrowOnBadInput();
                }
            }
            catch (TypeNameParserException exception)
            {
                error = exception.Message;
            }
            XamlTypeName name = null;

            if (string.IsNullOrEmpty(error))
            {
                name = this.CollectNameFromStack();
            }
            return(name);
        }