Interview questions

Events and Delegates

Events and Delegates in Remoting Applications
<<Previous  Next >>

By Nishant Kumar  

Events are one of the members of the class. When any noteworthy activity occurs in the application, an event is raised which sends out the message to the other part of the application which handles the event. The event can carry arguments that contain information about the event. The method which handles the event must have the same signature as the event itself. Events are commonly used in the applications with graphical user interface elements such as buttons, textbox etc. An event is triggered when any action such as mouse click occurred in the interface element. The event-based programming model can be used in the non-GUI applications such as .NET Remoting application. An event in remoting.net occurs when the state of the application changes.

A delegate acts like a strongly type function pointer. Delegates can invoke the methods that they reference without making explicit calls to those methods. It is type safe since it holds reference of only those methods that match its signature. Unlike other classes, the delegate class has a signature. Delegates are used to implement event programming model in .NET application. Delegates enable the methods that listen for an event, to be abstract.

Steps to implement delegate to listen for events in the remoting application

Define a delegate that wraps an event handler method to handle the event.
Implement a class that raises the event.
Implement class that handles the event.


<<Previous  Next >>

Also read

Explain the use of data adapter.

The data adapter objects connect a command objects to a Dataset object..............

What are basic methods of Dataadapter?

This method executes the SelectCommand to fill the DataSet object with data from the data source...........

What is Dataset object? Explain the various objects in Dataset?

The DataSet object is a disconnected storage. It is used for manipulation of relational data.............

Visual Studio 2005 Improvements

Visual Studio 2005 is the best development tool for building data-driven web applications. As part of the Visual Studio 2005 suite of tools, Microsoft is introducing a new tool called Visual Web Developer (VWD) that is designed to work with the current and next generation of ASP.NET. VWD provides powerful new features for the web developer.................

ASP.NET 2.0 Security Controls

With ASP.NET 2.0, things have changed for the better. For security-related functionalities, ASP.NET 2.0 introduces a wide range of new controls..............



Write your comment - Share Knowledge and Experience


Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring