Exemple #1
0
    Vegetable tempVegetable            = new Vegetable();          // A vegetable object used to gain access to the 'Vegetable' class

    /// <summary>
    /// Runs when the app first loads and initializes the vegetables
    /// list. Also calls the method that creates the table of vegetables
    /// that the user sees and initializes that table
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.vegetableListBox.Items.Count == 0)
        {
            if (vegetables.Count == 0)
            {
                vegetables = tempVegetable.initializeVegetableList(vegetables);
            }
            for (int i = 0; i < vegetables.Count; i++)
            {
                tempVegetable.manageVegetableListBox(vegetables, this.vegetableListBox);
            }
        }
    }