本文整理汇总了C#中ContentPost.GetTitle方法的典型用法代码示例。如果您正苦于以下问题:C# ContentPost.GetTitle方法的具体用法?C# ContentPost.GetTitle怎么用?C# ContentPost.GetTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentPost
的用法示例。
在下文中一共展示了ContentPost.GetTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bindListItem
public static void bindListItem( IBlock block, ContentPost post, MvcContext ctx )
{
block.Set( "post.SectionName", post.PageSection.Title );
block.Set( "post.SectionUrl", ctx.to( new SectionController().Show, post.PageSection.Id ) );
String typeIcon = BinderUtils.getTypeIcon( post );
block.Set( "post.ImgIcon", typeIcon );
String att = post.Attachments > 0 ? "<img src=\"" + strUtil.Join( sys.Path.Img, "attachment.gif" ) + "\"/>" : "";
block.Set( "post.AttachmentIcon", att );
block.Set( "post.TitleCss", post.Style );
block.Set( "post.Title", strUtil.SubString( post.GetTitle(), 50 ) );
block.Set( "post.Created", post.Created );
block.Set( "post.Hits", post.Hits );
block.Set( "post.Url", alink.ToAppData( post ) );
if (post.Creator != null) {
block.Set( "post.Submitter", string.Format( "<a href=\"{0}\" target=\"_blank\">{1}</a>", Link.ToMember( post.Creator ), post.Creator.Name ) );
}
else {
block.Set( "post.Submitter", "" );
}
}
示例2: bindDetail
private void bindDetail( int id, ContentPost post )
{
set( "post.Title", post.GetTitle() );
set( "post.Author", post.Author );
set( "post.Created", post.Created );
String tag = post.Tag.List.Count > 0 ? tag = "tag: " + post.Tag.HtmlString : "";
String src = getSrc( post );
String replies = getReplies( post );
set( "post.Tag", tag );
set( "post.Replies", replies );
set( "post.Hits", post.Hits );
set( "post.Source", src );
if (post.Creator != null) {
set( "post.Submitter", string.Format( "<a href=\"{0}\" target=\"_blank\">{1}</a>", Link.ToMember( post.Creator ), post.Creator.Name ) );
}
else {
set( "post.Submitter", "ÎÞ" );
}
bindSummary( post );
String content;
String pageSeparator = getPageSeparator( post.Content );
if (pageSeparator == null) {
content = post.Content;
}
else {
content = getPagedContent( post, pageSeparator );
}
if (post.HasImg()) {
content = string.Format( "<div style=\"text-align:center;\"><img src=\"{0}\" />", post.GetImgMedium() ) + "</div>" + content;
}
if (post.IsAttachmentLogin == 1 && ctx.viewer.IsLogin == false) {
content += "<div class=\"downloadWarning\"><div>" + alang( "downloadNeedLogin" ) + "</div></div>";
}
else {
content = addAttachment( post, content );
}
set( "post.Content", content );
}
示例3: bindMetaInfo
private void bindMetaInfo( ContentPost post ) {
ctx.Page.SetTitle( post.GetTitle(), ctx.app.Name );
if (strUtil.HasText( post.MetaKeywords ))
this.Page.Keywords = post.MetaKeywords;
else
this.Page.Keywords = post.Tag.TextString;
if (strUtil.HasText( post.MetaDescription ))
this.Page.Description = post.MetaDescription;
else
this.Page.Description = post.Summary;
}