예제 #1
0
 private void btn_add_feed_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(tb_easy_name.Text) &&
         !string.IsNullOrWhiteSpace(tb_feed_url.Text))
     {
         try
         {
             Feed feed = new Feed(tb_easy_name.Text, tb_feed_url.Text);
             feedsManager.AddFeedToConfig(feed);
             AddItemToListBox(ltb_feeds, feed);
             displayManager.UpdateTiles(pn_tiles);
         }
         catch (ConfigurationErrorsException ex)
         {
             Alert(ex.Message);
         }
     }
     else
     {
         string prompt = "Please enter a name and URL for the new feed";
         MetroMessageBox.Show(this, prompt, "Add New Feed", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
     }
 }