cohtml.Net.Property
Represents a property of a type exposed to the scripting. This interface type-erases access to a native property so the SDK can interact with it without knowing its concrete C++ type. All virtual methods in this interface must be implemented by derived Property classes for data binding to function correctly. Conversion methods ( ToString , ToBool , ToNumber , etc.) are invoked by the SDK only when a conversion is actually required; not all properties are expected to support every conversion, and unsupported conversions should simply fail gracefully. The Bind and Read methods perform the actual data exchange with the script. When the SDK requires knowledge of the underlying native type for type-sensitive operations such as expression evaluation, it obtains it through BindValue() using a dummy binder that does not expose the value to the script.
Inherits from SystemIDisposable
Inherited by cohtml.Net.UnityProperty
Public Functions
| Name | |
|---|---|
| virtual void | Dispose() |
| Property(string name, bool isByRef) | |
| Property(string name) | |
| string | GetName() Get the name of the property. |
| bool | IsByRef() Can this property be exported By-Ref. Temporaries can not be exported by reference. |
| virtual global.System.IntPtr | Bind(System.IntPtr binder, global.System.IntPtr arg1) Expose the property’s name and value to a binder. |
| virtual global.System.IntPtr | BindValue(System.IntPtr binder, global.System.IntPtr arg1) Expose only the value of the property to a binder. |
| virtual global.System.IntPtr | Read(System.IntPtr binder, global.System.IntPtr arg1) Read the value from a binder. |
| virtual global.System.IntPtr | ReadValue(System.IntPtr binder, global.System.IntPtr arg1) Read only the value of the property from a binder. |
| virtual Property | Clone() Clone the property. |
| virtual bool | ToBoolean(global.System.IntPtr arg0, System.IntPtr boolean) Convert the property value to a boolean. |
| virtual bool | ToNumber(global.System.IntPtr arg0, System.IntPtr number) Convert the property value to a number. |
| virtual bool | ToDouble(global.System.IntPtr arg0, System.IntPtr number) |
| virtual bool | ToString(global.System.IntPtr arg0, System.IntPtr buffer, System.IntPtr length) Convert the property value to a string representation. |
| virtual bool | ToColor(global.System.IntPtr arg0, System.IntPtr color) Convert the property value to a color value. Implementation is optional. Provides improved performance for data-bind-style-* attributes that accept color values, such as background-color. |
| virtual bool | ToTransformMatrix2D(global.System.IntPtr arg0, float [] matrix) Convert the property value to a matrix. Implementation is optional. Provides improved performance for data-bind-style-transform2d. |
| virtual bool | ToArray(System.IntPtr binder, global.System.IntPtr arg1, ArrayInfo arrayInfo) Convert the property value to an array type information. Conversion should succeed only when the underlying type is an array. |
| virtual bool | ToPair(System.IntPtr binder, global.System.IntPtr arg1, PairInfo pairInfo) Convert the property value to a pair type information. Conversion should succeed only when the underlying type is a pair. |
| virtual bool | ToMap(System.IntPtr binder, global.System.IntPtr arg1, MapInfo mapInfo) Convert the property value to a map type information. Conversion should succeed only when the underlying type is a map. |
| virtual bool | ToObject(System.IntPtr binder, global.System.IntPtr arg1, ObjectInfo typeInfo) Convert the property value to an object type information. Conversion should succeed only when the underlying type is an object (UserType). |
| delegate global.System.IntPtr | SwigDelegateProperty_0(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr swigId) |
| delegate global.System.IntPtr | SwigDelegateProperty_1(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr swigId) |
| delegate global.System.IntPtr | SwigDelegateProperty_2(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr swigId) |
| delegate global.System.IntPtr | SwigDelegateProperty_3(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr swigId) |
| delegate global.System.IntPtr | SwigDelegateProperty_4(global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_5(global.System.IntPtr arg0, System.IntPtr boolean, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_6(global.System.IntPtr arg0, System.IntPtr number, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_7(global.System.IntPtr arg0, System.IntPtr number, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_8(global.System.IntPtr arg0, System.IntPtr buffer, System.IntPtr length, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_9(global.System.IntPtr arg0, System.IntPtr color, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_10(global.System.IntPtr arg0, float [] matrix, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_11(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr arrayInfo, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_12(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr pairInfo, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_13(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr mapInfo, global.System.IntPtr swigId) |
| delegate bool | SwigDelegateProperty_14(System.IntPtr binder, global.System.IntPtr arg1, global.System.IntPtr typeInfo, global.System.IntPtr swigId) |
Protected Attributes
| Name | |
|---|---|
| bool | swigCMemOwn |
Public Functions Documentation
function Dispose
virtual void Dispose()
Reimplemented by: cohtml.Net.UnityProperty.Dispose
function Property
Property(
string name,
bool isByRef
)
function Property
Property(
string name
)
function GetName
string GetName()
Get the name of the property.
Return: the name of the property
function IsByRef
bool IsByRef()
Can this property be exported By-Ref. Temporaries can not be exported by reference.
Return: true if the property can be exported safely by reference.
function Bind
virtual global.System.IntPtr Bind(
System.IntPtr binder,
global.System.IntPtr arg1
)
Expose the property’s name and value to a binder.
Parameters:
- binder - the binder to use
Return: - adjusted object pointer if necessary
function BindValue
virtual global.System.IntPtr BindValue(
System.IntPtr binder,
global.System.IntPtr arg1
)
Expose only the value of the property to a binder.
Parameters:
- binder - the binder to use
Return: - adjusted object pointer if necessary
Note: This method should always bind a value. If there is no valid value, the implementation must call binder->BindNull();
function Read
virtual global.System.IntPtr Read(
System.IntPtr binder,
global.System.IntPtr arg1
)
Read the value from a binder.
Parameters:
- binder - the binder to use
Return: - adjusted object pointer if necessary
function ReadValue
virtual global.System.IntPtr ReadValue(
System.IntPtr binder,
global.System.IntPtr arg1
)
Read only the value of the property from a binder.
Parameters:
- binder - the binder to use
Return: - adjusted object pointer if necessary
function Clone
virtual Property Clone()
Clone the property.
Return: a heap allocated copy of the property
function ToBoolean
virtual bool ToBoolean(
global.System.IntPtr arg0,
System.IntPtr boolean
)
Convert the property value to a boolean.
Parameters:
- boolean - where to store the property value
Return: true if conversion is possible and successful
function ToNumber
virtual bool ToNumber(
global.System.IntPtr arg0,
System.IntPtr number
)
Convert the property value to a number.
Parameters:
- number - where to store the property value
Return: true if conversion is possible and successful
function ToDouble
virtual bool ToDouble(
global.System.IntPtr arg0,
System.IntPtr number
)
function ToString
virtual bool ToString(
global.System.IntPtr arg0,
System.IntPtr buffer,
System.IntPtr length
)
Convert the property value to a string representation.
Parameters:
- length - input/output parameter; on input, specifies the size of buffer in bytes; on output, receives the total size required to store the full string (not including any null terminator)
Return: true if conversion is possible and successful
Note: The function writes up to *length bytes into buffer. These may or may not include a null terminator. The caller should append \0'" if required. If the returned size is greater than the provided buffer capacity, the caller should allocate a larger buffer and call again.