Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #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();
 }
Пример #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;
 }
Пример #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;
 }