public ForumThreadInfo(IForumAuthor author, DateTime postedOn, IForumThreadType threadType, IEnumerable <IForumThreadTag> tags, IForumPostInfo latestPost) { if (author == null) { throw new ArgumentNullException("author"); } if (threadType == null) { throw new ArgumentNullException("threadType"); } if (tags == null) { throw new ArgumentNullException("tags"); } if (latestPost == null) { throw new ArgumentNullException("latestPost"); } Author = author; PostedOn = postedOn; ThreadType = threadType; Tags = tags.ToArray(); LatestPost = latestPost; }
public static string AuthorUrl(this UrlHelper urlHelper, IForumAuthor author) { try { return(author == null || author.EntityReference == null ? _defaultAuthorUrl : urlHelper.RouteUrl("PublicProfileForumPosts", new { contactId = author.EntityReference.Id })); } catch { return(_defaultAuthorUrl); } }
public AuthorDrop(IPortalLiquidContext portalLiquidContext, IForumAuthor author) : this( portalLiquidContext, author.DisplayName, author.EmailAddress, author.EntityReference.Id, url => url.RouteUrl("PublicProfileForumPosts", new { contactId = author.EntityReference.Id })) { if (author == null) { throw new ArgumentNullException("author"); } }
public ForumPostInfo(EntityReference entityReference, IForumAuthor author, DateTime postedOn, IEnumerable <IForumPostAttachmentInfo> attachmentInfo = null, EntityReference forumThread = null) { if (entityReference == null) { throw new ArgumentNullException("entityReference"); } //if (author == null) throw new ArgumentNullException("author"); EntityReference = entityReference; Author = author; PostedOn = postedOn; AttachmentInfo = attachmentInfo == null ? new IForumPostAttachmentInfo[] {} : attachmentInfo.ToArray(); ThreadEntity = forumThread; }
public ForumThreadSubmission(string name, DateTime postedOn, IForumAuthor author, IForumThreadType threadType) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException("Value can't be null or empty.", "name"); } if (postedOn.Kind != DateTimeKind.Utc) { throw new ArgumentException("Value must be UTC.", "postedOn"); } if (author == null) { throw new ArgumentNullException("author"); } Name = name; PostedOn = postedOn; Author = author; ThreadType = threadType; }
private static IForumPostInfo GetForumPostInfo(string alias, Entity entity, IForumAuthor author) { if (entity == null) { throw new ArgumentNullException("entity"); } if (author == null) { throw new ArgumentNullException("author"); } IForumPostInfo unknownLatestPostInfo = new UnknownForumPostInfo(); var latestPostId = entity.GetAttributeAliasedValue <Guid?>("{0}.adx_communityforumpostid".FormatWith(alias)); return(latestPostId == null ? unknownLatestPostInfo : new ForumPostInfo( new EntityReference("adx_communityforumpost", latestPostId.Value), author, entity.GetAttributeAliasedValue <DateTime?>("{0}.adx_date".FormatWith(alias)).GetValueOrDefault(unknownLatestPostInfo.PostedOn))); }
public HtmlForumPostSubmission(string name, string htmlContent, DateTime postedOn, IForumAuthor author) { if (string.IsNullOrEmpty(name)) { throw new ArgumentException("Value can't be null or empty.", "name"); } if (postedOn.Kind != DateTimeKind.Utc) { throw new ArgumentException("Value must be UTC.", "postedOn"); } if (author == null) { throw new ArgumentNullException("author"); } Name = name; Content = SafeHtml.SafeHtmSanitizer.GetSafeHtml(htmlContent ?? string.Empty); PostedOn = postedOn; Author = author; Attachments = new List <IForumPostAttachment>(); }
public static string UserImageUrl(this UrlHelper urlHelper, IForumAuthor author, int?size = null) { return(author == null ? null : urlHelper.UserImageUrl(author.EmailAddress, size)); }