示例#1
0
        /// <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());
        }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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]);
        }
示例#4
0
        /// <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]);
        }