/// <summary> /// This method is called by the export strategy when attempting to locate an export /// </summary> /// <param name="creationDelegate"></param> /// <param name="injectionScope"></param> /// <param name="injectionContext"></param> /// <param name="exportStrategy"></param> /// <returns></returns> public object Locate(ExportActivationDelegate creationDelegate, IInjectionScope injectionScope, IInjectionContext injectionContext, IExportStrategy exportStrategy) { if (lifestyleContainer == null) { lifestyleContainer = LocateContainer(exportStrategy.OwningScope, injectionContext); } return lifestyleContainer.Locate(creationDelegate, injectionScope, injectionContext, exportStrategy); }
public void SetInstance(object instance) { Lifestyle = new InjectedInstanceLifestyle(instance); }
public ConcreteClassInstantiationLookupServiceDecorator(IComponentLookup underlying, ILifestyle lifestyle) { this.underlying = underlying; this.lifestyle = lifestyle; }
/// <summary> /// Dispose of this object /// </summary> /// <param name="dispose"></param> protected virtual void Dispose(bool dispose) { if (_disposed) { return; } if (dispose) { ILifestyle lifestyleTemp = _lifestyle; _lifestyle = null; if (lifestyleTemp != null) { lifestyleTemp.Dispose(); } _conditions = ImmutableArray<IExportCondition>.Empty; _enrichWithDelegates = ImmutableArray<EnrichWithDelegate>.Empty; _disposed = true; } }
/// <summary> /// Set the life cycle container for the strategy /// </summary> /// <param name="container"></param> public virtual IConfigurableExportStrategy SetLifestyleContainer(ILifestyle container) { if (_lifestyle == null) { _lifestyle = container; } return this; }
/// <summary> /// Set the life cycle container for the strategy /// </summary> /// <param name="container"></param> public virtual void SetLifestyleContainer(ILifestyle container) { if (_lifestyle == null) { _lifestyle = container; } }
public FluentImplementorOptions <T> Custom(ILifestyle lifestyle) { command.Lifestyle = lifestyle; return(parentOptions); }
private IComponentLookup BuildLookupService(bool enableImplicitClassInstantiation, ILifestyle defaultLifestyle) { var underlying = new LookupService(componentStore); if (enableImplicitClassInstantiation) { return(new ConcreteClassInstantiationLookupServiceDecorator(underlying, defaultLifestyle)); } return(underlying); }
public static ILifestyle Custom(ILifestyle lifestyle) { return(lifestyle); }
public ConcreteClassInstantiationLookupServiceDecorator(IComponentLookup underlying, ILifestyle lifestyle) { this.underlying = underlying; this.lifestyle = lifestyle; }
public IClientFactory InitializationLifeStyle(ILifestyle lifestyle) { _lifeStyle = lifestyle; return this; }