/// <summary> /// Initializes a new instance of the RoutesManagementTaskBase class. /// </summary> /// <param name="workflowManagementStateTracker">Reference to the /// workflow management connection state tracking service.</param> /// <param name="solverStateTracker">Reference to the VRP solver state /// tracking service.</param> /// <param name="optimizeAndEditPage">Reference to the "Optimize And Edit" /// page object.</param> public RoutesManagementTaskBase( IStateTrackingService workflowManagementStateTracker, IStateTrackingService solverStateTracker, IOptimizeAndEditPage optimizeAndEditPage) { Debug.Assert(workflowManagementStateTracker != null); Debug.Assert(solverStateTracker != null); Debug.Assert(optimizeAndEditPage != null); _workflowManagementStateTracker = workflowManagementStateTracker; _workflowManagementStateTracker.StateChanged += _WorkflowManagementStateTrackerStateChanged; _workflowManagementIsEnabled = _workflowManagementStateTracker.IsEnabled; _solverStateTracker = solverStateTracker; _solverStateTracker.StateChanged += _SolverStateTrackerStateChanged; _hasRoutingOperationInProgress = !_solverStateTracker.IsEnabled; _optimizeAndEditPage = optimizeAndEditPage; _optimizeAndEditPage.CurrentScheduleChanged += (_s, _e) => _NotifyCurrentScheduleChanged(_optimizeAndEditPage.CurrentSchedule); _NotifyCurrentScheduleChanged(_optimizeAndEditPage.CurrentSchedule); this.UpdatedEnabledState(); }
/// <summary> /// Initializes a new instance of the RoutesManagementTaskBase class. /// </summary> /// <param name="workflowManagementStateTracker">Reference to the /// workflow management connection state tracking service.</param> /// <param name="solverStateTracker">Reference to the VRP solver state /// tracking service.</param> /// <param name="optimizeAndEditPage">Reference to the "Optimize And Edit" /// page object.</param> public RoutesManagementTaskBase( IStateTrackingService workflowManagementStateTracker, IStateTrackingService solverStateTracker, IOptimizeAndEditPage optimizeAndEditPage) { Debug.Assert(workflowManagementStateTracker != null); Debug.Assert(solverStateTracker != null); Debug.Assert(optimizeAndEditPage != null); _workflowManagementStateTracker = workflowManagementStateTracker; _workflowManagementStateTracker.StateChanged += _WorkflowManagementStateTrackerStateChanged; _workflowManagementIsEnabled = _workflowManagementStateTracker.IsEnabled; _solverStateTracker = solverStateTracker; _solverStateTracker.StateChanged += _SolverStateTrackerStateChanged; _hasRoutingOperationInProgress = !_solverStateTracker.IsEnabled; _optimizeAndEditPage = optimizeAndEditPage; _optimizeAndEditPage.CurrentScheduleChanged += (_s, _e) => _NotifyCurrentScheduleChanged(_optimizeAndEditPage.CurrentSchedule); _NotifyCurrentScheduleChanged(_optimizeAndEditPage.CurrentSchedule); this.UpdatedEnabledState(); }
/// <summary> /// Initializes a new instance of the SendRoutesTask class. /// </summary> /// <param name="workflowManagementStateTracker">Reference to the /// workflow management connection state tracking service.</param> /// <param name="solverStateTracker">Reference to the VRP solver state /// tracking service.</param> /// <param name="optimizeAndEditPage">Reference to the "Optimize And Edit" /// page object.</param> /// <param name="dateTimeProvider">The reference to the date time provider /// object.</param> /// <param name="routesSender">The reference to the routes sender object.</param> public SendRoutesTask( IStateTrackingService workflowManagementStateTracker, IStateTrackingService solverStateTracker, IOptimizeAndEditPage optimizeAndEditPage, ICurrentDateProvider dateTimeProvider, IRoutesSender routesSender) : base(workflowManagementStateTracker, solverStateTracker, optimizeAndEditPage) { Debug.Assert(dateTimeProvider != null); Debug.Assert(routesSender != null); _dateTimeProvider = dateTimeProvider; _routesSender = routesSender; }
/// <summary> /// Handles application initialized event. /// </summary> /// <param name="sender">Reference to the event sender object.</param> /// <param name="e">Event arguments.</param> private void _ApplicationApplicationInitialized(object sender, EventArgs e) { _optimizeAndEditPage = (IOptimizeAndEditPage)_application.MainWindow.GetPage( PagePaths.SchedulePagePath); if (_hasCurrentSchedule) { _optimizeAndEditPage.CurrentSchedule = _currentSchedule; } _optimizeAndEditPage.CurrentScheduleChanged += (_s, _e) => _NotifyCurrentScheduleChanged(); }