Esempio n. 1
0
 static Task AddOrRemoveSubscription(IDeviceListener listener, bool add, DeviceSubscription subscription)
 {
     if (add)
     {
         return(listener.AddSubscription(subscription));
     }
     else
     {
         return(listener.RemoveSubscription(subscription));
     }
 }
 static Task AddOrRemoveSubscription(IDeviceListener listener, bool add, DeviceSubscription subscription)
 {
     try
     {
         if (add)
         {
             return(listener.AddSubscription(subscription));
         }
         else
         {
             return(listener.RemoveSubscription(subscription));
         }
     }
     catch (Exception e)
     {
         Events.FailedToChangeSubscriptionState(e, subscription.ToString(), listener.Identity.Id);
         return(Task.CompletedTask);
     }
 }