// generic delegate + custom event args //public event EventHandler<CalculateCalledEventArgs> CalculateCalled; // full custom //public event CalculateCalledEventHandler CalculateCalled; public void Calculate(Guid guid) { ++_calculationCount; // null check in case nobody is subscribed // generic //CalculateCalled?.Invoke(this, _calculationCount); // either custom implemeentation CalculateCalled?.Invoke(this, _calculationCount);// new CalculateCalledEventArgs(_calculationCount)); }
protected void RaiseCalculateCalled() { CalculateCalled?.Invoke(this, new CalculateEventArgs(Salary, Months)); }