/// <summary> /// Constructor. /// </summary> /// <remarks> /// Note that we are re-using the token reader, so we'll swap out the XamlParser that /// the token reader uses with ourself. Then restore it when we're done parsing. /// </remarks> internal TemplateXamlParser( XamlTreeBuilder treeBuilder, XamlReaderHelper tokenReader, ParserContext parserContext) : this(tokenReader, parserContext) { _treeBuilder = treeBuilder; }
/// <summary> /// Convert from Xaml read by a token reader into baml being written /// out by a record writer. The context gives mapping information. /// </summary> #if !PBTCOMPILER //CASRemoval:[StrongNameIdentityPermission(SecurityAction.InheritanceDemand, PublicKey = Microsoft.Internal.BuildInfo.WCP_PUBLIC_KEY_STRING)] #endif internal virtual void ConvertXamlToBaml ( XamlReaderHelper tokenReader, ParserContext context, XamlNode xamlNode, BamlRecordWriter bamlWriter) { throw new InvalidOperationException(SR.Get(SRID.InvalidDeSerialize)); }
/// <summary> /// Convert from Xaml read by a token reader into baml being written /// out by a record writer. The context gives mapping information. /// </summary> #if !PBTCOMPILER //CASRemoval:[StrongNameIdentityPermission(SecurityAction.InheritanceDemand, PublicKey = Microsoft.Internal.BuildInfo.WCP_PUBLIC_KEY_STRING)] #endif internal virtual void ConvertXamlToBaml( XamlReaderHelper tokenReader, ParserContext context, XamlNode xamlNode, BamlRecordWriter bamlWriter) { throw new InvalidOperationException(SR.Get(SRID.InvalidDeSerialize)); }
/// <summary> /// Convert from Xaml read by a token reader into a live /// object tree. The context gives mapping information. /// </summary> //CASRemoval:[StrongNameIdentityPermission(SecurityAction.InheritanceDemand, PublicKey = Microsoft.Internal.BuildInfo.WCP_PUBLIC_KEY_STRING)] internal virtual void ConvertXamlToObject( XamlReaderHelper tokenReader, ReadWriteStreamManager streamManager, ParserContext context, XamlNode xamlNode, BamlRecordReader reader) { throw new InvalidOperationException(SR.Get(SRID.InvalidDeSerialize)); }
/// <summary> /// Convert from Xaml read by a token reader into a live /// object tree. The context gives mapping information. /// </summary> //CASRemoval:[StrongNameIdentityPermission(SecurityAction.InheritanceDemand, PublicKey = Microsoft.Internal.BuildInfo.WCP_PUBLIC_KEY_STRING)] internal virtual void ConvertXamlToObject ( XamlReaderHelper tokenReader, ReadWriteStreamManager streamManager, ParserContext context, XamlNode xamlNode, BamlRecordReader reader) { throw new InvalidOperationException(SR.Get(SRID.InvalidDeSerialize)); }
/// <summary> /// Constructor. /// </summary> /// <remarks> /// Note that we are re-using the token reader, so we'll swap out the XamlParser that /// the token reader uses with ourself. Then restore it when we're done parsing. /// </remarks> internal TemplateXamlParser( XamlReaderHelper tokenReader, ParserContext parserContext) { TokenReader = tokenReader; ParserContext = parserContext; _previousXamlParser = TokenReader.ControllingXamlParser; TokenReader.ControllingXamlParser = this; _startingDepth = TokenReader.XmlReader.Depth; }
/// <summary> /// Convert from Xaml read by a token reader into baml being written /// out by a record writer. The context gives mapping information. /// </summary> internal override void ConvertXamlToBaml ( XamlReaderHelper tokenReader, ParserContext context, XamlNode xamlNode, BamlRecordWriter bamlWriter) { TemplateXamlParser templateParser = new TemplateXamlParser(tokenReader, context); templateParser.ParserHooks = _parserHooks; templateParser.BamlRecordWriter = bamlWriter; // Process the xamlNode that is passed in so that the <Template> element is written to baml templateParser.WriteElementStart((XamlElementStartNode)xamlNode); // Parse the entire Template section now, writing everything out directly to BAML. templateParser.Parse(); }
/// <summary> /// Convert from Xaml read by a token reader into baml being written /// out by a record writer. The context gives mapping information. /// </summary> internal override void ConvertXamlToBaml( XamlReaderHelper tokenReader, ParserContext context, XamlNode xamlNode, BamlRecordWriter bamlWriter) { TemplateXamlParser templateParser = new TemplateXamlParser(tokenReader, context); templateParser.ParserHooks = _parserHooks; templateParser.BamlRecordWriter = bamlWriter; // Process the xamlNode that is passed in so that the <Template> element is written to baml templateParser.WriteElementStart((XamlElementStartNode)xamlNode); // Parse the entire Template section now, writing everything out directly to BAML. templateParser.Parse(); }
protected XamlParser( ParserContext parserContext, BamlRecordWriter bamlWriter, XmlTextReader textReader) : this(parserContext, bamlWriter) { // When the XML 1.0 specification was authored, security was not a top concern, and as a result DTDs have the // unfortunate capability of severe Denial of Service (DoS) attacks, typically through the use of an internal // entity expansion technique. In System.Xml V2.0, in order to provide protection against DTD DoS attacks there // is the capability of turning off DTD parsing through the use of the ProhibitDtd property. textReader.ProhibitDtd = true; XmlCompatibilityReader xcr = new XmlCompatibilityReader(textReader, new IsXmlNamespaceSupportedCallback(IsXmlNamespaceSupported), _predefinedNamespaces ); TokenReader = new XamlReaderHelper(this,parserContext,xcr); }