Esempio n. 1
0
        private PostDto GetMobilePost(PostRendered p)
        {
            var post = new PostDto(p, CfCacheIndex.Get(p.PlaceID), p.UserDisplayName, p.UserAvatar);

            foreach (var c in p.PostComments)
            {
                var profile = CfPerfCache.GetClimber(c.UserID);
                post.Comments.Add(new PostCommentDto(c, profile));
            }
            return(post);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="posts"></param>
        /// <returns></returns>
        public static List <PostRendered> BindPostsContentForIphone(List <Post> posts)
        {
            var mobPosts = new List <PostRendered>();

            foreach (var p in posts)
            {
                var place = AppLookups.GetCacheIndexEntry(p.PlaceID);

                var post = new PostRendered(p, p.Profile, place);
                if (!post.IsStale)
                {
                    post.Content      = ContentRenderer.BindContentForMobile(p);
                    post.PostComments = p.PostComments;
                    mobPosts.Add(post);
                }
            }

            return(mobPosts);
        }
Esempio n. 3
0
        public PostDto(PostRendered p, CfCacheIndexEntry place, string by, string byPic)
        {
            ID        = p.ID.ToString("N");
            PlaceID   = p.PlaceID.ToString("N");
            Type      = p.TypeID;
            PlaceName = place.Name;
            CountryID = place.CountryID;
            Utc       = p.Utc.ToEpochTimeString();
            By        = by;
            ByID      = p.UserID.ToString("N");
            ByPic     = byPic;
            if (p.Content.Contains("<split>"))
            {
                var split = p.Content.IndexOf("<split>");
                Meta    = p.Content.Substring(0, split);
                Comment = p.Content.Substring(split + 7, p.Content.Length - (split + 7));
            }

            //Content = p.Content;
            Comments = new List <PostCommentDto>();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="posts"></param>
        /// <returns></returns>
        public static List<PostRendered> BindPostsContentForIphone(List<Post> posts)
        {
            var mobPosts = new List<PostRendered>();

            foreach (var p in posts)
            {
                var place = AppLookups.GetCacheIndexEntry(p.PlaceID);

                var post = new PostRendered(p, p.Profile, place);
                if (!post.IsStale)
                {
                    post.Content = ContentRenderer.BindContentForMobile(p);
                    post.PostComments = p.PostComments;
                    mobPosts.Add(post);
                }
            }

            return mobPosts;
        }