
474
|
Chapter 22: Converting from C# to VB Syntax
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Structures
C# uses the struct statement along with opening and closing braces to indicate the
beginning and end of a structure definition. For example:
public struct DataGridCell {
// member definitions
}
In VB, a structure definition is indicated by the Structure... End Structure
construct:
Public Structure DataGridCell
' member definitions
End Structure
C# uses the colon with structures to indicate interface implementation. Any
implemented interfaces are part of the
class statement. In VB, any implemented
interfaces are specified by an
Implements statement on the line immediately
following the
Structure statement. However, none of the structures documented
in the reference section of this book use interface inheritance.
Interfaces
C# uses the interface statement along with opening and closing braces to indicate
the beginning and end of an interface definition. For example:
public interface IUIService {
// member definitions
}
In VB, an interface definition is indicated by the Interface... End Structure
construct:
Public Interface IUIService
' member definitions
End Interface
C# uses the colon with interfaces to specify any implemented interfaces. For
example:
public interface ISite : IServiceProvider
In VB, any implemented interfaces are specified ...