예제 #1
0
        public void Initialize(IProgressStepFactory stepFactory, IEnumerable <IProgressStepDefinition> stepsDefinition)
        {
            if (stepFactory == null)
            {
                throw new ArgumentNullException(nameof(stepFactory));
            }

            if (stepsDefinition == null)
            {
                throw new ArgumentNullException(nameof(stepsDefinition));
            }

            if (this.stepFactory != null || this.progressStepOperations != null)
            {
                throw new InvalidOperationException(ProgressResources.AlreadyInitializedException);
            }

            this.notificationManager    = new ErrorNotificationManager();
            this.stepFactory            = stepFactory;
            this.progressStepOperations = this.CreateStepOperations(stepsDefinition);
        }
        public void Initialize(IProgressStepFactory factory, IEnumerable<IProgressStepDefinition> stepsDefinition)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            if (stepsDefinition == null)
            {
                throw new ArgumentNullException(nameof(stepsDefinition));
            }

            if (this.stepFactory != null || this.progressStepOperations != null)
            {
                throw new InvalidOperationException(ProgressResources.AlreadyInitializedException);
            }

            this.notificationManager = new ErrorNotificationManager();
            this.stepFactory = factory;
            this.progressStepOperations = this.CreateStepOperations(stepsDefinition);
        }
 void IProgressController.Initialize(IProgressStepFactory stepFactory, IEnumerable <IProgressStepDefinition> stepsDefinition)
 {
     throw new NotImplementedException();
 }
 void IProgressController.Initialize(IProgressStepFactory stepFactory, IEnumerable<IProgressStepDefinition> stepsDefinition)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Creates initializes <see cref="SequentialProgressController"/>
 /// </summary>
 /// <param name="serviceProvider">Service provider instance. Required.</param>
 /// <param name="stepFactory"><see cref="IProgressStepFactory"/> to use when create steps from definitions</param>
 /// <param name="stepsDefinition">One or more instance of <see cref="IProgressStepDefinition"/></param>
 /// <returns>The initialized <see cref="SequentialProgressController"/></returns>
 public static SequentialProgressController Create(IServiceProvider serviceProvider, IProgressStepFactory stepFactory, params IProgressStepDefinition[] stepsDefinition)
 {
     SequentialProgressController controller = new SequentialProgressController(serviceProvider);
     controller.Initialize(stepFactory, stepsDefinition);
     return controller;
 }
예제 #6
0
        /// <summary>
        /// Creates initializes <see cref="SequentialProgressController"/>
        /// </summary>
        /// <param name="serviceProvider">Service provider instance. Required.</param>
        /// <param name="stepFactory"><see cref="IProgressStepFactory"/> to use when create steps from definitions</param>
        /// <param name="stepsDefinition">One or more instance of <see cref="IProgressStepDefinition"/></param>
        /// <returns>The initialized <see cref="SequentialProgressController"/></returns>
        public static SequentialProgressController Create(IServiceProvider serviceProvider, IProgressStepFactory stepFactory, params IProgressStepDefinition[] stepsDefinition)
        {
            SequentialProgressController controller = new SequentialProgressController(serviceProvider);

            controller.Initialize(stepFactory, stepsDefinition);
            return(controller);
        }