本文整理汇总了C#中BoxSocial.Internals.Primitive.IsItemOwner方法的典型用法代码示例。如果您正苦于以下问题:C# Primitive.IsItemOwner方法的具体用法?C# Primitive.IsItemOwner怎么用?C# Primitive.IsItemOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoxSocial.Internals.Primitive
的用法示例。
在下文中一共展示了Primitive.IsItemOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayComments
//.........这里部分代码省略.........
foreach (Comment comment in comments)
{
core.PrimitiveCache.LoadUserProfile(comment.UserId);
}
long lastId = 0;
foreach (Comment comment in comments)
{
VariableCollection commentsVariableCollection = template.CreateChild("comment-list");
//commentsVariableCollection.ParseRaw("COMMENT", Bbcode.Parse(HttpUtility.HtmlEncode(comment.Body), core.session.LoggedInMember));
/*if ((!core.IsMobile) && (!string.IsNullOrEmpty(comment.BodyCache)))
{
core.Display.ParseBbcodeCache(commentsVariableCollection, "COMMENT", comment.BodyCache);
}
else*/
{
core.Display.ParseBbcode(commentsVariableCollection, "COMMENT", comment.Body, true, null, null);
}
try
{
User commentPoster = core.PrimitiveCache[comment.UserId];
lastId = comment.Id;
commentsVariableCollection.Parse("ID", comment.Id.ToString());
commentsVariableCollection.Parse("TYPE_ID", ItemKey.GetTypeId(core, typeof(Comment)));
commentsVariableCollection.Parse("USERNAME", commentPoster.DisplayName);
commentsVariableCollection.Parse("USER_ID", commentPoster.Id.ToString());
commentsVariableCollection.Parse("USER_DISPLAY_NAME", commentPoster.DisplayName);
commentsVariableCollection.Parse("U_PROFILE", commentPoster.ProfileUri);
commentsVariableCollection.Parse("U_QUOTE", core.Hyperlink.BuildCommentQuoteUri(comment.Id));
commentsVariableCollection.Parse("U_REPORT", core.Hyperlink.BuildCommentReportUri(comment.Id));
commentsVariableCollection.Parse("U_DELETE", core.Hyperlink.BuildCommentDeleteUri(comment.Id));
commentsVariableCollection.Parse("U_LIKE", core.Hyperlink.BuildLikeItemUri(comment.ItemTypeId, comment.Id));
commentsVariableCollection.Parse("TIME", core.Tz.DateTimeToString(comment.GetTime(core.Tz)));
commentsVariableCollection.Parse("USER_ICON", commentPoster.Icon);
commentsVariableCollection.Parse("USER_TILE", commentPoster.Tile);
commentsVariableCollection.Parse("USER_SQUARE", commentPoster.Square);
if (comment.Info.Likes > 0)
{
commentsVariableCollection.Parse("LIKES", string.Format("{0:d} ", comment.Info.Likes));
}
if (comment.Info.Dislikes > 0)
{
commentsVariableCollection.Parse("DISLIKES", string.Format(" {0:d}", comment.Info.Dislikes));
}
if (comment.Info.SharedTimes > 0)
{
commentsVariableCollection.Parse("SHARES", string.Format(" ({0:d})", comment.Info.SharedTimes));
}
if (hook != null)
{
hook(new DisplayCommentHookEventArgs(core, owner, commentPoster, commentsVariableCollection));
}
if (core.Session.IsLoggedIn)
{
if (owner.CanModerateComments(core.Session.LoggedInMember))
{
commentsVariableCollection.Parse("MODERATE", "TRUE");
}
}
if (owner.IsItemOwner(commentPoster))
{
commentsVariableCollection.Parse("OWNER", "TRUE");
commentsVariableCollection.Parse("NORMAL", "FALSE");
}
else
{
commentsVariableCollection.Parse("OWNER", "FALSE");
commentsVariableCollection.Parse("NORMAL", "TRUE");
}
if (comment.SpamScore >= 10)
{
commentsVariableCollection.Parse("IS_SPAM", "TRUE");
}
}
catch
{
// if userid is 0, anonymous
commentsVariableCollection.Parse("USERNAME", "Anonymous");
commentsVariableCollection.Parse("TIME", core.Tz.DateTimeToString(comment.GetTime(core.Tz)));
commentsVariableCollection.Parse("OWNER", "FALSE");
commentsVariableCollection.Parse("NORMAL", "TRUE");
}
}
template.Parse("LAST_ID", "lastId");
}