Exemple #1
0
 private void SetUpTask(ICommandTask task)
 {
     task.Started   += (sender, e) => OnTaskStarted  (e);
     task.Completed += (sender, e) => OnTaskCompleted(e);
     task.Canceled  += (sender, e) => OnTaskCanceled (e);
     task.ProgressTracker.ProgressUpdated += (sender, e) => OnProgressUpdated(new CommandTaskProgressEventArgs(task, e.Progress));
 }
Exemple #2
0
 public EditMultipleDataRepositoriesMetaDataPresenter(IEditMultipleDataRepositoriesMetaDataView view, IDataRepositoryMetaDataPresenter metaDataPresenter,
                                                      ICommandTask commandTask, IOSPSuiteExecutionContext context)
     : base(view)
 {
     _metaDataPresenter = metaDataPresenter;
     _commandTask       = commandTask;
     _context           = context;
     _view.SetDataEditor(_metaDataPresenter.View);
     AddSubPresenters(_metaDataPresenter);
 }
Exemple #3
0
 public JsonSimulationRunner(ISimulationLoader simulationLoader, ISimulationExporter simulationExporter, IBatchLogger logger,
                             IEntitiesInContainerRetriever entitiesInContainerRetriever, IExecutionContext executionContext, ICommandTask commandTask)
 {
     _simulationLoader             = simulationLoader;
     _simulationExporter           = simulationExporter;
     _logger                       = logger;
     _entitiesInContainerRetriever = entitiesInContainerRetriever;
     _executionContext             = executionContext;
     _commandTask                  = commandTask;
 }
Exemple #4
0
 public CalculateScaleDivisorsPresenter(ICalculateScaleDivisorsView view, ICommandTask commandTask, IContainerTask containerTask,
                                        IScaleDivisorCalculator scaleDivisorCalculator, IMoleculeAmountTask moleculeAmountTask, IMoBiContext context)
     : base(view)
 {
     _commandTask            = commandTask;
     _containerTask          = containerTask;
     _scaleDivisorCalculator = scaleDivisorCalculator;
     _moleculeAmountTask     = moleculeAmountTask;
     _context  = context;
     _commands = new MoBiMacroCommand
     {
         CommandType = AppConstants.Commands.EditCommand,
         ObjectType  = ObjectTypes.Simulation
     };
 }
 public InteractionTaskContext(IMoBiContext context, IMoBiApplicationController applicationController,
                               IInteractionTask interactionTask, IActiveSubjectRetriever activeSubjectRetriever, IUserSettings userSettings,
                               IDisplayUnitRetriever displayUnitRetriever, IDialogCreator dialogCreator,
                               ICommandTask commandTask, IObjectTypeResolver objectTypeResolver, IMoBiFormulaTask moBiFormulaTask,
                               IMoBiConfiguration configuration, DirectoryMapSettings directoryMapSettings)
 {
     DialogCreator          = dialogCreator;
     Context                = context;
     ApplicationController  = applicationController;
     InteractionTask        = interactionTask;
     ActiveSubjectRetriever = activeSubjectRetriever;
     UserSettings           = userSettings;
     DisplayUnitRetriever   = displayUnitRetriever;
     _commandTask           = commandTask;
     _objectTypeResolver    = objectTypeResolver;
     _configuration         = configuration;
     _directoryMapSettings  = directoryMapSettings;
     MoBiFormulaTask        = moBiFormulaTask;
 }
Exemple #6
0
        public TaskViewModel(ICommandTask task)
        {
            if (task == null) {
                throw new ArgumentNullException("task");
            }

            this.task = task;

            Task.ProgressTracker.ProgressUpdated += (sender, e) => Notify("Progress");
            Task.ProgressTracker.StatusUpdated   += (sender, e) => Notify("Status");

            Task.Started   += (sender, e) => Notify("State");
            Task.Completed += (sender, e) => Notify("State");
            task.Canceled  += (sender, e) => Notify("State");
        }
Exemple #7
0
        private void ShowTaskPopup(ICommandTask task)
        {
            var dispatcher = this.taskbarIcon.Dispatcher;

            if (!dispatcher.CheckAccess()) {
                dispatcher.BeginInvoke(new Action<ICommandTask>(ShowTaskPopup), task);

                return;
            }

            task.Completed += (sender, e) => OnTaskCompleted();
            task.Canceled += (sender, e) => OnTaskCanceled();

            if (ShowNotificationOnStart) {
                this.taskPopup.Show();
            }

            if (task.State == TaskState.Completed) {
                this.taskPopup.Hide(CompleteHideDelay);
            } else if (task.State == TaskState.Canceled) {
                this.taskPopup.Hide(CancelHideDelay);
            }
        }
Exemple #8
0
 public CommandTaskProgressEventArgs(ICommandTask task, double progress)
     : base(task)
 {
     this.progress = progress;
 }
Exemple #9
0
 public CommandTaskEventArgs(ICommandTask task)
 {
     this.task = task;
 }
Exemple #10
0
 public CommandTaskCancellationEventArgs(ICommandTask task, CommandCanceledException cancelReason)
     : base(task)
 {
     this.cancelReason = cancelReason;
 }