Exemplo n.º 1
0
        public void EndActivity(EndParams par)
        {
            if (par.endState == State.NotSet)
            {
                throw new InvalidValueException(string.Format("Activity:EndActivity: Activity {0}: endState NOT set", this._type.ToString()));
            }
            if (par.endReason == string.Empty)
            {
                throw new InvalidValueException(string.Format("Activity:EndActivity: Activity {0}: endReason NOT set", this._type.ToString()));
            }

            _endTime   = DateTime.Now;
            _state     = par.endState;
            _endReason = par.endReason;
            _duration  = _endTime - _startTime;

            EmitEnd();

            monitor.endedActivities.Add(this);
            monitor.inProgressActivities.Remove(this);

            if (this._type != ActivityMonitor.ActivityType.GoingIdle &&
                ActivityMonitor.ObservatoryActivities.Count() == 0 &&
                effectOnGoingIdle_AtEnd == EffectOnGoingIdle.Renew)
            {
                monitor.NewActivity(new GoingIdleActivity("no activities in progress"));
            }
        }
Exemplo n.º 2
0
 public override void End(EndParams par)
 {
     End(par);
 }
Exemplo n.º 3
0
 public abstract void End(EndParams par);