Пример #1
0
        public void LoadList(MicroBlogType listType, long sinceId, string searchTerm)
        {
            switch (listType)
            {
            case MicroBlogType.TechNets:
                LoadNewTechNets(sinceId);
                break;

            default:
                return;
            }
        }
Пример #2
0
        private void LoadList(MicroBlogType listType, bool refresh, string searchTerm)
        {
            string fileName = null;
            ObservableCollection <BlogItemModel> parentList = null;

            switch (listType)
            {
            case MicroBlogType.TechNets:
                fileName   = Constants.TechNetBlogFileName;
                parentList = TechNetBlogs;
                break;
            }
            if (String.IsNullOrEmpty(fileName))
            {
                return;
            }
            // If a cached file exists, bind it first then go update unless we are refreshing
            if (!refresh)
            {
                var itemList = BaseHelper.LoadSetting <List <BlogItemModel> >(fileName);
                if (itemList != null)
                {
                    BindList(parentList, itemList);
                }
            }

            var BlogHelper = new BlogHelper();

            BlogHelper.LoadList(listType, (parentList != null && parentList.Count > 0) ? parentList[0].BlogId : 0, searchTerm);
            BlogHelper.LoadedCompleteEvent += (sender, e) =>
            {
                CheckCount();

                var list = BaseHelper.LoadSetting <List <BlogItemModel> >(fileName);
                if (list == null)
                {
                    //BaseHelper.ShowMessage("网络连接不稳定,请检查网络信号.");
                    return;
                }

                Deployment.Current.Dispatcher.BeginInvoke(() => BindList(parentList, list));
            };
        }
Пример #3
0
 private void LoadList(MicroBlogType listType, bool refresh)
 {
     LoadList(listType, refresh, String.Empty);
 }