using System; using System.Collections.Generic; namespace Model { /// /// 搭配MessageComponent用来分发消息 /// public class MessageHandlerAttribute : Attribute { private HashSet AppTypes { get; } = new HashSet(); public MessageHandlerAttribute(params AppType[] appTypes) { foreach (AppType appType in appTypes) { this.AppTypes.Add(appType); } } public bool Contains(AppType appType) { return this.AppTypes.Contains(appType); } } }