Ejemplo n.º 1
0
 public void LoadSubscribtions()
 {
     string[] lines = dataSource.readData("Subscribtions.txt");
     string[] words;
     foreach (string line in lines)
     {
         Rss.Urls item = new Rss.Urls();
         words              = line.Split(',').ToArray <string>();
         item.WebsiteName   = words[0];
         item.LinkToWebsite = words[1];
         item.Category      = words[2];
         WebSubscribtions.Add(item);
     }
 }
Ejemplo n.º 2
0
 public void AddSubscribtion()
 {
     if (WebsiteUrl.Length == 0)
     {
         throw new Exception("Provide an URL adress!");
     }
     else
     {
         Rss.Urls item = new Rss.Urls();
         item.LinkToWebsite = WebsiteUrl;
         item.WebsiteName   = new Uri(WebsiteUrl).Host;
         item.Category      = Category;
         WebSubscribtions.Add(item);
     }
 }