Ejemplo n.º 1
0
 public Form1()
 {
     InitializeComponent();
     FeedList    = new FeedList();
     EpisodeList = new RssList <Episode>();
     Categories  = new CategoryList();
     FillFrequencies();
 }
Ejemplo n.º 2
0
        public static void Serialize(FeedList feedList)
        {
            var Serializer = new XmlSerializer(typeof(FeedList));

            using (var Writer = new StreamWriter(FILEPATH)) {
                Serializer.Serialize(Writer, feedList);
            }
        }
Ejemplo n.º 3
0
 private async Task LoadListAsync()
 {
     await Task.Run(() => {
         FeedList = FeedList.Load();
         FeedList.AddTimerEvent();
         FeedList.ListChanged  += SaveAndLoadList;
         FeedList.TimerElapsed += () => {
             UpdateListOtherThread();
         };
     });
 }
Ejemplo n.º 4
0
        public static FeedList Deserialize()
        {
            FeedList feedList = new FeedList();

            if (File.Exists(FILEPATH))
            {
                var serializer = new XmlSerializer(typeof(FeedList));
                using (var reader = new StreamReader(FILEPATH))
                {
                    feedList = serializer.Deserialize(reader) as FeedList;
                }
            }
            return(feedList);
        }
Ejemplo n.º 5
0
        public override RssList <Feed> SortList(object obj)
        {
            FeedList SortedFeedList = new FeedList();
            Category category       = obj as Category;

            if (category != null)
            {
                var List = this.OrderByDescending((item) => item.TheCategory == category.TheCategory).ToList();
                foreach (var item in List)
                {
                    SortedFeedList.Add(item);
                }
            }
            return(SortedFeedList);
        }
Ejemplo n.º 6
0
        private void lboxKategori_SelectedIndexChanged(object sender, EventArgs e)
        {
            int index = lboxKategori.SelectedIndex;

            if (index != -1)
            {
                FeedList = FeedList.SortList(Categories[index]) as FeedList;
                FeedList.AddTimerEvent();
                FeedList.ListChanged += SaveAndLoadList;
                Updatelist();
            }
            else
            {
                return;
            }
        }