Пример #1
0
 public ToyShopForm(ToyShop toyShop)
 {
     InitializeComponent();
     theShop = toyShop;
     if (theShop != null)
     {
         MagInfo.Text = theShop.ToShortString();
         foreach (PartyToys party in theShop.supplies)
         {
             listBox1.Items.Add(party);
         }
     }
     RefreshData();
 }
Пример #2
0
 private void RefreshData()
 {
     MagInfo.Text = theShop.ToShortString();
     listBox1.Items.Clear();
     foreach (PartyToys party in theShop.supplies)
     {
         listBox1.Items.Add(party);
     }
     if (listBox1.Items.Count != 0)
     {
         button2.Enabled = true;
         button3.Enabled = true;
         button4.Enabled = true;
     }
     else
     {
         button2.Enabled = false;
         button3.Enabled = false;
         button4.Enabled = false;
     }
 }