Esempio n. 1
0
        public static void SyncList(ReaderPlatform readerPlatform)
        {
            _queryRssChat = readerPlatform.Resolve <IQueryRssChatRelationService>();
            var datas = _queryRssChat.GetList().ResponseData;

            RssList = RssList.Where(x => datas.Select(y => y.Id).Contains(x.Key.Id)).ToDictionary(x => x.Key, y => y.Value);

            foreach (var item in datas)
            {
                if (RssList.Select(x => x.Key.Id).Contains(item.Id))
                {
                    continue;
                }
                else
                {
                    RssList.Add(item, DateTimeOffset.Now);
                }
            }
        }
Esempio n. 2
0
        public static void Create(ReaderPlatform readerPlatform)
        {
            try
            {
                ReaderList.Load(readerPlatform);

                while (true)
                {
                    Thread.Sleep(60000);
                    ReaderList.SyncList(readerPlatform);
                    ReaderList.GetLatestNews();
                    GC.Collect();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Create(readerPlatform);
            }
        }
Esempio n. 3
0
 public static void Load(ReaderPlatform readerPlatform)
 {
     _queryRssChat = readerPlatform.Resolve <IQueryRssChatRelationService>();
     RssList       = _queryRssChat.GetList().ResponseData.ToDictionary(x => x, x => DateTimeOffset.Now);
 }