IViewDefinitions.RegisterTextValueCallback(string,string,TextTypes,Func<IShape, TextTypes, string, IModel, string>,Action<IShape, TextTypes, string, IModel, string>) Method
Namespace: NextDesign.Core
Description
Registers a callback function to get/set the value of the specified text of the editor element generated from the editor element definition that can be identified from the specified class.
- It is recommended to call it when Activating the extension.
- The registered value acquisition callback function is called in the following cases.
・The editor element is displayed
・The field value that matches the view definition path is changed in the model referenced by the editor element
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 |
| type | TextTypes | Text type |
| getter | Func<IShape, TextTypes, string, IModel, string> | Callback function for getting text value Callback function specification string get_TextValueFunction(IShape shape, TextTypes type, string textPath, IModel model) - Arguments - shape : IShape ・・・ The shape that owns the label/text to which the style is applied is passed - type : TextTypes ・・・ The type of the target text (enumeration) is passed - textPath : string ...The path string (field name) mapped in the text view definition is passed. - model : IModel ...The model referenced by the editor element to which the tile 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<IShape, TextTypes, 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 - shape : IShape ...The shape that owns the label/text to which the style is applied is passed. - type : TextTypes ...The type of target text (enumeration) is passed. - textPath : string ...The path string (field name) mapped in the text view definition is passed. - model : IModel ...The model referenced by the editor element to which the tile is applied is passed. - value : string ...The text requested to be set as the label text value 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 |
| Duplicate key | ExtensionDuplicationException | If the callback registration key is duplicated |
Annotation
If 11 or more labels are defined, the callback function for getting/setting the text value cannot be applied to the 11th and subsequent labels.