IViewDefinitions.RegisterCompartmentItemTextValueCallback method
Namespace: NextDesign.Core
Description
Registers the value acquisition/setting callback function of the specified compartment item of the editor element generated from the specified editor element definition.
- It is recommended to call it when the extension is activated.
- The trigger for calling the registered value acquisition callback function is as follows. ・ Compartment items are displayed ・ The field value of the model referenced by the compartment item has been changed.
argument
| Name | Type | Description |
|---|---|---|
| elementDef | IElementDef | Editor Element Definition |
| areaPath | string | Compartment partition path |
| getter | Func <INode, int, string, IModel, string> | Callback function for getting text value Callback function specification string get_TextValueFunction (IShape shape, TextTypes type, string textPath, IModel model) -Arguments --node: INode ・ ・ ・ The shape that owns the compartment item to be styled is passed --areaIndex : int ・ ・ ・ Passes the partition index to which the compartment item to be styled belongs --areaPath: string ・ ・ ・ Path string (field) set in the partition definition to which the compartment item to be styled belongs First name) is passed --itemModel: IModel ・ ・ ・ The model referenced by the compartment item to which the style is applied is passed --Return value --string ・ ・ ・ Get result Returns the string treated as -Handling the exception -If the implementation of the callback function throws an exception, the exception is caught and the field value of textPath is used > |
| setter | Action <INode, int, string, IModel, string> | Text value setting callback function Callback function specification void set_TextValueFunction (IShape shape, TextTypes type, string textPath, IModel model, string value) -Arguments --node: INode ・ ・ ・ The shape that owns the compartment item to be styled is passed > --areaIndex: int ・ ・ ・ Passes the partition index to which the compartment item to be styled belongs --areaPath: string ・ ・ ・ Path character set in the partition definition to which the compartment item to be styled belongs Column (field name) is passed --itemModel: IModel ・ ・ ・ The model referenced by the compartment item to be styled is passed --value: string ・ ・ ・ As the text value of the label The requested text is passed -Handling exceptions -If the implementation of the callback function throws an exception, the text settings will be undone |
Return value
- void
Exception
| Name | Exception Class | Description |
|---|---|---|
| Duplicate key | ExtensionDuplicationException | If the callback registration key is duplicated |