public int RemoveFromFavorites(int threadID) { // find threadID // then remove it int removedThreadID = -1; foreach (int thread in FavoriteThreads) { if (thread == threadID) { removedThreadID = thread; FavoriteThreads.Remove(thread); return(removedThreadID); } } return(removedThreadID); }
public Thread RemoveFromFavorites(int threadID) { // find threadID // then remove it Thread removedThread = null; List <Thread> threadList = FavoriteThreads; foreach (Thread thread in FavoriteThreads) { if (thread.ThreadID == threadID) { removedThread = thread; FavoriteThreads.Remove(thread); return(removedThread); } } return(removedThread); }
// METHODS public void AddToFavorites(int threadID) => FavoriteThreads.Add(threadID);
// METHODS public void AddToFavorites(Thread thread) => FavoriteThreads.Add(thread);