Why does the following line "alarm.AlarmEvent += new AlarmEventHandler(alarm_Sound);" gives me "An object reference is required for the non-static field, method, or property 'AlarmClock.Alarm.alarm_Sound(object, System.EventArgs)'"
public static void Main(string[] args)
{
Alarm alarm = new Alarm(new DateTime(2010, 4, 7, 23, 2, 0));
alarm.Set();
alarm.AlarmEvent += new AlarmEventHandler(alarm_Sound);
}
Full source code here: Program.cs AlarmEventArgs