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); } } }
public virtual bool RemoveFavorite(StreamClass target) { lock (lockobject_) { if (favoriteStreamClassList_.Exists(x => x == target)) { favoriteStreamClassList_.Remove(target); IsChanged = true; return(true); } else { return(false); } } }
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); } } }