ObjectFieldLinkProvider - HxGN EAM - 12.0.1 - Customization & Programming - Hexagon

HxGN EAM Web Services Toolkit Programmer

Language
English
Product
HxGN EAM
Search by Category
Customization & Programming
HxGN EAM Version
12.0.1

This component allows the developer to designate what object field the control should use to read and store the entered data. It provides extender properties to the controls by implementing the IExtenderProvider interface. See the ErrorProvider component that comes with Visual Studio for more details.

The properties provided are as follows:

  • ObjectFieldName - Name of the field to which to link the value.

    The field names are case-sensitive and must match the case of the object field exactly. Example: Assume you have a TextBox named EquipmentTextBox and one named EquipOrgTextBox, and you want to link their contents with that of an instance of WorkOrderData named WOData.

    • Drop an ObjectFieldLinkProvider component onto your form and name it LinkProvider.

    • Now set the ObjectFieldName property for the EquipTextBox to "Equipment.Item" and set EquipOrgTextBox to "Equipment.Org".

    • Call LinkProvider.CopyValuesToControls(WOData) to load the controls with the data from the object or call LinkProvider.CopyValuesFromControls to store the data from the controls to the object.

  • DefaultFromControl - Value to use if the control's "Text" property is empty.

  • DefaultToControl - Value to use if the object's value is empty.

  • OverrideFromControl - Value to send to object regardless of the control's "Text" property contents.

  • OverrideToControl - Value to send to the control regardless of the object's value.

See Appendix B - Diagrams.

To use this component from the Form designer, you will need to add it to the Visual Studio Toolbox

by selecting the Add/Remove Items… menu item from the Toolbox's context menu. From the dialog, click the Browse… button, and then select the Datastream.WinForms.dll assembly. Click OK to display an ObjectFieldLinkProvider at the bottom of the Toolbox.

You may need to scroll down to view the ObjectFieldLinkProvider.

After adding the component to the Toolbox, you can simply drag and drop to the Form designer like you do with any other component. Once this is done, the controls on your form will have the five new properties listed above.