Click or drag to resize

DataMappingTableEXTENSION, ROWCONTROLTYPE, SETTINGS Class

This class extends DataMappingTable and introduces strong typed row types for main bindings and additional bindings.

This class also adds status / action button logic.
Inheritance Hierarchy

Namespace: CTExtensions.ExportCore.Config.DataMapping
Assembly: CTInterface (in CTInterface.dll) Version: 25.0
Syntax
public abstract class DataMappingTable<EXTENSION, ROWCONTROLTYPE, SETTINGS> : DataMappingTable
where EXTENSION : new(), CTExtension
where ROWCONTROLTYPE : new(), DataMappingRowControl

Type Parameters

EXTENSION
Your extension type
ROWCONTROLTYPE
The Row control type.
SETTINGS
Settings type

The DataMappingTableEXTENSION, ROWCONTROLTYPE, SETTINGS type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyAdditionalBindings Possible additional bindings for this table.
Public propertyIsModified Does any of the rows of this table have Modified status?
Public propertyMainBindings The main controls of this mapping.
Public propertyParentExtension Parent CTExtension
Public propertyStatus Status of this table.
Top
Methods
 NameDescription
Protected methodAllMappingsValid Used to determine if all visible rows are fully defined (IsMappingValid), so a new empty row could be added.
(Overrides DataMappingTableAllMappingsValid)
Public methodButtonClicked Invoked when button is clicked. This implementation handles the TAG_ACTION button press and calls the approriate handler set at UpdateActionButton.
(Overrides DataMappingTableButtonClicked(DataMappingRowControl, String))
Protected methodCanAddNewBinding Return true if new additional binding can be added.
Public methodClearCaches Clear cached selectables
Protected methodCreateNewBindingRow Creates new Additional Binding control to the table. InitNewBinding(ROWCONTROLTYPE) is NOT called after this, so you must populate the values yourself like so:
C#
var row = CreateNewBindingRow();
row.InitProperties(() => 
  {
    row.MyProperty = .... 
  });
Protected methodDeleteSettings Handle deletion of owned Core object if any.
Public methodInit MUST BE CALLED immediately after object creation. Calls Init(Boolean).
Protected methodInitNewBinding Set initial values (e.g. nulls) to all properties of the row. Settings properties to binding within this function will not cause PropertyChanged(DataMappingRowControl, String) event.
Protected methodIsValidForSaving Object is valid for saving if MainBindings is valid.

Note that bindings in AdditionalBindings do NOT have to be valid.
(Overrides DataMappingTableIsValidForSaving)
Protected methodLoadCombosT This function can be used to load the same content to all currently visible controls (except exept if non-null).

This function can be usefull, if you have already set the values to your combos before loading the actual available values. Calling this function will then set non-available values as error selection.
Public methodLoadSettings Load settings for this table. If the settings is not SettingsIsNew(SETTINGS) but existing and loaded, then the table is Locked after loading, and it can be unlocked using TAG_ACTION button.
Protected methodLoadSettingsToTable Load the provided settings to the table. Populate MainBindings and add new AdditionalBindings to populate using CreateNewBindingRow(ROWCONTROLTYPE).

When populating values to your objects, use InitProperties(Action) to avoid PropertyChanged(DataMappingRowControl, String) event during loading.
C#
MainBindings.InitProperties(() =>
{
  MainBindings.Name = settings.CTObject.Name;
  MainBindings.DataSource = settings.Source;
});
Public methodPropertyChanged Invoked when any property is changed. If the changed property is not TAG_STATUS, sets the status to Modified. Then checkes if all mappings are now valid (AllMappingsValid) and if new binding can be added CanAddNewBinding. Adds new empty binding to the end of the table if previous two are true.
If new binding is added InitNewBinding(ROWCONTROLTYPE) is called for it.
(Overrides DataMappingTablePropertyChanged(DataMappingRowControl, String))
Protected methodRemoveBinding Remove given binding for the table. Completely disposes it and its controls, and moves all bindings below it up.
Public methodReset Removes everything and resets this table.
Public methodSave Save this object if it's valid for
Protected methodSaveSettings Save everything from UI to settings. Create new objects if needed etc.
Protected methodSettingsIsNew Return true if the given settings is new, or false if it's loaded.
Protected methodUpdateActionButton Updated the action button and its action based on Status.
Top
Revision History
DateVersionDescription
-2025 SP1First Release
See Also