/// <summary>
 /// Adds a subscription
 /// </summary>
 /// <param name="type"></param>
 /// <param name="objectId"></param>
 public void AddSubscription(SubscriptionType type, string objectId)
 {
     var sub = new Subscription {SubscriptionType = type, ModelId = objectId};
     switch (type)
     {
         case SubscriptionType.Cloud:
             if (SubscribedClouds.Contains(sub)) return;
             SubscribedClouds.Add(sub);
             break;
         case SubscriptionType.User:
             if (SubscribedUsers.Contains(sub)) return;
             SubscribedUsers.Add(sub);
             break;
     }
 }
 /// <summary>
 /// Loads the subscriptions from the settings file.
 /// </summary>
 public void InitializeSubscriptions()
 {
     var subString = App.Settings["subscriptions"];
     if (string.IsNullOrEmpty(subString)) return;
     foreach (var sub in subString.Split('/'))
     {
         var newSub = new Subscription(sub);
         switch (newSub.SubscriptionType)
         {
             case SubscriptionType.Cloud:
                 SubscribedClouds.Add(newSub);
                 break;
             case SubscriptionType.User:
                 SubscribedUsers.Add(newSub);
                 break;
         }
     }
 }
 public void AddSubscription(Subscription subscription)
 {
     
     switch (subscription.SubscriptionType)
     {
         case SubscriptionType.Cloud:
             if (SubscribedClouds.Contains(subscription)) return;
             SubscribedClouds.Add(subscription);
             break;
         case SubscriptionType.User:
             if (SubscribedUsers.Contains(subscription)) return;
             SubscribedUsers.Add(subscription);
             break;
     }
 }
 /// <summary>
 /// Removes a subscription
 /// </summary>
 /// <param name="subscription"></param>
 public void RemoveSubscription(Subscription subscription)
 {
     if (SubscribedClouds.Contains(subscription)) SubscribedClouds.Remove(subscription);
     if (SubscribedUsers.Contains(subscription)) SubscribedUsers.Remove(subscription);
 }