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!

__property

Declares a property for the managed class.

__property function-declarator

Remarks

The __property keyword introduces the declaration of a property and can appear in a class, interface, or value type. A property can have a Get function (read only), a Set function (write only), or both (read-write).

For more information on properties in a managed object, see Properties of Managed Objects.

Example

In the following example, a property (Size) is added to the MyClass declaration. The property is then implicitly set and retrieved using the get_Size and set_Size functions:

#using <mscorlib.dll>
#using namespace System;

__gc class MyClass
{
   __property int get_Size() { ... };
   __property void set_Size(int i) { ... };
   // compiler generates a pseudo data member called Size

};

void main()
{
   MyClass* class1;
   Int32 curValue;

   class1->Size = 4;        // calls the set_Size function with value==4
   curValue= class1->Size;  // calls the get_Size function
}

See Also

Managed Extensions for C++ Keywords | C++ Keywords