Esempio n. 1
0
            // 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));
            }
Esempio n. 2
0
 protected void RaiseCalculateCalled()
 {
     CalculateCalled?.Invoke(this, new CalculateEventArgs(Salary, Months));
 }