Ejemplo 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);
                }
            }
        }
Ejemplo 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);
            }
        }
Ejemplo n.º 3
0
 public static void Load(ReaderPlatform readerPlatform)
 {
     _queryRssChat = readerPlatform.Resolve <IQueryRssChatRelationService>();
     RssList       = _queryRssChat.GetList().ResponseData.ToDictionary(x => x, x => DateTimeOffset.Now);
 }