A.6. Delegates

The syntax for a delegate in C# closely follows the syntax for a method. The delegate statement is followed by the delegates return type (or void , if there is none) and the delegate name . This in turn is followed by the delegates parameter list, in which each parameter takes the form:

<

parameter_type

> <

parameter_name

>

For example:

public delegate void StateChangeEventHandler(object sender,
 StateChangeEventArgs e);

In a VB Delegate statement, the Delegate keyword is followed by the Sub keyword (if the delegate returns a void in C#) or the Function keyword (if the delegate returns some other value). For example, in VB, the StateChangeEventHandler delegate has the following syntax:

Public Delegate Sub StateChangeEventHandler( _
 ByVal sender As Object, ByVal e As StateChangeEventArgs)

Connecting to Data

Retrieving and Managing Data

Searching and Analyzing Data

Adding and Modifying Data

Copying and Transferring Data

Maintaining Database Integrity

Binding Data to .NET User Interfaces

Working with XML

Optimizing .NET Data Access

Enumerating and Maintaining Database Objects

Appendix A. Converting from C# to VB Syntax



ADO. NET Cookbook
ADO.NET 3.5 Cookbook (Cookbooks (OReilly))
ISBN: 0596101406
EAN: 2147483647
Year: 2002
Pages: 222
Authors: Bill Hamilton

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net