/// <summary> /// Performs events calling. The <c>EventArgs.Empty</c> is used as <c>EventArgs</c>. /// </summary> /// <param name="type"></param> protected virtual void OnEvent(OverflowType type) { DateOverflowEventArgs args = new DateOverflowEventArgs(); args.Type = type; // Event is only performed if any listener is registered if (DateOverflowEvent != null) { DateOverflowEvent(this, args); } }
/// <summary> /// Event that is performed if there is any date overflow in calendar /// </summary> /// <param name="sender">Not needed</param> /// <param name="args">Date overflow type eg. EndOfWeek</param> protected void OnDateOverflow(object sender, DateOverflowEventArgs args) { switch (args.Type) { case DateOverflowEventArgs.OverflowType.EndOfSemester: LifeEnv.SimulateExams(); break; case DateOverflowEventArgs.OverflowType.EndOfGeneration: OnEndOfGeneration(); break; } }