Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChildContainer"/> class.
 /// </summary>
 /// <param name="serviceMappings">The service mappings.</param>
 /// <param name="parentStorage">The parent storage.</param>
 /// <param name="childStorage">The child storage.</param>
 /// <param name="disposedCallback">Invoked when the container is disposed.</param>
 public ChildContainer(IServiceMappings serviceMappings, IInstanceStorage parentStorage,
                       IInstanceStorage childStorage, Action disposedCallback) : base(serviceMappings)
 {
     _parentStorage    = parentStorage;
     _childStorage     = childStorage;
     _disposedCallback = disposedCallback;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChildContainer"/> class.
 /// </summary>
 /// <param name="serviceMappings">The service mappings.</param>
 /// <param name="parentStorage">The parent storage.</param>
 /// <param name="childStorage">The child storage.</param>
 /// <param name="disposedCallback">Invoked when the container is disposed.</param>
 public ChildContainer(IServiceMappings serviceMappings, IInstanceStorage parentStorage,
                       IInstanceStorage childStorage, Action disposedCallback) : base(serviceMappings)
 {
     _parentStorage = parentStorage;
     _childStorage = childStorage;
     _disposedCallback = disposedCallback;
 }
Ejemplo n.º 3
0
 public WorkflowEngine(IServiceProvider serviceProvider, ITracker tracker, IDeferredTarget deferredTarget)
 {
     _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _workflowStorage = _serviceProvider.GetService <IWorkflowStorage>() ?? throw new NullReferenceException("IWorkflowStorage");
     _instanceStorage = _serviceProvider.GetService <IInstanceStorage>() ?? throw new NullReferenceException("IInstanceStorage");
     _deferredTarget  = deferredTarget ?? throw new NullReferenceException("IDeferredTarget");
     _tracker         = tracker;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Container"/> class.
 /// </summary>
 /// <param name="serviceMappings">The service mappings which as been generated by a <see cref="IContainerBuilder"/>.</param>
 /// <param name="factory">Used to create the storage</param>
 public Container(IServiceMappings serviceMappings, IInstanceStorageFactory factory)
     : base(serviceMappings)
 {
     if (serviceMappings == null)
     {
         throw new ArgumentNullException("serviceMappings");
     }
     _factory = factory;
     _storage = factory.CreateParent();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateContext"/> class.
 /// </summary>
 /// <param name="container">The service locator.</param>
 /// <param name="singletonStorage">The singleton storage.</param>
 /// <param name="scopedStorage">The scoped.</param>
 /// <param name="requestedService">The requested service.</param>
 public CreateContext(IServiceLocator container, IInstanceStorage singletonStorage, IInstanceStorage scopedStorage, Type requestedService)
 {
     if (container == null) throw new ArgumentNullException("container");
     if (singletonStorage == null) throw new ArgumentNullException("singletonStorage");
     if (requestedService == null) throw new ArgumentNullException("requestedService");
     Container = container;
     SingletonStorage = singletonStorage;
     ScopedStorage = scopedStorage;
     RequestedService = requestedService;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CreateContext"/> class.
 /// </summary>
 /// <param name="container">The service locator.</param>
 /// <param name="singletonStorage">The singleton storage.</param>
 /// <param name="scopedStorage">The scoped.</param>
 /// <param name="requestedService">The requested service.</param>
 public CreateContext(IServiceLocator container, IInstanceStorage singletonStorage, IInstanceStorage scopedStorage, Type requestedService)
 {
     if (container == null)
     {
         throw new ArgumentNullException("container");
     }
     if (singletonStorage == null)
     {
         throw new ArgumentNullException("singletonStorage");
     }
     if (requestedService == null)
     {
         throw new ArgumentNullException("requestedService");
     }
     Container        = container;
     SingletonStorage = singletonStorage;
     ScopedStorage    = scopedStorage;
     RequestedService = requestedService;
 }