예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="handler"></param>
 public SubscribeInfo(Func <object> handler) : this(ObserverHandler.CreateA <object>(handler))
 {
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="handler"></param>
 public SubscribeInfo(Action handler) : this(ObserverHandler.Create(handler))
 {
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="bus"></param>
 /// <param name="topic">消息主题</param>
 /// <param name="handler">处理器</param>
 public static void Unsubscribe(this IMessageBus bus, string topic, Action handler)
 {
     Guard.NotNull(bus, "bus");
     Guard.NotNull(handler, "handler");
     bus.Unsubscribe(topic, null, ObserverHandler.Create(handler));
 }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TData"></typeparam>
 /// <param name="bus"></param>
 /// <param name="handler">处理器</param>
 public static void Unsubscribe <TData>(this IMessageBus bus, Action <TData> handler)
 {
     Guard.NotNull(bus, "bus");
     Guard.NotNull(handler, "handler");
     bus.Unsubscribe(null, typeof(TData), ObserverHandler.Create1 <TData>(handler));
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TData"></typeparam>
 ///  <typeparam name="TResult"></typeparam>
 /// <param name="bus"></param>
 /// <param name="topic">消息主题</param>
 /// <param name="handler">处理器</param>
 public static void Unsubscribe <TData, TResult>(this IMessageBus bus, string topic, Func <object, TData, TResult> handler)
 {
     Guard.NotNull(bus, "bus");
     Guard.NotNull(handler, "handler");
     bus.Unsubscribe(topic, typeof(TData), ObserverHandler.CreateC <TData, TResult>(handler));
 }
예제 #6
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TResult"></typeparam>
 /// <param name="bus"></param>
 /// <param name="topic">消息主题</param>
 /// <param name="handler">处理器</param>
 public static void Unsubscribe <TResult>(this IMessageBus bus, string topic, Func <TResult> handler)
 {
     Guard.NotNull(bus, "bus");
     Guard.NotNull(handler, "handler");
     bus.Unsubscribe(topic, null, ObserverHandler.CreateA(handler));
 }
예제 #7
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TData"></typeparam>
 /// <typeparam name="TResult"></typeparam>
 /// <param name="bus"></param>
 /// <param name="handler">处理器</param>
 public static void Unsubscribe <TData, TResult>(this IMessageBus bus, Func <TData, TResult> handler)
 {
     Guard.NotNull(bus, "bus");
     Guard.NotNull(handler, "handler");
     bus.Unsubscribe(null, typeof(TData), ObserverHandler.CreateB <TData, TResult>(handler));
 }