コード例 #1
0
        static void Main()
        {
            FireAlarm myFireAlarm = new FireAlarm();

            FireAlarmHandler handler = new FireAlarmHandler(myFireAlarm);

            EventArgs e = new EventArgs();

            //lansare evenimente
            myFireAlarm.SunaAlarma(e);

            Console.Read();
        }
コード例 #2
0
ファイル: delegate2.cs プロジェクト: cristianciurea/PAW
        static void Main()
        {
            FireAlarm myFireAlarm = new FireAlarm();

            FireAlarmHandler handler = new FireAlarmHandler(myFireAlarm);

            FireAlarmEventArgs e1 = new FireAlarmEventArgs("Camera 1", 3);
            FireAlarmEventArgs e2 = new FireAlarmEventArgs("Camera 2", 7);

            //lansare evenimente
            myFireAlarm.SunaAlarma(e1);
            myFireAlarm.SunaAlarma(e2);

            Console.Read();
        }