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); }
private ObjectAssembler CreateAssemblerToReadSpecificInstance(object instance) { var settings = new ObjectAssemblerSettings { RootInstance = instance }; var assembler = new ObjectAssembler(WiringContext, topDownValueContext, settings); return(assembler); }
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)); }
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(); }
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); }
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); }
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; }
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); }
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); }
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()); }
public IObjectAssembler CreateAssembler(ObjectAssemblerSettings objectAssemblerSettings) { return(new ObjectAssembler.ObjectAssembler(wiringContext, new TopDownValueContext(), objectAssemblerSettings)); }