Exemplo n.º 1
0
        private IEnumerable <XamlInstruction> ConvertToNodes(Stream stream)
        {
            var reader        = new XmlCompatibilityReader(stream);
            var wiringContext = WiringContext;
            var pullParser    = new XamlInstructionParser(wiringContext);
            var protoParser   = new XamlProtoInstructionParser(wiringContext);

            return(pullParser.Parse(protoParser.Parse(reader)).ToList());
        }
Exemplo n.º 2
0
        private ICollection <XamlInstruction> ExtractNodesFromPullParser(string xml)
        {
            var pullParser = new XamlInstructionParser(WiringContext);

            using (var stream = new StringReader(xml))
            {
                var reader = new XmlCompatibilityReader(stream);
                return(pullParser.Parse(new XamlProtoInstructionParser(WiringContext).Parse(reader)).ToList());
            }
        }
Exemplo n.º 3
0
        private static IEnumerable <XamlInstruction> ReadNodes(Type underlyingType)
        {
            var resourceProvider = new InflatableTranslator();

            using (var stream = resourceProvider.GetInflationSourceStream(underlyingType))
            {
                var reader        = new XmlCompatibilityReader(stream);
                var wiringContext = (IWiringContext) new WpfWiringContext(new TypeFactory());
                var loader        = new XamlInstructionParser(wiringContext);
                var protoParser   = new XamlProtoInstructionParser(wiringContext);

                return(loader.Parse(protoParser.Parse(reader)));
            }
        }
Exemplo n.º 4
0
        private static IEnumerable<XamlInstruction> ReadNodes(Type underlyingType)
        {
            var resourceProvider = new InflatableTranslator();

            using (var stream = resourceProvider.GetInflationSourceStream(underlyingType))
            {
                var reader = new XmlCompatibilityReader(stream);
                var wiringContext = (IWiringContext) new WpfWiringContext(new TypeFactory());
                var loader = new XamlInstructionParser(wiringContext);
                var protoParser = new XamlProtoInstructionParser(wiringContext);

                return loader.Parse(protoParser.Parse(reader));
            }
        }