public void AttachOnlyOneHandler(Func <Message, Message> handler) { if (FormatterMsgEvent != null) { foreach (var del in FormatterMsgEvent.GetInvocationList()) { FormatterMsgEvent -= (Func <Message, Message>)del; } } FormatterMsgEvent += handler; }
public bool FormatterMsgEventIsSubscribed(Func <Message, Message> d) { return(FormatterMsgEvent.GetInvocationList().Contains(d)); }