Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var testDialog = new AddCategoryDialog();

            if (testDialog.ShowDialog(this) != DialogResult.OK)
            {
                ChanelsRepository.Create(testDialog.Name);
            }
            testDialog.Dispose();
            Form.UpdatePanel();
        }
Beispiel #2
0
 public void UpdatePanel()
 {
     controlPanel.Controls.Clear();
     categories = ChanelsRepository.Read();
     foreach (var category in categories)
     {
         controlPanel.Controls.Add(new Button {
             Text = category.Name, Size = new Size(225, 40)
         });
     }
     controlPanel.Controls.Add(new AddButton(this));
 }