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")); } }
public override void End(EndParams par) { End(par); }
public abstract void End(EndParams par);