This document is archived and information here might be outdated. Recommended version. |
Custom property.
[Visual Basic .NET]
Public Property CustomProperty As Object
[C#]
public object CustomProperty {get; set;}
[C++]
HRESULT get_CustomProperty(
Variant* CustomProperty
);
[C++]
HRESULT put_CustomProperty(
VARIANT CustomProperty
);
[C++] Parameters CustomProperty [out, retval]
CustomProperty is a parameter of type VARIANT* CustomProperty [in]
CustomProperty is a parameter of type VARIANT
CustomProperty is a place for developers to attach custom objects to an element. Previous versions of the software required that the specified variant be of type VT_UNKNOWN, i.e. a reference to an object, but that requirement has since been removed. Now, the CustomProperty can also be a simple type like an integer, double, boolean (VARIANT_BOOL) or a string (BSTR).
When this property is an object reference, the object must implement a persistence interface, so if you write a custom object it must implement IPersistStream or IPersistVariant. As an alternative to writing a custom object, you can use a PropertySet or XMLPropertySet, since they both already implement IPersistStream.
CustomProperty is never used by the core ArcObjects for its own elements, but the core software will expect to find an IPersistStream or IPersistVariant interface when the this property is an object reference, and it is part of an element being retrieved from or stored in an .mxd file.