示例#1
0
 public PostRecord(Post i_Post)
 {
     r_Post = i_Post;
 }
示例#2
0
 public abstract string SortFeedOnRequest(Post i_Post);
示例#3
0
        private void loadWallPost(Post i_CurrentPost)
        {
            bool isPostSupported = false;
            if (i_CurrentPost.Message != null)
            {
                LabelWallPost.Text = i_CurrentPost.Message;
                isPostSupported = true;
            }

            if (i_CurrentPost.PictureURL != null)
            {
                PictureBoxWallPost.LoadAsync(i_CurrentPost.PictureURL);
                isPostSupported = true;
            }

            if (i_CurrentPost.Comments != null)
            {
                foreach(Comment currentComment in i_CurrentPost.Comments)
                {
                    if (currentComment.Message != null)
                    {
                        ListBoxWallComments.Items.Add(string.Format("{0}: {1}", currentComment.From.Name, currentComment.Message));
                    }
                    else
                    {
                        ListBoxWallComments.Items.Add(string.Format("{0}: <Unsupported type>", currentComment.From.Name));
                    }
                }
            }

            if (!isPostSupported)
            {
                LabelWallPost.Text = string.Format("<Post of type {0} are currently not supported>", i_CurrentPost.Type);
            }
        }
示例#4
0
 public override string SortFeedOnRequest(Post i_Post)
 {
     return i_Post.Link;
 }
示例#5
0
 public PostViewController(Post p)
     : base()
 {
     post = p;
 }
示例#6
0
 public override string SortFeedOnRequest(Post i_Post)
 {
     return i_Post.Description;
 }
示例#7
0
 public IList<Tag> GetPostTags(Post post)
 {
     return _blogRepository.GetPostTags(post);
 }
示例#8
0
 public IList<PostImage> GetPostImages(Post post)
 {
     return _blogRepository.GetPostImages(post);
 }
示例#9
0
 public IList<Category> GetPostCategories(Post post)
 {
     return _blogRepository.GetPostCategories(post);
 }
示例#10
0
        public ActionResult AddNewPost(PostViewModel model)
        {
            var post = new Post
            {
                Id = model.ID,
                Body = model.Body,
                Meta = model.Meta,
                PostedOn = DateTime.Now,
                Published = true,
                ShortDescription = model.ShortDescription,
                Title = model.Title,
                UrlSeo = model.UrlSeo

            };
            _blogRepository.AddNewPost(post);

            //provlima me to url kai to offline
            string desc = System.Net.WebUtility.HtmlDecode(model.ShortDescription);
            string finaldesc= Regex.Replace(desc, @"<[^>]*>", String.Empty);
            string message = "http://localhost:52815/Blog/Post?slug="+ System.Net.WebUtility.HtmlDecode(model.UrlSeo) + "   " + finaldesc;
            long userId = 100010771963874;
            string wallAccessToken = "CAARfEI0GudoBACp8ZAsnrDH1mYnbxFr0jIAqpOp8DQfDij1ihI7Kt7ORQFEplI7F0WZCpNGYvTbZC7DTZA33s5FZBtTZCkWs9xyPdaPuQizxXHPM06Sf5TIoAx6sqCYdKqsnJTeddefjSdMaL6Q1L1ZCblZAEk384V01gcZBjqRroeiXqMxWuBNtqKf8iK2MgT90ZD&expires=5183999";
            PostToWall(message, userId, wallAccessToken);
            return RedirectToAction("AllPosts", "Blog", new { slug = model.UrlSeo });
        }