private void BtnAddSteamGame_Click(object sender, EventArgs e) { string gameName = comboBoxGameList.SelectedItem.ToString(); Game g = ownedGames.Find(x => x.Name == gameName); if (g != null) { GameList.AddSteamGame(g.AppID, g.Name); UpdateGameList(); comboBoxGameList.SelectedIndex = -1; listBoxGames.SelectedIndex = listBoxGames.Items.Count - 1; } }
private void listBoxAchievements_DrawItem(object sender, DrawItemEventArgs e) { Brush myBrush = Brushes.Black; string achieveName = listBoxAchievements.Items[e.Index].ToString(); if (GameList.DoesAchieveGotMemo(GameName, achieveName)) { myBrush = Brushes.YellowGreen; } e.DrawBackground(); e.Graphics.DrawString(listBoxAchievements.Items[e.Index].ToString(), listBoxAchievements.Font, myBrush, e.Bounds); /*foreach (ListBox.ObjectCollection i in listBoxAchievements.Items) { * * }*/ }
public void UpdateGameList() { listBoxGames.Items.Clear(); foreach (string name in GameList.GetAllGameNames()) { listBoxGames.Items.Add(name); } if (listBoxGames.Items.Count > 0) { listBoxGames.SelectedIndex = 0; } else { TxtBoxGameMemo.Text = ""; TxtBoxGameMemo.Enabled = false; } GameList.Save(ProfileName); }
private void TxtBoxGameMemo_Leave(object sender, EventArgs e) { GameList.UpdateGameMemo(listBoxGames.SelectedItem.ToString(), TxtBoxGameMemo.Text); GameList.Save(ProfileName); }
private void btnDeleteGame_Click(object sender, EventArgs e) { GameList.RemoveGame(listBoxGames.SelectedItem.ToString()); UpdateGameList(); }
private void LoadGameList() { GameList.Load(ProfileName); UpdateGameList(); }