public IObjectAssembler CreateAssembler(ObjectAssemblerSettings settings)
        {
            var mapping = new DeferredLoaderMapping();
            mapping.Map<DataTemplate>(template => template.Content, new DummyDeferredLoader());

            var objectAssembler = new ObjectAssembler(wiringContext, new TopDownValueContext(), settings);
            return new TemplateHostingObjectAssembler(objectAssembler, mapping);
        }
示例#2
0
        private ObjectAssembler CreateAssemblerToReadSpecificInstance(object instance)
        {
            var settings = new ObjectAssemblerSettings {
                RootInstance = instance
            };
            var assembler = new ObjectAssembler(WiringContext, topDownValueContext, settings);

            return(assembler);
        }
示例#3
0
        public IObjectAssembler CreateAssembler(ObjectAssemblerSettings settings)
        {
            var mapping = new DeferredLoaderMapping();

            mapping.Map <DataTemplate>(template => template.Content, new DummyDeferredLoader());

            var objectAssembler = new ObjectAssembler(wiringContext, new TopDownValueContext(), settings);

            return(new TemplateHostingObjectAssembler(objectAssembler, mapping));
        }
示例#4
0
        public PerspexObjectAssembler(IWiringContext wiringContext, ObjectAssemblerSettings objectAssemblerSettings = null)
        {
            var mapping = new DeferredLoaderMapping();

            mapping.Map <XamlDataTemplate>(template => template.Content, new TemplateLoader());

            var assembler = new ObjectAssembler(wiringContext, new TopDownMemberValueContext(), objectAssemblerSettings);

            _objectAssembler = new TemplateHostingObjectAssembler(assembler, mapping);
        }
        public SuperObjectAssembler(WiringContext wiringContext, ITopDownMemberValueContext topDownMemberValueContext, ObjectAssemblerSettings settings = null)
            : this(new StackingLinkedList<Level>(), wiringContext, topDownMemberValueContext)
        {
            Guard.ThrowIfNull(wiringContext, nameof(wiringContext));
            Guard.ThrowIfNull(topDownMemberValueContext, nameof(topDownMemberValueContext));

            this.topDownMemberValueContext = topDownMemberValueContext;
            StateCommuter.RaiseLevel();
            rootInstance = settings?.RootInstance;
            rootInstanceType = settings?.RootInstance?.GetType();
        }
示例#6
0
        public PerspexObjectAssembler(IWiringContext wiringContext, ObjectAssemblerSettings objectAssemblerSettings = null)
        {
            var mapping = new DeferredLoaderMapping();

            mapping.Map <ControlTemplate>(x => x.Content, new TemplateLoader());
            mapping.Map <DataTemplate>(x => x.Content, new TemplateLoader());
            mapping.Map <FocusAdornerTemplate>(x => x.Content, new TemplateLoader());
            mapping.Map <TreeDataTemplate>(x => x.Content, new TemplateLoader());
            mapping.Map <ItemsPanelTemplate>(x => x.Content, new TemplateLoader());

            var assembler = new ObjectAssembler(wiringContext, new TopDownValueContext(), objectAssemblerSettings);

            _objectAssembler = new TemplateHostingObjectAssembler(assembler, mapping);
        }
示例#7
0
 private ObjectAssembler CreateAssemblerToReadSpecificInstance(object instance)
 {
     var settings = new ObjectAssemblerSettings {RootInstance = instance};
     var assembler = new ObjectAssembler(WiringContext, topDownValueContext, settings);
     return assembler;
 }
 public IObjectAssembler CreateAssembler(ObjectAssemblerSettings objectAssemblerSettings)
 {
     return new SuperObjectAssembler(wiringContext, new TopDownMemberValueContext(), objectAssemblerSettings);
 }
示例#9
0
 public void MixedCollectionWithRootInstance()
 {
     var root = new ArrayList();
     var settings = new ObjectAssemblerSettings { RootInstance = root };
     var assembler = new ObjectAssembler(WiringContext, topDownValueContext, settings);
     assembler.PumpNodes(source.MixedCollection);
     var result = assembler.Result;
     Assert.IsInstanceOfType(result, typeof(ArrayList));
     var arrayList = (ArrayList)result;
     Assert.IsTrue(arrayList.Count > 0);
 }
 public IObjectAssembler CreateAssembler(ObjectAssemblerSettings settings)
 {
     var templateHostingObjectAssembler = new TemplateHostingObjectAssembler(new ObjectAssembler(wiringContext, settings));
     templateHostingObjectAssembler.AddDeferredLoader<DataTemplate>(template => template.Content, new DummyDeferredLoader());
     return templateHostingObjectAssembler;
 }
示例#11
0
 public object Load(Stream stream, object rootInstance)
 {
     var settings = new ObjectAssemblerSettings {RootInstance = rootInstance};
     return LoadInternal(stream, assemblerFactory.CreateAssembler(settings));
 }
 public IObjectAssembler CreateAssembler(ObjectAssemblerSettings settings)
 {
     return new ObjectAssembler(wiringContext, settings);
 }
示例#13
0
        public ObjectAssembler(IWiringContext wiringContext, ITopDownValueContext topDownValueContext, ObjectAssemblerSettings objectAssemblerSettings = null)
        {
            var mapping = new DeferredLoaderMapping();

            mapping.Map <DataTemplate>(template => template.AlternateTemplateContent, new DeferredLoader());

            objectAssembler = new TemplateHostingObjectAssembler(new OmniXaml.ObjectAssembler.ObjectAssembler(wiringContext, topDownValueContext, objectAssemblerSettings), mapping);
        }
示例#14
0
 public ObjectAssembler(WiringContext wiringContext, ObjectAssemblerSettings objectAssemblerSettings = null)
 {
     objectAssembler = new TemplateHostingObjectAssembler(new SuperObjectAssembler(wiringContext, new NewAssembler.TopDownMemberValueContext(), objectAssemblerSettings));
     objectAssembler.AddDeferredLoader<DataTemplate>(template => template.AlternateTemplateContent, new DeferredLoader());
 }
示例#15
0
 public IObjectAssembler CreateAssembler(ObjectAssemblerSettings objectAssemblerSettings)
 {
     return(new ObjectAssembler.ObjectAssembler(wiringContext, new TopDownValueContext(), objectAssemblerSettings));
 }