IViewDefinitions.RegisterCompartmentItemTextValueCallback(string,string,string,Func<INode, int, string, IModel, string>,Action<INode, int, string, IModel, string>) Method
Namespace: NextDesign.Core
Description
Registers a callback function to get/set the value of a specified compartment item of an editor element generated from an editor element definition that can be identified from a specified class.
- It is recommended to call this when activating an extension.
- The registered callback function for getting the value is called in the following cases.
・The compartment item is displayed
・The field value of the model referenced by the compartment item is changed
Note that if the editor element definition cannot be identified from the specified class, nothing is done.
Arguments
| Name | Type | Description |
|---|---|---|
| editorModelClassName | string | Model class name of editor |
| elementModelClassName | string | Model class name of editor element |
| areaPath | string | Path of compartment area |
| 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 which the style is applied is passed - areaIndex : int ・・・ The compartment index to which the compartment item to which the style is applied belongs is passed - areaPath : string ...The path string (field name) set in the partition definition to which the compartment item to which the style is applied belongs is passed. - itemModel : IModel ...The model referenced by the compartment item to which the style is applied is passed. - Return value - string ...Returns the string to be treated as the result of Get. - Exception handling - If an exception is thrown in the implementation of the callback function, the exception is caught and the textPath field value is used. |
| setter | Action<INode, int, string, IModel, string> | Callback function for setting text value 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 which the style is applied is passed. - areaIndex : int ...The area index of the compartment item to which the style is applied belongs is passed. - areaPath : string ...The path string (field name) set in the area definition to which the compartment item to which the style is applied belongs is passed. - itemModel : IModel ...The model referenced by the compartment item to which the style is applied is passed. - value : string ...The text requested to be set as the text value of the label is passed. - Exception handling - If an exception is thrown in the implementation of the callback function, the text setting is canceled. |
Return value
- void
Exception
| Name | Exception class | Description |
|---|---|---|
| Invalid argument | ExtensionArgumentException | If null or an empty string is specified for editorModelClassName If elementModelClassName is specified If null or an empty string is specified If areaPath is null or an empty string is specified |
| Duplicate key | ExtensionDuplicationException | If the callback registration key is duplicated |