我有一個關於我正在做的小項目的問題。我目前有一個列表框填充了類型爲「遊戲」的對象。在遊戲中,有名稱,GameConsole,流派等屬性...c# - 在列表框中過濾一個對象的屬性
我想根據這些屬性過濾我的結果。我想知道這是否可能。我通過Access數據庫中的DA類獲取我的遊戲對象。
我從DA我場比賽,這段代碼:
listBoxGames.BeginUpdate();
DAGame daGame = new DAGame();
List<Game> games = daGame.GetGames();
foreach (Game game in games)
{
listBoxGames.Items.Add(game);
}
listBoxGames.EndUpdate();
編輯:這是我的遊戲對象的聲明
public Game(int id, string naam, string afbeelding, float score, string opmerkingen, bool online, bool coOp, int maxAantalSpelers, int multiplayerTypeId, int systeemId, int genreId, int jaar, bool touchControls, string uitgeleend, bool favoriet)
{
this.Id = id;
this.Naam = naam;
this.Afbeelding = afbeelding;
this.Score = score;
this.Opmerkingen = opmerkingen;
this.Online = online;
this.CoOp = coOp;
this.MaxAantalSpelers = maxAantalSpelers;
this.MultiplayerTypeId = multiplayerTypeId;
this.SysteemId = systeemId;
this.GenreId = genreId;
this.Jaar = jaar;
this.TouchControls = touchControls;
this.Uitgeleend = uitgeleend;
this.Favoriet = favoriet;
}
在此先感謝
你可以添加聲明你的遊戲對象?目前尚不清楚您的意思是[屬性](http://msdn.microsoft.com/zh-cn/library/aa288454(v = vs.71).aspx)或屬性。但你一定在尋找[LINQ](http://msdn.microsoft.com/en-us/library/bb397933.aspx)。網絡上有很多例子。 – Vasek