/// <summary>
        /// Constructor. Internal so only the XamlParser and select
        /// Avalon object parsers can call it.
        /// </summary>
        internal XamlReaderHelper(
            XamlParser xamlParser,
            ParserContext parserContext,
            XmlReader xmlReader)
        {

            Debug.Assert(xamlParser != null, "Cannot have null xaml parser");
            Debug.Assert(parserContext != null, "Cannot have null parser context");
            Debug.Assert(xmlReader != null, "Cannot have null xmlReader");

            // use the parser class for making resolution callbacks. for GetElementBaseType
            // probably should break that call + the XamlTypeMapper calls into an interface to
            // comletely abstract the resolution from the tokenizer.
            _xamlParser = xamlParser;
            _parserContext = parserContext;

            XmlReader = xmlReader;
            Normalization = true;

            _xamlNodeCollectionProcessor = new XamlNodeCollectionProcessor();

            // setup the _textFlow stack
            _textFlowStack = new Stack();

            // push a rootLevel stack
            // !! Todo. Need a way for caller of the parser to set how
            // the root text should be handled. For now always use InlineBlock.
            TextFlowStackData textFlowStackData = new TextFlowStackData();
            textFlowStackData.StripLeadingSpaces = true;

            TextFlowStack.Push(textFlowStackData);

            _extensionParser = new MarkupExtensionParser((IParserHelper)this, parserContext);

#if UseValidatingReader
            // turn on to setup validating Reader.
            XmlValidatingReader xmlValidatingReader = new XmlValidatingReader(xmlReader);
            xmlValidatingReader.ValidationType = ValidationType.None;
            XmlReader = xmlValidatingReader;

#endif // UseValidatingReader

        }
예제 #2
0
 public SL4MarkupExpressionParser(object target, string attribute_name, XamlParser parser, XamlObjectElement target_element)
     : base(target, attribute_name)
 {
     this.parser = parser;
     this.target_element = target_element;
 }
        // Token: 0x0600232C RID: 9004 RVA: 0x000ACC00 File Offset: 0x000AAE00
        internal static void ThrowException(string id, int lineNumber, int linePosition)
        {
            string message = SR.Get(id);

            XamlParser.ThrowExceptionWithLine(message, lineNumber, linePosition);
        }