Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
 private void RtaaStatisticPresenterAttemptingShutdown(object sender, EventArgs e)
 {
     Close();
     _shiftViewerPresenter = null;
     _data = null;
 }