Table of Contents

IActionService 接口

命名空间
ClassIsland.Core.Abstractions.Services
程序集
ClassIsland.Core.dll

行动服务。负责管理行动提供方、提供行动的运行方法。

public interface IActionService

字段

ActionInfos

所有行动提供方信息。 键为行动提供方 ID,值为行动提供方信息。

public static readonly Dictionary<string, ActionInfo> ActionInfos

字段值

Dictionary<string, ActionInfo>

ActionMenuTree

「添加行动」层叠菜单。 键为菜单元素中文名,值为菜单元素。

public static readonly ActionMenuTreeNodeCollection ActionMenuTree

字段值

ActionMenuTreeNodeCollection

ObsoleteActionHandlers

[Obsolete("注意!行动 v2 注册方法已过时,请参阅 ClassIsland 开发文档进行迁移。")]
public static readonly Dictionary<string, (Type, Action<object, string>?, Action<object, string>?)> ObsoleteActionHandlers

字段值

Dictionary<string, (Type, Action<object, string>, Action<object, string>)>

属性

IListActionMenuTree

列表类型的只读「添加行动」层叠菜单。

public static IReadOnlyList<ActionMenuTreeNode> IListActionMenuTree { get; }

属性值

IReadOnlyList<ActionMenuTreeNode>

方法

InterruptActionSetAsync(ActionSet)

中断行动组运行。此方法会等待行动组运行生命周期结束。

Task InterruptActionSetAsync(ActionSet actionSet)

参数

actionSet ActionSet

返回

Task

InvokeActionSetAsync(ActionSet, bool)

触发行动组。行动错误已被捕获。

Task InvokeActionSetAsync(ActionSet actionSet, bool isRevertable = true)

参数

actionSet ActionSet
isRevertable bool

行动是否将会被恢复。默认为 true。

返回

Task

RegisterActionHandler(string, Action<object, string>)

[Obsolete("注意!行动 v2 注册方法已过时,请参阅 ClassIsland 开发文档进行迁移。")]
void RegisterActionHandler(string id, Action<object, string> i2)

参数

id string
i2 Action<object, string>

RegisterRevertHandler(string, Action<object, string>)

[Obsolete("注意!行动 v2 注册方法已过时,请参阅 ClassIsland 开发文档进行迁移。")]
void RegisterRevertHandler(string id, Action<object, string> i3)

参数

id string
i3 Action<object, string>

RevertActionSetAsync(ActionSet)

恢复行动组。行动错误已被捕获。

Task RevertActionSetAsync(ActionSet actionSet)

参数

actionSet ActionSet

返回

Task