protected override void OnShutdown() { if (_seatDispatcherModel != null) { ((IDisposable)_seatDispatcherModel).Dispose(); } base.OnShutdown(); this._schedule = null; if (this._areas != null) { this._areas.Clear(); this._areas = null; } if (this._bindableSeats != null) { this._bindableSeats.Clear(); this._bindableSeats = null; } if (this._seatBoxes != null) { this._seatBoxes.Clear(); this._seatBoxes = null; } if (this._otherAgents != null) { this._otherAgents.Clear(); this._otherAgents = null; } this._parentModel = null; this._selectedArea = null; this._selectedSeat = null; this.TrySubmitChanged = null; this.BlockConverter.Dispose(); this.BlockConverter = null; }
public void Load(ICanSupportAgentFinder model, Schedule schedule) { if (IsInitialized) { return; } _parentModel = model; _schedule = schedule; _excludedEmployeeIds = _parentModel.Agents.Cast <IAgent>().Select(o => o.Schedule.Id).ToArray(); ExecuteManager.BackgroundAction(() => { _seatBoxes = _seatDispatcherModel.GetSeats(_schedule, _excludedEmployeeIds, out _otherAgents, out _areas) .ToDictionary(o => o.Seat.Id.ToString(), o => o as IEnumerable); IsDirty = false; BuildSeatArrangement <TimeBox>(_otherAgents, o => o); // the agents which have seat but, not in the schedule BuildSeatArrangement <IAgent>(_parentModel.Agents, o => o.Schedule); this.NotifyOfPropertyChange("Areas"); SelectedArea = _areas.FirstOrDefault(); }, BeginLoading, EndLoading); base.OnInitialize(); IsInitialized = true; }
protected override void OnInitialize() { Invoker.SaftyInvoke <ICanSupportAgentFinder>(p => { _canSupportAgentFinderPresenter = p; _cast = p.Transform <Employee>; _agents = p.Agents; _model.CreateTimeBoxFilter(_agents, p.GetWatchPoint().Date); }); _filters = _model.GetFilters(); base.OnInitialize(); }
protected override void OnInitialize() { Invoker.SaftyInvoke<ICanSupportAgentFinder>(p => { _canSupportAgentFinderPresenter = p; _cast = p.Transform<Employee>; _agents = p.Agents; _model.CreateTimeBoxFilter(_agents, p.GetWatchPoint().Date); }); _filters = _model.GetFilters(); base.OnInitialize(); }
private void RtaaStatisticPresenterAttemptingShutdown(object sender, EventArgs e) { Close(); _shiftViewerPresenter = null; _data = null; }