/// <summary> /// Handler when a query has been sent by the user. Clears any genre selection and raises QuerySent event /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="e"> /// A <see cref="EventArgs"/> /// </param> void OnViewQuerySent(object sender, EventArgs e) { GenreListModel model = genre_view.Model as GenreListModel; model.Selection.Clear(true); RaiseQuerySent(query_input.Text.Trim()); }
/// <summary> /// Set a new Genre list in the genre choose box /// </summary> /// <param name="newlist"> /// A <see cref="List<Genre>"/> -- the list of new genres /// </param> public void UpdateGenres(List <Genre> newlist) { GenreListModel model = genre_view.Model as GenreListModel; model.SetList(newlist); }
/// <summary> /// Handler when a genre has been selected by the user. Raises the GenreSelected event for the selected genre /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> -- not used /// </param> /// <param name="e"> /// A <see cref="EventArgs"/> -- not used /// </param> void OnViewGenreSelected(object sender, EventArgs e) { GenreListModel model = genre_view.Model as GenreListModel; RaiseGenreSelected(model[genre_view.Model.Selection.FocusedIndex]); }
/// <summary> /// Returns the genre entry which currently has focus in the genre choose box /// </summary> /// <returns> /// A <see cref="Genre"/> -- the focused genre /// </returns> public Genre GetSelectedGenre() { GenreListModel model = genre_view.Model as GenreListModel; return(model[genre_view.Model.Selection.FocusedIndex]); }