using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;

public partial class UsingGenerics : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       List<string> names = new List<string>();
       names.Add("Aristotle");
       names.Add("Cicero");
       names.Add("Plato");

       lboxStrings.DataSource = names;
       lboxStrings.DataBind();

       string temp1 = names[2];


       // create sample customer objects
       Customer c1 = new Customer("334", "Thomas", "Hobbes", "123-4567");
       Customer c2 = new Customer("085", "David", "Hume", "564-7823");
       Customer c3 = new Customer("254", "Martin", "Heidegger", "253-6383");

       List<Customer> customers = new List<Customer>();
       customers.Add(c1);
       customers.Add(c2);
       customers.Add(c3);

       Customer c = customers[2];
       customers[1] = c;

       lboxCustomers.DataSource = customers;
       lboxCustomers.DataBind();

       Dictionary<string, Customer> dict = new Dictionary<string, Customer>();
       dict.Add(c1.Id, c1);
       dict.Add(c2.Id, c2);

       

       lboxDictionary.DataSource = dict;
       lboxDictionary.DataBind();
    }
}
