Beispiel #1
0
        private void PokemonPanel_DoubleClick(object sender, EventArgs e)
        {
            Selected    = true;
            _parentForm = (PokemonPartyForm)Parent;
            BackColor   = Color.FromArgb(255, 200, 200);
            _parentForm.PokemonPicked(_pokemon);

            PokemonDetailsForm pokemonDetailsForm = new PokemonDetailsForm();

            if (StaticMain.openedForms.Where(x => x.Name == pokemonDetailsForm.Name).Any())
            {
                pokemonDetailsForm = StaticMain.openedForms.Where(x => x.Name == pokemonDetailsForm.Name).First() as PokemonDetailsForm;
                pokemonDetailsForm.Close();
            }
        }
Beispiel #2
0
        private void ShowDetails(IPokemon pokemon)
        {
            _parentForm = (PokemonPartyForm)Parent;
            PokemonDetailsForm pokemonDetailsForm = new PokemonDetailsForm(pokemon);

            if (!StaticMain.openedForms.Where(x => x.Name == pokemonDetailsForm.Name).Any())
            {
                pokemonDetailsForm.Show();
                pokemonDetailsForm.Location = new Point(_parentForm.Location.X + _parentForm.Width, _parentForm.Location.Y);
                StaticMain.FormOpened(pokemonDetailsForm);
            }
            else
            {
                pokemonDetailsForm = StaticMain.openedForms.Where(x => x.Name == pokemonDetailsForm.Name).First() as PokemonDetailsForm;
                pokemonDetailsForm.UpdateData(pokemon);
            }
        }