Class AlterTextProperty
A view command that allows the user to alter a specifc text value in a multi-line popup text editor with optional formatting. For example:
string myText = "HellowWorld!";
var alter = new AlterTextProperty(View.Displayer,
() => true,
() => myText,
newValue => myText = newValue,
new LemonEdge.Core.Client.CommandDecriptor("Hello", Images.ImageType.LockKey, "Alter the value"),
Support.TextType.NormalText, null);
Inheritance
Implements
Inherited Members
Namespace: LemonEdge.Client.Core.Commands.ViewCommands
Assembly: LemonEdge.ClientCore.dll
Syntax
public class AlterTextProperty : ViewCommand, IHasChildren<EPCommandWithDescriptor>, IHasChildren, IDisposable, IEPCommandWithDescriptor, IEPCommand, ICommand, ICommandDescriptor
Constructors
AlterTextProperty(IRootController, IModelLayoutDisplayer, Func<bool>, Func<string>, Action<string>, ICommandDescriptor, TextType, Type)
Creates a new AlterTextCommand
Declaration
public AlterTextProperty(IRootController root, IModelLayoutDisplayer owner, Func<bool> canExecute, Func<string> initialValue, Action<string> newValue, ICommandDescriptor descriptor, TextType type, Type formulaContextType)
Parameters
Type | Name | Description |
---|---|---|
IRootController | root | |
IModelLayoutDisplayer | owner | The owning host context for this command |
Func<bool> | canExecute | A function that returns true if the text can be altered by the user |
Func<string> | initialValue | The initial value for the text that is to be edited by the user |
Action<string> | newValue | The method that is called when the user has modified the text |
ICommandDescriptor | descriptor | A descriptor to use for the title, icon, etc and other attributes of this command |
TextType | type | The type of the text to be displayed to the user, which enables the view to provide formatting if appropriate |
Type | formulaContextType | If the |
Properties
Description
A user friendly description of this command
Declaration
public override string Description { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
IconID
Declaration
public override Guid IconID { get; }
Property Value
Type | Description |
---|---|
Guid |
Overrides
OverlayIconID
On some clients another image can be overlayed on the bottom right of the main icon (for indicating add, remove, etc)
This optional overlay image can be specified here, either a ImageType or ImageID
Declaration
public override Guid? OverlayIconID { get; }
Property Value
Type | Description |
---|---|
Guid? |
Overrides
Title
The title of this command
Declaration
public override string Title { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
ToolTip
A user friendly tool tip for this command functionality, by default the Description
Declaration
public override string ToolTip { get; }
Property Value
Type | Description |
---|---|
string |
Overrides
Methods
InternalCanExecute(object)
Returns if this command can be executed or not
Declaration
public override bool InternalCanExecute(object parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The command parameter |
Returns
Type | Description |
---|---|
bool | True if this command can be executed |
Overrides
InternalExecuteAsync(object)
Displays a popup text editor window to the user to allow them to edit the value
Declaration
public override Task InternalExecuteAsync(object parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The command parameter |
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the operation |