예제 #1
0
 static void Main(string[] args)
 {
     Inventory MyInventory = new Inventory();
     foreach (var item in MyInventory.GetArtworkList)
     {
         // vi vet att alla items i listan är av typen Artwork
         //Console.WriteLine(item.PresentationName);
         Console.WriteLine(item);
     }
 }
예제 #2
0
        public Form1()
        {
            InitializeComponent();
            listBox1.SelectedIndexChanged += new EventHandler(Dosomething);
            Inventory MyInventory = new Inventory();

            //  foreach (var item in MyInventory.GetArtworkList )
            //  {
            //      listBox1.Items.Add(item);
            //  }


            listBox1.DataSource = MyInventory.GetArtworkList;
            listBox1.DisplayMember = "Artist";
        }