ARKBreedingStats.TamingControl.comboBoxSpecies_SelectedIndexChanged C# (CSharp) Метод

comboBoxSpecies_SelectedIndexChanged() приватный Метод

private comboBoxSpecies_SelectedIndexChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        private void comboBoxSpecies_SelectedIndexChanged(object sender, EventArgs e)
        {
            int sI = comboBoxSpecies.SelectedIndex;
            if (sI >= 0 && Values.V.species[sI].taming != null)
            {
                this.SuspendLayout();
                foreach (TamingFoodControl f in foodControls)
                    Controls.Remove(f);
                foodControls.Clear();
                TamingFoodControl tf;
                int i = 0;
                foreach (string f in Values.V.species[sI].taming.eats)
                {
                    tf = new TamingFoodControl(f);
                    if (f == "Kibble")
                        tf.foodNameDisplay = "Kibble (" + Values.V.species[sI].taming.favoriteKibble + " Egg)";
                    tf.Location = new Point(20, 80 + 45 * i);
                    tf.valueChanged += new TamingFoodControl.ValueChangedEventHandler(updateTamingData);
                    tf.Clicked += new TamingFoodControl.ClickedEventHandler(onlyOneFood);
                    foodControls.Add(tf);
                    Controls.Add(tf);
                    i++;
                }
                this.ResumeLayout();

                if (foodControls.Count > 0)
                {
                    foodControls[0].amount = Taming.foodAmountNeeded(sI, (int)nudLevel.Value, foodControls[0].foodName, Values.V.species[sI].taming.nonViolent);
                }
            }
        }