Complex Data Types
The data conversion module supports passing complex data types such as arrays (lists) and data tables. The supported .NET types are exposed as common COM types or specific interfaces and types implemented by the conversion module. The supported COM types may be passed to or returned from the methods and properties of .NET controls, to which, as a result of data conversion, these data types appear as the corresponding .NET types.
-
DataTable
, DataView
(both of System.Data) and IEnumerable
(of System.Collection).
- These types appear as
ADODB Recordset
and are used to pass data tables with columns and rows.
IEnumerable
is converted to Recordset because many .NET controls use the IEnumerable interface to pass DataTable objects.
- Add the Microsoft ActiveX Data Objects Library (2.7 or higher) reference when scripting with these date types.
Refer to ADODB documents for the usage of the Recordset interface.
-
List<
short>
, List<
int>
, List<
float>
, List<
double>
, and List<
string>
(all of System.Collections.Generic).
These types, implemented in the data conversion module, appear as:
- ShortList
- IntList
- FloatList
- DoubleList
- StringList
Add the GEIP_Orion_Dataconversion
reference when scripting with these date types.
The ShortList list implements the following interface:
interface IShortList : IDispatch
{
[id(0x60020000), propget]
HRESULT Count([out, retval] long* pRetVal);
[id(0x60020001)]
HRESULT Add([in] short item);
[id(0x60020002)]
HRESULT Clear();
[id(00000000), propget]
HRESULT item(
[in] long index,
[out, retval] short* pRetVal);
[id(00000000), propput]
HRESULT item(
[in] long index,
[in] short pRetVal);
[id(0x60020005)]
HRESULT Insert(
[in] long index,
[in] short item);
[id(0x60020006)]
HRESULT RemoveAt([in] long index);
};
|
All the rest implement basically the same interface, but with different data types (long
for IntList
, etc.) for the item parameter.
-
ArrayList
(of System.Collections).
This displays as ObjectList
, which implements the following interface:
interface IObjectList : IDispatch
{
[id(0x60020000), propget]
HRESULT Count([out, retval] long* pRetVal);
[id(0x60020001)]
HRESULT Add(
[in] VARIANT item,
[out, retval] long* pRetVal);
[id(0x60020002)]
HRESULT Clear();
[id(00000000), propget]
HRESULT item(
[in] long index,
[out, retval] VARIANT* pRetVal);
[id(00000000), propputref]
HRESULT item(
[in] long index,
[in] VARIANT pRetVal);
[id(0x60020005)]
HRESULT Insert(
[in] long index,
[in] VARIANT item);
[id(0x60020006)]
HRESULT RemoveAt([in] long index);
};
|
As the item type here is VARIANT
, this list can pass any convertible types supported by the data conversion module.
For example, list objects can be added to an ObjectList
as list items, resulting a multi- dimensional array.
Add the GEIP_Orion_Dataconversion
reference when scripting with this date type.
Strategies for Parameter Types that Cannot Be Converted
Most commonly used parameter types are converted, so CIMPLICITY screens host and also communicate with the .NET controls through primitive data types and converted parameter types.
However, there will be parameter types that cannot be converted and thus ignored by the current release because the authors of custom .NET controls may use any Framework types and create and use their own types.
In order to avoid the essential properties, methods and events of a .NET control not being exposed, the control author may do the following.
- Rewrite a desired property using the convertible types listed above.
- Separate a desired property into multiple properties of the convertible type.
- Rewrite a method with the convertible types or with more parameters so that each parameter can be converted.
- Define a new event type (delegate) with all parameters convertible and reroute the original event with the new delegate.