private void DisplayCart()
    {
        lstCart.Items.Clear();
        CartItem        CartItem  = default(CartItem);
        DictionaryEntry CartEntry = default(DictionaryEntry);

        foreach (DictionaryEntry CartEntry_loopVariable in Cart2)
        {
            CartEntry = CartEntry_loopVariable;
            CartItem  = (CartItem)CartEntry.Value;
            lstCart.Items.Add(CartItem.Display());
        }
    }
Ejemplo n.º 2
0
    private void DisplayCart()
    {
        //Clears the previous items
        lstCart.Items.Clear();

        //Instantiates an object of CartItem Class
        CartItem CartItem = default(CartItem);

        // Defines a Dictionary Key/Value entry, that holds a description and price in a listbox
        DictionaryEntry CartEntry = default(DictionaryEntry);

        //Loops through entries, adds to the listbox and displays them within the listbox
        foreach (DictionaryEntry CartEntry_loopVariable in Cart2)
        {
            CartEntry = CartEntry_loopVariable;
            CartItem  = (CartItem)CartEntry.Value;
            lstCart.Items.Add(CartItem.Display());
        }
    }