S
SimonZ
Hi,
can someone explain me this piece of code:
public class AlarmEventArgs : EventArgs
{
private readonly bool snoozePressed ;
private readonly int nrings;
//Constructor.
//
public AlarmEventArgs(bool snoozePressed, int nrings)
{
this.snoozePressed = snoozePressed;
this.nrings = nrings;
}
......
....
Why means constructor? Why method AlarmEventArgs has the same name as class?
To be called every time when class AlarmEventArgs is instantiated?
Why set nrings to nrings? Just to be available outside of method
AlarmEventArgs?
The complete code is on:
http://msdn.microsoft.com/library/d...en-us/cpguide/html/cpconeventsmini-sample.asp
Thanks,S
can someone explain me this piece of code:
public class AlarmEventArgs : EventArgs
{
private readonly bool snoozePressed ;
private readonly int nrings;
//Constructor.
//
public AlarmEventArgs(bool snoozePressed, int nrings)
{
this.snoozePressed = snoozePressed;
this.nrings = nrings;
}
......
....
Why means constructor? Why method AlarmEventArgs has the same name as class?
To be called every time when class AlarmEventArgs is instantiated?
Why set nrings to nrings? Just to be available outside of method
AlarmEventArgs?
The complete code is on:
http://msdn.microsoft.com/library/d...en-us/cpguide/html/cpconeventsmini-sample.asp
Thanks,S