コード例 #1
0
 private void updateCategoryButton_Click(object sender, EventArgs e)
 {
     if (Validering.CheckIfTextfieldsIsEmpty(categoryTextbox))
     {
         if (categoryListview.SelectedItems[0].Index > 0)
         {
             PodcastHandler.updateCategory(categoryTextbox.Text, categoryListview.SelectedItems[0].Index);
             categoryListview = PodcastHandler.updateCategoryListview(categoryListview);
             categoryCombobox = PodcastHandler.updateComboBox(categoryCombobox);
         }
     }
 }
コード例 #2
0
 private void ButtonTaBortKategori_Click(object sender, EventArgs e)
 {
     if (categoryListview.SelectedItems[0].Text.Length > 0)
     {
         if (Validering.validateSelectedCategory(categoryListview.SelectedItems[0].Text, "remove"))
         {
             PodcastHandler.removeCategory(categoryListview.SelectedItems[0].Text);
             categoryCombobox = PodcastHandler.updateComboBox(categoryCombobox);
             categoryListview = PodcastHandler.updateCategoryListview(categoryListview);
         }
     }
     else
     {
         MessageBox.Show("Du måste välja en kategori för att ta bort den");
     }
 }
コード例 #3
0
        public Form()
        {
            InitializeComponent();
            timerCounter = 0;
            StartTimer();
            MessageBox.Show(greeting.Greet());

            ctrl             = new MessageController(this);
            podcastListview  = PodcastHandler.updatePodcastListview(podcastListview);
            categoryListview = PodcastHandler.updateCategoryListview(categoryListview);
            categoryCombobox = PodcastHandler.updateComboBox(categoryCombobox);
            if (categoryCombobox.Items.Count > 0)
            {
                categoryCombobox.SelectedIndex = 0;
            }
            Application.ApplicationExit += new EventHandler(this.OnApplicationExit);
        }