private void PopulateDefaultGameView(Game game) { DefaultGameView defaultGameView = new DefaultGameView(game); defaultGameView.OnGameClicked += GameViews_OnGameClicked; defaultGameView.OnGameDoubleClicked += GameViews_OnGameDoubleClicked; flpGames.InvokeThreadSafeMethod(() => flpGames.Controls.Add(defaultGameView)); }
private void GamesQuickMenu_OnSearch(object source, string e) { if (e == string.Empty) { flpGames.Controls.Cast <Control>().ToList().ForEach(c => c.Visible = true); } else { foreach (var control in flpGames.Controls) { if (Settings.GameView == GameView.Default) { DefaultGameView gameView = control as DefaultGameView; if (gameView.Game.Name.ToLower().Contains(e.ToLower())) { gameView.Visible = true; } else { gameView.Visible = false; } } else if (Settings.GameView == GameView.Compact) { CompactGameView gameView = control as CompactGameView; if (gameView.Game.Name.ToLower().Contains(e.ToLower())) { gameView.Visible = true; } else { gameView.Visible = false; } } } } }