public void OverrideInstance(object instance) { StateCommuter.RaiseLevel(); StateCommuter.Current.Instance = instance; var collection = instance as ICollection; if (collection != null) { StateCommuter.Current.Collection = collection; } }
public ObjectAssembler(IRuntimeTypeSource typeSource, IValueContext valueContext, Settings settings = null) : this(new StackingLinkedList <Level>(), typeSource, GetLifecycleListener(settings), valueContext) { this.valueContext = valueContext; Guard.ThrowIfNull(typeSource, nameof(typeSource)); TypeSource = typeSource; StateCommuter.RaiseLevel(); rootInstance = settings?.RootInstance; var rootInstanceType = rootInstance?.GetType(); rootInstanceXamlType = rootInstanceType != null?TypeSource.GetByType(rootInstanceType) : null; }
public ObjectAssembler(IWiringContext wiringContext, ITopDownValueContext topDownValueContext, ObjectAssemblerSettings settings = null) : this(new StackingLinkedList <Level>(), wiringContext, topDownValueContext) { Guard.ThrowIfNull(wiringContext, nameof(wiringContext)); Guard.ThrowIfNull(topDownValueContext, nameof(topDownValueContext)); this.topDownValueContext = topDownValueContext; StateCommuter.RaiseLevel(); rootInstance = settings?.RootInstance; var rootInstanceType = rootInstance?.GetType(); rootInstanceXamlType = rootInstanceType != null?wiringContext.TypeContext.TypeRepository.GetXamlType(rootInstanceType) : null; }