Beispiel #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public static IXamlNode Parse(TextReader reader)
        {
            if (null == reader)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            using (var tokenizer = new XamlTokenizer(reader))
            {
                var context = new XamlParsingContext();
//                var root = new XamlRootNode();
//                var stack = new Stack<XamlNode>();

//                stack.Push(root);

                try
                {
                    var parser = new XamlParser(tokenizer);

                    parser.Parse(context);
                    context.ValidateDocument(new XamlDocumentValidator());
                }
                catch (Exception exception)
                {
//                    var position = tokenizer.GetSourcePosition();
                    throw new XamlParsingException();
                }

                return context.DocumentRoot;
            }
        }
Beispiel #2
0
        private void Parse(XamlParsingContext context)
        {
            string prefix = null;
            string name = null;

            var state = ParserState.Begin;
            var on = true;

            while (on)
            {
                switch (state)
                {
                    case ParserState.Begin:
                        break;
                }
            }
        }