/// <summary> /// Open the currently selected TV show in Windows Explorer. /// </summary> private void OpenSelectedTVShowInExplorer() { if (TVListBox.SelectedIndex != -1) { TVShow selection = (TVShow)TVListBox.SelectedItem; selection.OpenInExplorer(); } }
/// <summary> /// Compares this TVShow to another. /// Used for sorting. /// </summary> /// <param name="obj">Object to compare this to.</param> /// <returns> /// less than 0 if this.Name() is alphabetically before the other. /// 0 if this and other have the same name. /// greater than 0 if this.Name() is alphabetically after the other. /// </returns> public int CompareTo(object obj) { if (obj == null) { return(1); } TVShow inShow = (TVShow)obj; if (inShow != null) { return(this.Name().CompareTo(inShow.Name())); } else { throw new ArgumentException("Object is not a TVShow."); } }