/// <summary> /// Unregisters a message recipient for a given type of messages, for /// a given action and a given token. Other message types will still be transmitted to the /// recipient (if it registered for them previously). Other actions that have /// been registered for the message type TMessage, for the given recipient and other tokens (if /// available) will also remain available. /// </summary> /// <typeparam name="TMessage">The type of messages that the recipient wants /// to unregister from.</typeparam> /// <param name="recipient">The recipient that must be unregistered.</param> /// <param name="token">The token for which the recipient must be unregistered.</param> /// <param name="action">The action that must be unregistered for /// the recipient and for the message type TMessage.</param> public virtual void Unregister <TMessage>(object recipient, object token, Action <TMessage> action) { Messager.UnregisterFromLists <TMessage>(recipient, token, action, this._recipientsStrictAction); Messager.UnregisterFromLists <TMessage>(recipient, token, action, this._recipientsOfSubclassesAction); this.Cleanup(); }
/// <summary> /// Unregisters a messager recipient completely. After this method /// is executed, the recipient will not receive any messages anymore. /// </summary> /// <param name="recipient">The recipient that must be unregistered.</param> public virtual void Unregister(object recipient) { Messager.UnregisterFromLists(recipient, this._recipientsOfSubclassesAction); Messager.UnregisterFromLists(recipient, this._recipientsStrictAction); }