Example C# class file
Use a C# class file to implement UI connectors.
The following figure shows an example of a C# class file:
The system generates the UI Connector class with the following attributes:
ToolboxItemAttribute
— Indicates to Microsoft Visual Studio that this class should not be added to the toolbox.ExpressTranslatorAttribute
— Provides information about the UI Connector.
Parameter | Description |
UI Connector ID | A system-generated GUID that is used to uniquely identify the UI Connector. |
Version | As subsequent versions of the UI Connector are released, update this value so that projects using the UI Connector can determine if they have the latest version. |
Author | The author of the UI Connector. |
NativeTypeAttribute
— Describes the native type that is supported by the
UI Connector.
Native control type name | This value is critical because it determines which native controls the UI Connectorsupports. The UI Connector applies to controls that inherit from this type as well. You could, however, create another UI Connector for a child class and it would take precedence, because it supports a more specific implementation of the control. In .NET, this type is in this format:
Some libraries change the assembly name of each control version (as shown in the C# class file example). Because UI Connectors operate using reflection, a UI Connector is likely to operate against multiple versions of a control. To manage this, remove the assembly name. This indicates that the UI Connector applies to any control that has a matching type name, regardless of the assembly name. |
Minimum version | Indicates the minimum version of the native control supported by the UI Connector. Set this parameter to the lowest supported version or leave it blank to indicate that all versions prior to the maximum version are supported. |
Maximum version | Indicates the maximum version of the native control supported by the UI Connector. Set this parameter to the highest supported version or leave it blank to indicate that all versions after the minimum version are supported. |
The following example shows support for all native control versions:
NativeTypeAttribute(“DevExpres.XtraEditors.ComboBoxEdit”, “”, “”0
Previous topic Creating UI connectors Next topic Example JSON file