C # code for Alarm