Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="handler"></param>
 public SubscribeInfo(Func <object> handler) : this(ObserverHandler.CreateA <object>(handler))
 {
 }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="handler"></param>
 public SubscribeInfo(Action handler) : this(ObserverHandler.Create(handler))
 {
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }