public void subscribe(YouTubeChannel toSubscribe) { try { this.subscribedTo.Add(toSubscribe.Name, toSubscribe); toSubscribe.registerObserver(this); } catch (ArgumentException) { Console.WriteLine("You are already subscribed to this channel!"); } }
public void unsubscribe(YouTubeChannel toUnsubscribe) { this.subscribedTo.Remove(toUnsubscribe.Name); toUnsubscribe.removeObserver(this); }