Exemple #1
0
 public virtual bool AddFavorite(StreamClass newFavorite)
 {
     lock (lockobject_)
     {
         if (!favoriteStreamClassList_.Exists(x => x.Owner == newFavorite.Owner))
         {
             favoriteStreamClassList_.Add(newFavorite);
             IsChanged = true;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Exemple #2
0
 public virtual bool RemoveFavorite(StreamClass target)
 {
     lock (lockobject_)
     {
         if (favoriteStreamClassList_.Exists(x => x == target))
         {
             favoriteStreamClassList_.Remove(target);
             IsChanged = true;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Exemple #3
0
 public virtual bool RemoveFavorite(string target)
 {
     lock (lockobject_)
     {
         StreamClass sc = favoriteStreamClassList_.FirstOrDefault(x => x.Owner == target);
         if (sc != null)
         {
             favoriteStreamClassList_.Remove(sc);
             IsChanged = true;
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }