[]
        
(Showing Draft Content)

服务端命令选择属性

此特性为活字格V9.1新增功能。

在服务端命令中通过名字调用另一个服务端命令。

    public class MyPluginServerCommand : Command, ICommandExecutableInServerSideAsync
    {
        [ServerCommandNameProperty]
        public string MyServerCommandName { get; set; }

        public async Task<ExecuteResult> ExecuteAsync(IServerCommandExecuteContext dataContext)
        {
            await dataContext.ExecuteServerCommandsAsync(this.MyServerCommandName, dataContext);
            return new ExecuteResult();
        }

        public override CommandScope GetCommandScope()
        {
            return CommandScope.ExecutableInServer;
        }
    }

在设计器中效果如下:

image

注意:标注ServerCommandNameProperty的属性类型必须是 string。