Permalink
Browse files

More fixes to the game list in SAM.Picker.

  • Loading branch information...
gibbed committed Nov 24, 2017
1 parent 97fee70 commit 26f436df63225adf935611ff5104ef16f47443e0
Showing with 15 additions and 22 deletions.
  1. +5 −20 SAM.Picker/GameInfo.cs
  2. +10 −2 SAM.Picker/GamePicker.cs
View
@@ -21,44 +21,29 @@
*/
using System.Globalization;
using System.Windows.Forms;
namespace SAM.Picker
{
internal class GameInfo
{
private string _Name;
public uint Id;
public string Type;
public ListViewItem Item;
public int ImageIndex;
#region public string Name;
public string Name
{
get { return this.Item.Text; }
set { this.Item.Text = value ?? "App " + this.Id.ToString(CultureInfo.InvariantCulture); }
}
#endregion
#region public int ImageIndex;
public int ImageIndex
{
get { return this.Item.ImageIndex; }
set { this.Item.ImageIndex = value; }
get { return this._Name; }
set { this._Name = value ?? "App " + this.Id.ToString(CultureInfo.InvariantCulture); }
}
#endregion
public string Logo;
public GameInfo(uint id, string type)
{
this.Id = id;
this.Type = type;
this.Item = new ListViewItem()
{
Tag = this,
};
this.Name = null;
this.ImageIndex = 0;
this.Logo = null;
View
@@ -171,7 +171,10 @@ private void RefreshGames()
this._GameListView.BeginUpdate();
this._GameListView.VirtualListSize = this._FilteredGames.Count;
this._GameListView.RedrawItems(0, this._FilteredGames.Count - 1, true);
if (this._FilteredGames.Count > 0)
{
this._GameListView.RedrawItems(0, this._FilteredGames.Count - 1, true);
}
this._GameListView.EndUpdate();
this._PickerStatusLabel.Text = string.Format(
"Displaying {0} games. Total {1} games.",
@@ -181,7 +184,12 @@ private void RefreshGames()
private void OnGameListViewRetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
e.Item = this._FilteredGames[e.ItemIndex].Item;
var info = this._FilteredGames[e.ItemIndex];
e.Item = new ListViewItem()
{
Text = info.Name,
ImageIndex = info.ImageIndex,
};
}
private void DoDownloadLogo(object sender, DoWorkEventArgs e)

0 comments on commit 26f436d

Please sign in to comment.