Take the 2-minute tour ×

What is the purpose of event listeners and how do I make use of them in a console application in Visual C#?

Under what circumstances can I substitute them for threads, and would it be a good idea to do so?

The reason why I ask is because I would like to make use of something to programmatically register button-presses on a Wiimote. Someone suggested that event listeners would be a possible way to do it. Are event listeners the right way to go about doing this?

share|improve this question
to listen to events... –  Mitch Wheat Jun 19 '10 at 10:29
add comment

3 Answers

up vote 3 down vote accepted

From MSDN:

An event in C# is a way for a class to provide notifications to clients of that class when some interesting thing happens to an object. The most familiar use for events is in graphical user interfaces; typically, the classes that represent controls in the interface have events that are notified when the user does something to the control (for example, click a button).

Checkout the example in the link above.

share|improve this answer
add comment

Event listeners are methods that get executed when a certain event (for instance a keypress or a click on a button is registered). They are commonly used in GUI applications, where the standard design pattern is that one can register one or more methods with certain events provided by GUI elements (though other elements, such as Timers may also provide events).

Somebody else might know, if there are also event listeners that can be registered for console applications in C#.

share|improve this answer
add comment

Take a look at this event tutorial to understand what is an 'event listner' : Events Tutorial

share|improve this answer
I already took a look at this and could not make much sense of it. Please bear in mind that I am a student with not much in way of programming experience. –  Omar Jun 19 '10 at 10:53
add comment

Your Answer


