PropertyInfo

Provides runtime reflection metadata on a property.

Remarks

This class has utility methods e.g. validating values of properties, converting property values to strings, and getting the editor id to use for the property. PropertyInfo contains the following properties:

PropertyDescription
ID_displayNameThe natural-language localized display name for the property, or null if there is no known display name.
ID_descriptorA single-letter string that describes the underlying storage type for the property (see below).
ID_valuesIf this is an enum property, then values will be a list of the valid possible values for the enum.
ID_displayNamesIf this is an enum property, then ID_displayNames is a list of the English-language display names for each enum.

The ID_descriptor property indicates the underlying storage type for the property, and can be one of the following:

DescriptorStorage Type
I32-bit int.
D64-bit floating point.
F32-bit floating point.
Zboolean.
TDateTime.
EEnum.
SString.

Methods

addEventHandler (inherited from SitedObject)Adds a delegate to be called when the specified eventId occurs on this object.
equals (inherited from SitedObject)Tests if two objects are equal.
fireEventHandler (inherited from SitedObject)Invokes any user event handlers registered for a particular event using SitedObject.addEventHandler().
getBindingStatus (inherited from SitedObject)Provides debugging information on bindings for this object.
getEditorId Given a PropertyInfo, return the editor ID to use.
getPathValue (inherited from SitedObject)Traverses a binding path and returns the value at the end of it.
getPropertyInfo (inherited from SitedObject)Gets information on a property.
getSite (inherited from SitedObject)Gets this object's site.
getValue (inherited from SitedObject)Gets the value of a property on this object.
onSetValue (inherited from SitedObject)Called by SitedObject.setValue() when a property value is set on this object.
onSited (inherited from SitedObject)Called when this object is sited.
onUnsited (inherited from SitedObject)Called when this object is about to lose its site.
onValueSited (inherited from SitedObject)Called when an object is sited within this object.
onValueUnsited (inherited from SitedObject)Called when an object is about to be unsited in this.
removeEventHandler (inherited from SitedObject)Remove an existing delegate from the list of delegates for the specified event.
setInitialValues (inherited from SitedObject)Sets multiple property values on an object (during initialization only)
setPathValue (inherited from SitedObject)Traverses a binding path and sets the value at the end of it.
setValue (inherited from SitedObject)Sets the value of a property on this object.
stringToValueConverts strVal to an appropriate value for this property.
toString (inherited from SitedObject)Returns a string representation of this object.
validateValidates strVal according to type information in this PropertyInfo.
valueToStringGiven the value of a property associated with this PropertyInfo, return a string representation

PropertyInfo getEditorId method

Given a PropertyInfo, return the editor ID to use.

JavaScript

propertyInfo.getEditorId()

Remarks

Used by the PropertyGrid control.

If this PropertyInfo has an ID_editorId property, the value of that property is returned.

Otherwise, this returns ID_TEXT for strings and number properties, ID_BOOL for boolean properties, ID_DATE for dateTimes, and ID_ENUM for enums.

PropertyInfo stringToValue method

Converts strVal to an appropriate value for this property.

JavaScript

propertyInfo.stringToValue(strVal)

Remarks

This examines the type information held in this property and uses it to convert the string value into an appropriate underlying value. If the string cannot be converted this returns undefined.

PropertyInfo validate method

Validates strVal according to type information in this PropertyInfo.

JavaScript

propertyInfo.validate(strVal)

Remarks

Returns null if the strVal is a valid value for this property. If strVal is invalid, returns a string describing the vaidation error.

PropertyInfo valueToString method

Given the value of a property associated with this PropertyInfo, return a string representation

JavaScript

propertyInfo.valueToString(val)

Remarks

This examines this PropertyInfo and uses it to convert the property value value into an appropriate string. If the string cannot be converted this returns undefined.