Пример #1
0
 // Enbart för kloning
 public Feed(string title, FeedCategory myCat, int updateInterval, string url)
 {
     this.FeedTitle      = title;
     this.FeedCategory   = myCat;
     this.FeedItems      = new List <FeedItem>();
     this.UpdateInterval = updateInterval;
     this.Url            = url;
 }
Пример #2
0
 public Feed(string title, FeedCategory myCat)
 {
     this.FeedTitle       = title;
     this.FeedCategory    = myCat;
     this.FeedItems       = new List <FeedItem>();
     this.TimeLastChecked = DateTime.Now;
     this.UpdateInterval  = 0;
 }
Пример #3
0
        public static void InitiateFeedConstruction(string name, FeedCategory category, int timeInterval)
        {
            Feed newFeed = new Feed();

            newFeed.FeedTitle      = name;
            newFeed.FeedCategory   = category;
            newFeed.UpdateInterval = timeInterval;

            Parsing.XmlOperation(newFeed);
        }
Пример #4
0
 public static void RemoveCategory(FeedCategory categoryToRemove)
 {
     try {
         CategoryList.Remove(categoryToRemove);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
 }
Пример #5
0
        public static void InformationHandler(string[] myStringArray)
        {
            string name     = myStringArray[1];
            string cat      = myStringArray[2];
            string interval = myStringArray[3];
            var    category = FeedCategory.CategoryMatcher(cat);

            int intervalInt;

            int.TryParse(interval, out intervalInt);

            InitiateFeedConstruction(name, category, intervalInt);
        }
Пример #6
0
        public static FeedCategory CategoryMatcher(string categoryToMatch)
        {
            var myCat = new FeedCategory();

            for (int i = 0; i < CategoryList.Count; i++)
            {
                if (CategoryList[i].CategoryName == categoryToMatch)
                {
                    myCat = CategoryList[i];
                    break;
                }
            }

            return(myCat);
        }