Events in C# : Real life Example

Event in C# : What is an event?

An event is an action or occurrence, which is key presses, mouse movements, clicks or system generated notifications. Programs/Applications can respond to event when they occurred.

“Inter-process communication means an event”

Event(message sent by object)àObjectàAction (occurrence of an event).

alarm_event.png

Example :Here, an examples of events and response to the events .

I] Alarm Clock (Real life example)

Alarm Clock is an object.

Alarm set for 7 AM (shows time 7 AM).

Generate an event as alarm on 7AM.

 Hear alarm and get ready for office.

II] Roll Back Process of Application

  Software Installation,

Click on Install button,

Installation process search an appropriate system file while running setup,

Application can't get that file,

Roll back process start.

 

Thanking you!

Next Recommended Reading Delegates With A Real Time Example In C#