Пример #1
0
 public async Task Any(PostObjectToChannel request)
 {
     if (request.ToUserId != null)
     {
         if (request.CustomType != null)
         {
             await ServerEvents.NotifyUserIdAsync(request.ToUserId, request.Selector ?? Selector.Id <CustomType>(), request.CustomType);
         }
         if (request.SetterType != null)
         {
             await ServerEvents.NotifyUserIdAsync(request.ToUserId, request.Selector ?? Selector.Id <SetterType>(), request.SetterType);
         }
     }
     else
     {
         if (request.CustomType != null)
         {
             await ServerEvents.NotifyChannelAsync(request.Channel, request.Selector ?? Selector.Id <CustomType>(), request.CustomType);
         }
         if (request.SetterType != null)
         {
             await ServerEvents.NotifyChannelAsync(request.Channel, request.Selector ?? Selector.Id <SetterType>(), request.SetterType);
         }
     }
 }
Пример #2
0
 public void Any(PostObjectToChannel request)
 {
     if (request.ToUserId != null)
     {
         if (request.CustomType != null)
             ServerEvents.NotifyUserId(request.ToUserId, request.Selector ?? Selector.Id<CustomType>(), request.CustomType);
         if (request.SetterType != null)
             ServerEvents.NotifyUserId(request.ToUserId, request.Selector ?? Selector.Id<SetterType>(), request.SetterType);
     }
     else
     {
         if (request.CustomType != null)
             ServerEvents.NotifyChannel(request.Channel, request.Selector ?? Selector.Id<CustomType>(), request.CustomType);
         if (request.SetterType != null)
             ServerEvents.NotifyChannel(request.Channel, request.Selector ?? Selector.Id<SetterType>(), request.SetterType);
     }
 }