private void ServiceListGamesCompleted(object sender, ListGamesCompletedEventArgs e) { if (e != null) { if ((e.Error != null) || (e.Result == null)) { MessageBox.Show(this, "Unable to contact the service. Please try again later.", "PSP Player"); return; } _gameList = e.Result; } Game[] games = _gameList; this.titleView.Rows.Clear(); foreach (Game game in games) { DataGridViewRow row = new DataGridViewRow(); row.Tag = game; { DataGridViewLinkCell cell = new DataGridViewLinkCell(); cell.Value = game.Title; row.Cells.Add(cell); } { DataGridViewLinkCell cell = new DataGridViewLinkCell(); if (game.Website != null) { cell.Value = "Visit Website"; } else { } row.Cells.Add(cell); } { DataGridViewImageCell cell = new DataGridViewImageCell(); cell.Value = _googleIcon; row.Cells.Add(cell); } this.titleView.Rows.Add(row); } this.titleView.Sort(this.TitleColumn, ListSortDirection.Ascending); _outstandingRefresh = false; }
private void ServiceListGamesCompleted( object sender, ListGamesCompletedEventArgs e ) { if( e != null ) { if( ( e.Error != null ) || ( e.Result == null ) ) { MessageBox.Show( this, "Unable to contact the service. Please try again later.", "PSP Player" ); return; } _gameList = e.Result; } Game[] games = _gameList; this.titleView.Rows.Clear(); foreach( Game game in games ) { DataGridViewRow row = new DataGridViewRow(); row.Tag = game; { DataGridViewLinkCell cell = new DataGridViewLinkCell(); cell.Value = game.Title; row.Cells.Add( cell ); } { DataGridViewLinkCell cell = new DataGridViewLinkCell(); if( game.Website != null ) { cell.Value = "Visit Website"; } else { } row.Cells.Add( cell ); } { DataGridViewImageCell cell = new DataGridViewImageCell(); cell.Value = _googleIcon; row.Cells.Add( cell ); } this.titleView.Rows.Add( row ); } this.titleView.Sort( this.TitleColumn, ListSortDirection.Ascending ); _outstandingRefresh = false; }