public ShiftImportPresenter(IShiftDispatcherModel shiftDispatcherModel, ICalendarEventModel calendarEventModel, IOpenFileService openFileService) { _shiftDispatcherModel = shiftDispatcherModel; _calendarEventModel = calendarEventModel; _openFileService = openFileService; _bindableAgents = new List <IEnumerable>(); _openFileService.Filter = "Excel File|*.xls"; _assignmentCellConverter = new BlockToCellConverter(Brushes.OrangeRed, "#FF77BB44".ToBrush(1), Brushes.DarkGray).ShowDayOffText(false); }
public ShiftImportPresenter(IShiftDispatcherModel shiftDispatcherModel, ICalendarEventModel calendarEventModel, IOpenFileService openFileService) { _shiftDispatcherModel = shiftDispatcherModel; _calendarEventModel = calendarEventModel; _openFileService = openFileService; _bindableAgents = new List<IEnumerable>(); _openFileService.Filter = "Excel File|*.xls"; _assignmentCellConverter = new BlockToCellConverter(Brushes.OrangeRed, "#FF77BB44".ToBrush(1), Brushes.DarkGray).ShowDayOffText(false); }
private readonly AutoResetEvent _autoReset = new AutoResetEvent(false);//异步调用,等待RegisterRunStaffingChart完成后再执行OnInitialize中Thread内容 public ShiftComposerPresenter(IShiftDispatcherModel shiftDispatcherModel, ILaborHoursCountingModel laborHoursCountingModel, ICalendarEventModel calendarEventModel) { _shiftDispatcherModel = shiftDispatcherModel; _laborHoursCountingModel = laborHoursCountingModel; _calendarEventModel = calendarEventModel; //x_changedTerms = new List<Tuple<int, DateTerm>>(); //x_changedCells = new List<Tuple<int, DateTerm>>(); //x_assignmentInsertRuleIntersectionPoints = new Dictionary<AssignmentType, IList<Luna.Core.Tuple<int, int>>>(); //x_assignmentContributionPositions = new Dictionary<AssignmentType, bool[]>(); //InitializeCommandBindings var shiftPainterCommandBinding = new CommandBinding(Luna.WPF.ApplicationFramework.ApplicationCommands.ShiftPainter, CopyShiftForPainting, (sender, e) => { e.CanExecute = InitalDrawBlock != null && CellMode && SelectionTimeRange != null; e.Parameter.SaftyInvoke <ICheckableCommandParameter>(p => { p.Handled = true; p.IsChecked = PaintShiftIsEnabled; }); }); var saveCommandBinding = new AsyncCommandBinding(ApplicationCommands.Save, (sender, e) => SubmitChanges(false), (sender, e) => e.CanExecute = CellChanged, (sender, e) => { if (e.Error == null) { return; } CellChanged = true; throw e.Error; }); var undoCommandBinding = new CommandBinding(ApplicationCommands.Undo, (sender, e) => SubmitChanges(true), (sender, e) => e.CanExecute = CellChanged); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SetDayOff, (sender, e) => { SetAsDayOff(); })); CommandBindings.Add(shiftPainterCommandBinding); CommandBindings.Add(saveCommandBinding); CommandBindings.Add(undoCommandBinding); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.EstimateShift, EstimateShift, AnalyisComplete)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.ShowEstimateShift, SendParameter, AnalyisComplete)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenStaffingStatistic, SendParameter)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenCompositiveServiceQueue, SendParameter, AnalyisComplete)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SortByTermStart, delegate { Sort(); })); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SwitchView, SwitchView)); ResetAlterDateRange(); }
private readonly AutoResetEvent _autoReset = new AutoResetEvent(false);//异步调用,等待RegisterRunStaffingChart完成后再执行OnInitialize中Thread内容 public ShiftComposerPresenter(IShiftDispatcherModel shiftDispatcherModel, ILaborHoursCountingModel laborHoursCountingModel, ICalendarEventModel calendarEventModel) { _shiftDispatcherModel = shiftDispatcherModel; _laborHoursCountingModel = laborHoursCountingModel; _calendarEventModel = calendarEventModel; //x_changedTerms = new List<Tuple<int, DateTerm>>(); //x_changedCells = new List<Tuple<int, DateTerm>>(); //x_assignmentInsertRuleIntersectionPoints = new Dictionary<AssignmentType, IList<Luna.Core.Tuple<int, int>>>(); //x_assignmentContributionPositions = new Dictionary<AssignmentType, bool[]>(); //InitializeCommandBindings var shiftPainterCommandBinding = new CommandBinding(Luna.WPF.ApplicationFramework.ApplicationCommands.ShiftPainter, CopyShiftForPainting, (sender, e) => { e.CanExecute = InitalDrawBlock != null && CellMode && SelectionTimeRange != null; e.Parameter.SaftyInvoke<ICheckableCommandParameter>(p => { p.Handled = true; p.IsChecked = PaintShiftIsEnabled; }); }); var saveCommandBinding = new AsyncCommandBinding(ApplicationCommands.Save, (sender, e) => SubmitChanges(false), (sender, e) => e.CanExecute = CellChanged, (sender, e) => { if (e.Error == null) return; CellChanged = true; throw e.Error; }); var undoCommandBinding = new CommandBinding(ApplicationCommands.Undo, (sender, e) => SubmitChanges(true), (sender, e) => e.CanExecute = CellChanged); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SetDayOff, (sender, e) => { SetAsDayOff(); })); CommandBindings.Add(shiftPainterCommandBinding); CommandBindings.Add(saveCommandBinding); CommandBindings.Add(undoCommandBinding); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.EstimateShift, EstimateShift, AnalyisComplete)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.ShowEstimateShift, SendParameter, AnalyisComplete)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenStaffingStatistic, SendParameter)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.OpenCompositiveServiceQueue, SendParameter, AnalyisComplete)); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SortByTermStart, delegate { Sort(); })); CommandBindings.Add(new CommandBinding(WPF.ApplicationFramework.ApplicationCommands.SwitchView, SwitchView)); ResetAlterDateRange(); }
public ShiftDispatcherPresenter(IShiftDispatcherModel shiftDispatcherModel, ILaborHoursCountingModel laborHoursCountingModel) { CurrentIndex = -1; _shiftDispatcherModel = shiftDispatcherModel; _laborHoursCountingModel = laborHoursCountingModel; _blockConverter = new DefalutBlockConverter(); AdherenceBlockConverter = new AdherenceBlockConverter(); AdherenceBlockConverter.BlockChanged += OnAdhEventBlockChanged; _sortDelegate = new Action(() => Sort(GetWatchPoint(), GetWatchPoint().AddDays(1))); }
protected override void OnShutdown() { if (_uiRefresh != null) { _uiRefresh.GetInvocationList().ForEach(o => { _uiRefresh -= o as Action; }); } if (_refresh != null) { _refresh.GetInvocationList().ForEach(o => { _refresh -= o as Action <IEnumerable>; }); } if (_seatDispatcherPresenter != null) { RunSeatDispatcher(_seatDispatcherPresenter.Target.As <IPresenter>()); } _shiftDispatcherModel.Release(); ((IDisposable)_shiftDispatcherModel).Dispose(); _shiftDispatcherModel = null; _laborHoursCountingModel.SaftyInvoke <IDisposable>(o => o.Dispose()); _laborHoursCountingModel = null; ApplicationCache.Remove(_schedule); if (_blockConverter != null) { _blockConverter.Dispose(); } _blockConverter = null; AdherenceBlockConverter.Dispose(); AdherenceBlockConverter = null; if (this._attendances != null) { this._attendances.Clear(); this._attendances = null; } if (this._agentAdherences != null) { this._agentAdherences.Clear(); this._agentAdherences = null; } if (this._bindableAgents != null) { this._bindableAgents.Clear(); this._bindableAgents = null; } if (this._changedAgents != null) { this._changedAgents.Clear(); this._changedAgents = null; } this._refresh = null; this._sortDelegate = null; this._uiRefresh = null; this._buildSeatDispatcher = null; this._destroySeatDispatcher = null; this._seatDispatcherPresenter = null; this._schedule = null; this._selectedAgent = null; _buildStaffingChart = null; if (_staffingCalculatorArgs != null) { _staffingCalculatorArgs.Clear(); } _staffingCalculatorArgs = null; if (_staffingCalculatorService != null) { _staffingCalculatorService.Shutdown(); } _staffingCalculatorService = null; FullyRefresh = null; if (this._timer != null) { _timer.Stop(); _timer = null; } base.OnShutdown(); }