//Gets next pokemon values private void btnNextPokemon_Click(object sender, RoutedEventArgs e) { cboAlternates.Items.Clear(); _pokemonIndex++; if (_pokemonIndex > _pokemonManager.RetrieveAllPokemon().Count - 1) { _pokemonIndex = 0; } DisplayEntry(); }
//On load private void dgPokedexList_Loaded(object sender, RoutedEventArgs e) { dgPokedexList.ItemsSource = _pokemonManager.RetrieveAllPokemon(); dgPokedexList.Columns[0].Header = "Pokemon Number"; dgPokedexList.Columns[1].Header = "Pokemon Name"; dgPokedexList.Columns[2].Header = "Pokemon Region"; dgPokedexList.Columns[3].Header = "Pokemon Type"; dgPokedexList.Columns[4].Header = "Pokemon Type 2"; dgPokedexList.Columns[0].Width = 200; dgPokedexList.Columns[1].Width = 200; dgPokedexList.Columns[2].Width = 200; dgPokedexList.Columns[3].Width = 200; dgPokedexList.Columns[4].Width = 185; dgPokedexList.Columns.RemoveAt(5); }
private void btnAddPokemon_Click(object sender, RoutedEventArgs e) { // Used for what type of list to add to string pokemonVariant = "Normal"; if (btnAddPokemon.Content.Equals("Add Pokemon")) { //List of all normal pokemon List <Pokemon> normalPokemon = new List <Pokemon>(); normalPokemon = _pokemonManager.RetrieveAllPokemon(); //Add normal pokemon var PokedexList = new frmAddPokemonToList(normalPokemon, UserID, pokemonVariant); dgMyPokemonList.ItemsSource = _pokemonManager.RetrieveMyPokemon(UserID); ResetColumns(); lblStatusMessage.Content = "Went to add pokemon"; } // Add alternate Version else if (btnAddPokemon.Content.Equals("Add Alternate Version")) { //list of alternate pokemon List <Pokemon> alternatePokemon = new List <Pokemon>(); alternatePokemon = _pokemonManager.RetrieveAllAlternateForms(); //Used for setting which kind of pokemon to add to list pokemonVariant = "Alternate"; //Add to alternateuserstore var PokedexList = new frmAddPokemonToList(alternatePokemon, UserID, pokemonVariant); dgMyPokemonList.ItemsSource = _pokemonManager.RetrieveMyAlternatePokemon(UserID); ResetColumns(); } //Add mega else if (btnAddPokemon.Content.Equals("Add Mega Pokemon")) { //List of Mega pokemon List <Pokemon> alternatePokemon = new List <Pokemon>(); alternatePokemon = _pokemonManager.RetrieveAllMega(); //Used to acknowledge we want mega pokemon pokemonVariant = "Mega"; //Add to alternateuserstore var PokedexList = new frmAddPokemonToList(alternatePokemon, UserID, pokemonVariant); dgMyPokemonList.ItemsSource = _pokemonManager.RetrieveMyMegaPokemon(UserID); ResetColumns(); } //Add regional variant else if (btnAddPokemon.Content.Equals("Add Regional Variant")) { //List of regional variant pokemon List <Pokemon> regionalPokemon = new List <Pokemon>(); regionalPokemon = _pokemonManager.RetrieveAllRegionals(); //Used to know that we want to add a regional variant pokemonVariant = "Regional"; //Add to REgionalList var PokedexList = new frmAddPokemonToList(regionalPokemon, UserID, pokemonVariant); dgMyPokemonList.ItemsSource = _pokemonManager.RetrieveMyRegionalPokemon(UserID); ResetColumns(); } //Add Shiny else { //Only other type is Shiny so I create a new list of Shiny pokemon List <Pokemon> shinyPokemon = new List <Pokemon>(); shinyPokemon = _pokemonManager.RetrieveAllShinies(); pokemonVariant = "Shiny"; // add shiny var PokedexList = new frmAddPokemonToList(shinyPokemon, UserID, pokemonVariant); dgMyPokemonList.ItemsSource = _pokemonManager.RetrieveMyShinyPokemon(UserID); ResetColumns(); } }