Ejemplo n.º 1
0
        /// <summary>
        /// Adds an entry to the game list representing the given game.
        /// </summary>
        /// <param name="g">The game the new entry should represent.</param>
        private void AddGameToList( GameInfo g )
        {
            string catName = g.GetCatStringExcept( gameData.FavoriteCategory, GlobalStrings.MainForm_Uncategorized );

            ListViewItem item;

            // Shortcut games do not show internal identifier
            string strId = ( g.Id < 0 ) ? GlobalStrings.MainForm_External : g.Id.ToString();

            item = new ListViewItem( new string[] { strId, g.Name, catName, g.ContainsCategory( gameData.FavoriteCategory ) ? "X" : String.Empty, g.Hidden ? "X" : String.Empty } );

            item.Tag = g;

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