public static ApiComment Map(SocialComment c) { var comment = c.Map <ApiComment>(); comment.OwnerPicture = FacebookCore.Picture(c.OwnerFacebookId).ToString(); return(comment); }
public IEnumerable <SocialComment> SaveComment(SocialComment comment) { if (null == comment) { throw new ArgumentNullException("comment"); } if (comment.Delete) { if (Guid.Empty == comment.Identifier) { throw new ArgumentException("Identifier"); } } else { if (Guid.Empty == comment.ReferenceIdentifier) { throw new ArgumentException("Reference Identifier"); } if (string.IsNullOrWhiteSpace(comment.Comment)) { throw new ArgumentException("Comment must be specified"); } } comment.UserIdentifier = User.Identifier(); var newComment = this.socialCore.SaveComment(comment); emailCore.NewsFeedComment(newComment); return(null != newComment?this.socialCore.SearchComment(comment.UserIdentifier, newComment.ReferenceIdentifier) : null); }
public void NewsFeedComment(SocialComment comment) { //try //{ // var subject = string.Format("Your friend {0} is making a Trade offer.", template.Trade.Requester.Name); // this.SendGeneric(template.Trade.Receiver.Email, fromName, subject, "Your friend wants to trade with you", template.TransformText()); //} //catch //{ //} }
public SocialComment SaveComment(SocialComment comment) { var identifier = comment.Identifier == Guid.Empty ? (Guid?)null : comment.Identifier; var sproc = new SocialSaveComment() { Identifier = identifier, UserIdentifier = comment.UserIdentifier, ReferenceIdentifier = comment.ReferenceIdentifier, Comment = comment.Comment, Delete = comment.Delete, }; return(sproc.CallObject <SocialComment>()); }
public void AddComment(string from, string text) { commentN++; commentsNumber.text = "" + commentN; float height = 0; float last = 0; foreach (SocialComment child in commentsContent.GetComponentsInChildren <SocialComment>(false)) { RectTransform rctT = child.GetComponent <RectTransform>(); height += rctT.sizeDelta.y; last = rctT.sizeDelta.y; } GameObject comment = Instantiate(commentPrefab, commentsContent, false); SocialComment sc = comment.GetComponent <SocialComment>(); sc.textPrefab = textTemplate; sc.SetAuthorAndComment(from, text); comment.transform.localScale = new Vector3(1, 1, 1); commentsContent.sizeDelta = new Vector2(commentsContent.sizeDelta.x, commentsContent.sizeDelta.y + last); comment.transform.localPosition = new Vector2(comment.transform.localPosition.x, comment.transform.localPosition.y - height); computer.AddTmpComment(comment); }