NoticeFrom Custom 方法
创建一条自定义扩展通知,用于上述类型无法覆盖的特殊场景。
Definition
命名空间: Suresking.Utility
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
类型为 Custom 的实例。
程序集: Suresking.Utility (在 Suresking.Utility.dll 中) 版本:1.3.22+a27276bb8ffde055e69ff608e98aafba279e1e99
C#
public static Notice FromCustom(
Object? content
)参数
- content Object
- 自定义数据对象。建议封装完整的上下文信息,避免消费方需要额外查询。
返回值
Notice类型为 Custom 的实例。
备注
此类型应作为最后手段使用。如果某个场景频繁出现,建议扩展 NoticeType
枚举或添加工厂方法,而非持续使用 Custom。
示例
C#
var custom = Notice.FromCustom(new { Source = "PluginA", EventData = ... });