[]
        
(Showing Draft Content)

GrapeCity.Forguncy.Commands.ICommandEditor

接口 ICommandEditor

插件命令数据编辑器。

命名空间: GrapeCity.Forguncy.Commands
程序集: Forguncy.Commands.Design.dll
语法
public interface ICommandEditor
示例

UserControl和自定义插件弹出消息框命令定义如下:

public partial class ShowMessageCommandEditor : UserControl, ICommandEditor
{
    public ShowMessageCommandEditor()
    {
       InitializeComponent();
    }   
public Command Command
{
    get
    {
        return new ShowMessageBoxCommand() { Message = messageTextBox.Text };  //messageTextBox is the name of TextBox in UserControl.
    }
    set
    {
        ShowMessageBoxCommand command = value as ShowMessageBoxCommand;
        if(command != null)
        {
            messageTextBox.Text = command.Message;
        }
    }
}

public bool Validate()
{
    return true;
}

} public class ShowMessageBoxCommand: Command { public string Message { get; set; }

public override ICommandEditor GetCommandEditor() => new ShowMessageCommandEditor();

}

属性

Command

命令数据。

声明
Command Command { get; set; }
属性值
类型 描述
Command

方法

Validate()

编辑器关闭前的数据校验。

声明
bool Validate()
返回值
类型 描述
bool