GetCatString() public méthode

Gets a string listing the game's assigned categories.
public GetCatString ( string ifEmpty = "", bool includeFavorite = false ) : string
ifEmpty string Value to return if there are no categories
includeFavorite bool If true, include the favorite category.
Résultat string
Exemple #1
0
 private void GameDlg_Load(object sender, EventArgs e)
 {
     if (editMode)
     {
         Text                = GlobalStrings.DlgGame_EditGame;
         txtId.Text          = Game.Id.ToString();
         txtName.Text        = Game.Name;
         txtCategory.Text    = Game.GetCatString();
         chkFavorite.Checked = Game.IsFavorite();
         chkHidden.Checked   = Game.Hidden;
         txtId.ReadOnly      = true;
     }
     else
     {
         Text = GlobalStrings.DlgGame_CreateGame;
     }
 }
 private void GameDlg_Load(object sender, EventArgs e)
 {
     if (editMode)
     {
         Text                = GlobalStrings.DlgGame_EditGame;
         txtId.Text          = Game.Id.ToString(CultureInfo.CurrentCulture);
         txtName.Text        = Game.Name;
         txtHoursPlayed.Text = Game.HoursPlayed.ToString(CultureInfo.CurrentCulture);
         txtCategory.Text    = Game.GetCatString();
         txtExecutable.Text  = Game.Executable;
         chkFavorite.Checked = Game.IsFavorite();
         chkHidden.Checked   = Game.IsHidden;
         txtId.ReadOnly      = true;
     }
     else
     {
         Text = GlobalStrings.DlgGame_CreateGame;
     }
 }
        /// <summary>
        /// Creates a ListViewItem for the given game.
        /// </summary>
        /// <param name="g">The game the new entry should represent.</param>
        private ListViewItem CreateListItem( GameInfo g ) {

            ListViewItem item = new ListViewItem( new string[] {
                ( g.Id < 0 ) ? GlobalStrings.MainForm_External : g.Id.ToString(),
                g.Name,
                g.GetCatString( GlobalStrings.MainForm_Uncategorized ),
                g.IsFavorite() ? "X" : String.Empty,
                g.Hidden ? "X" : String.Empty
            } );

            // Shortcut games show with italic font. 
            if( g.Id < 0 ) item.Font = new Font( item.Font, item.Font.Style | FontStyle.Italic );

            return item;
        }