tags:

views:

214

answers:

6

in c# what is Event? Is it similar to ActionScript Event ? Is it different? In what?

+8  A: 

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).

This tutorial shows how to declare, invoke, and hook up to events in C# http://msdn.microsoft.com/en-us/library/aa645739%28VS.71%29.aspx

Shaji
+3  A: 

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

An event is a mechanism via which a class can notify its clients when something happens. For example when you click a button, a button-click-event notification is sent to the window hosting the button. Events are declared using delegates.

for more detail : http://www.codeproject.com/KB/cs/csevents01.aspx

Pranay Rana
+1  A: 

as the Event class is passed as a parameter into an event listener I would say EventArgs

Pharabus
+1  A: 

MSDN is an excellent place to start.

Short version: Events are a conceptual nicety that allows simpler implementation of a callback/subscription model for notification.

Greg D
+3  A: 

"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)."

From here: http://msdn.microsoft.com/en-us/library/aa645739(VS.71).aspx

Yes, it is similar to ActionScript Events.

Tod1d
+1  A: 

Event is programming construct by which a class or an object, to be specific, inform(notify) a particular change of state to a list of subscribed objects in a multicast fashion.

yona