示例#1
0
 /// <summary>
 /// Method that calls service to polulate Json Posts
 /// </summary>
 private void PopulateJsonPosts()
 {
     //This makes an async call to the service
     Task <List <JsonPostViewObject> > .Factory.StartNew(() =>
     {
         return(ModelToViewObjectConverter.Convert(_service.GetPosts()));
     }).ContinueWith((t) =>
     {
         if (t != null && t.Result != null &&
             t.Result.Count > 0)
         {
             //Polulate results, pump up on UI thread
             if (App.Current != null)
             {
                 App.Current.Dispatcher.BeginInvoke((Action) delegate()
                 {
                     t.Result.ForEach(v => JsonPosts.Add(v));
                     if (JsonPosts != null && JsonPosts.Count > 0)
                     {
                         SelectedJsonPlaceHolder = JsonPosts.FirstOrDefault();
                     }
                 });
             }
             else //Test
             {
                 t.Result.ForEach(v => JsonPosts.Add(v));
                 if (JsonPosts != null && JsonPosts.Count > 0)
                 {
                     SelectedJsonPlaceHolder = JsonPosts.FirstOrDefault();
                 }
             }
         }
     });
 }
示例#2
0
        public static string LoadPostPager(int page, int pageSize, string type)
        {
            if (!WebUtils.CheckRightsForAdminPostPages(false))
            {
                return(null);
            }

            return(JsonPosts.GetPager(page, pageSize));
        }
示例#3
0
        public static IEnumerable LoadPosts(int page, string type, string filter, string title, int pageSize)
        {
            if (!WebUtils.CheckRightsForAdminPostPages(false))
            {
                return(null);
            }

            return(JsonPosts.GetPosts(page, pageSize, type, filter, title));
        }
示例#4
0
        public static IEnumerable LoadPosts(int page, string type, string filter, string title)
        {
            WebUtils.CheckRightsForAdminPostPages(false);

            return(JsonPosts.GetPosts(page, type, filter, title));
        }
示例#5
0
        public static string LoadPostPager(int page)
        {
            WebUtils.CheckRightsForAdminPostPages(false);

            return(JsonPosts.GetPager(page));
        }