Skip to main content

Example C# class file

Suggest edit Updated on November 10, 2021

Use a C# class file to implement UI connectors.

The following figure shows an example of a C# class file:

C# class file example
Code snippet showing how to implement a C#class file as a UI
                        connector.

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.

ParameterDescription
UI Connector IDA system-generated GUID that is used to uniquely identify the UI Connector.
VersionAs 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.
AuthorThe 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:

<namespace>.<type>, <assembly>'

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 versionIndicates 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 versionIndicates 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
Did you find this content helpful? YesNo

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us