Пример #1
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);
        }
Пример #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);
        }
Пример #5
0
        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);
 }
Пример #10
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));
 }
Пример #12
0
 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));
 }