NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

8.6 Properties

Properties are a natural extension of data members — both are named members with associated types, and the syntax for accessing data members and properties is the same. However, unlike data members, properties do not denote storage locations. Instead, properties have accessors that specify the statements to execute in order to read or write their values.

If no type is specified, the type of a property is implicitly Object. A property declaration may contain either a getter, which retrieves the value of the property, a setter, which stores the value of the property, or both. Because a property implicitly declares methods, a property may be declared with the same modifiers as a method. If the property is abstract, the property body and the End statement must be omitted.

The index parameter list makes up the signature of the property, and so properties may be overloaded on index parameters but not on the type of the property. There is one special exception to this rule: because there may be ambiguity in an index expression between a parameterless property that returns an array (or a value with an indexed property) and an indexed property, it is not legal to overload a non-indexed property with an indexed property. The index parameter list is the same as for a regular method, with the exception that none of the parameters may be decorated with the ByRef modifier.

A property may be declared as follows:

When a derived type shadows a property, the derived property hides the shadowed property with respect to both reading and writing. The accessibility domain of the return type or parameter types must be the same as or a superset of the accessibility domain of the property itself. A property may only have one setter and one getter.

PropertyMemberName ::= QualifiedIdentifier
PropertyMemberDeclaration ::=
 PropertyModifier+ Property [ Attributes ] Identifier [ ( [ FormalParameterList ] ) ]
  [ As TypeName ] [ MethodImplementsClause ] LineTerminator
 PropertyAccessorDeclaration+

 [ End Property LineTerminator ]
PropertyModifier ::= ProcedureModifier | Default | ReadOnly | WriteOnly
PropertyAccessorDeclaration ::= PropertyGetDeclaration | PropertySetDeclaration