本文整理汇总了C#中ContentSection类的典型用法代码示例。如果您正苦于以下问题:C# ContentSection类的具体用法?C# ContentSection怎么用?C# ContentSection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentSection类属于命名空间,在下文中一共展示了ContentSection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: bindList
private void bindList( ContentSection section, DataPage<ContentPost> list, List<ContentPoll> polls )
{
User user = (User)ctx.viewer.obj;
set( "section.Name", section.Title );
IBlock block = getBlock( "list" );
for (int i = 0; i < polls.Count; i++) {
ContentPoll poll = polls[i];
ContentPost post = list.Results[i];
block.Set( "post.Created", poll.Created );
ctx.SetItem( "poll", poll );
Boolean hasVote = poll.CheckHasVote( user.Id );
String html = hasVote ? loadHtml( sectionPollResult ) : loadHtml( sectionPoll );
block.Set( "post.Html", html );
//block.Set( "post.ShowLink", to( Show, post.Id ) );
block.Set( "post.ShowLink", alink.ToAppData( post ) );
String replies = post.Replies > 0 ? lang("comment") + " :" + post.Replies : "";
block.Set( "post.Replies", replies );
block.Next();
}
set( "page", list.PageBar );
}
示例2: Bind
public virtual void Bind( ContentSection section, IList serviceData ) {
IBlock block = base.getBlock( "list" );
foreach (IBinderValue item in serviceData) {
block.Set( "post.Title", item.Title );
block.Set( "post.Url", item.Link );
block.Set( "post.Created", item.Created );
block.Set( "post.CreatedDay", item.Created.ToShortDateString() );
block.Set( "post.CreatedTime", item.Created.ToShortTimeString() );
block.Set( "post.CreatorName", item.CreatorName );
block.Set( "post.CreatorLink", item.CreatorLink );
block.Set( "post.CreatorPic", item.CreatorPic );
block.Set( "post.Content", item.Content );
block.Set( "post.Summary", strUtil.CutString( item.Content, 200 ) );
block.Set( "post.PicUrl", item.PicUrl );
block.Set( "post.Replies", item.Replies );
block.Bind( "post", item );
block.Next();
}
}
示例3: bindAdminList
private void bindAdminList( ContentSection section, DataPage<ContentPost> posts )
{
set( "section.Title", section.Title );
IBlock block = getBlock( "list" );
String icon = string.Format( "<img src=\"{0}\"/> ", strUtil.Join( sys.Path.Img, "img.gif" ) );
foreach (ContentPost post in posts.Results) {
String imgIcon = post.HasImg() ? icon : "";
block.Set( "post.ImgIcon", imgIcon );
block.Set( "post.Title", strUtil.SubString( post.Title, 50 ) );
block.Set( "post.TitleCss", post.Style );
block.Set( "post.TitleFull", post.Title );
block.Set( "post.OrderId", post.OrderId );
block.Set( "post.Url", post.SourceLink );
block.Set( "post.Link", strUtil.CutString( post.SourceLink, 100 ) );
block.Set( "post.PubDate", post.Created );
String attachments = post.Attachments > 0 ? "<img src='" + strUtil.Join( sys.Path.Img, "attachment.gif" ) + "'/>" : "";
block.Set( "post.Attachments", attachments );
if (post.HasImg())
block.Set( "post.EditUrl", to( new PostController().EditImg, post.Id ) );
else
block.Set( "post.EditUrl", to( new PostController().Edit, post.Id ) );
block.Set( "post.DeleteUrl", to( Delete, post.Id ) );
block.Next();
}
set( "page", posts.PageBar );
}
示例4: Bind
public virtual void Bind( ContentSection section, IList serviceData ) {
IBlock block = base.getBlock( "list" );
foreach (IBinderValue item in serviceData) {
block.Bind( "d", item );
IBlock tcBlock = block.GetBlock( "titleAndContent" );
IBlock onlyBlock = block.GetBlock( "onlyTitle" );
if (strUtil.HasText( item.Content )) {
tcBlock.Set( "d.Title", strUtil.CutString( item.Title, 20 ) );
tcBlock.Set( "d.Content", strUtil.ParseHtml( item.Content, 150 ) );
tcBlock.Set( "d.Created", item.Created );
tcBlock.Bind( "c", item );
tcBlock.Next();
}
else {
onlyBlock.Set( "d.Title", item.Title );
onlyBlock.Bind( "c", item );
onlyBlock.Set( "d.Created", item.Created );
onlyBlock.Next();
}
block.Next();
}
}
示例5: getData
private String getData( ContentSection articleSection ) {
IPageSection section = BinderUtils.GetPageSection( articleSection, ctx );
ControllerBase sectionController = section as ControllerBase;
section.SectionShow( articleSection.Id );
String actionContent = sectionController.utils.getActionResult();
return actionContent;
}
示例6: Bind
public void Bind( ContentSection section, IList serviceData )
{
TemplateUtil.loadTemplate( this, section, ctService );
//target( new FeedbackController().Create );
set( "ActionLink", t2( new FeedbackController().Create ) );
if (ctx.viewer.Id == ctx.owner.Id && ctx.owner.obj is User)
set( "f.ListLink", t2( new FeedbackController().AdminList ) );
else
set( "f.ListLink", t2( new FeedbackController().List ) );
String pwTip = string.Format( lang( "pwTip" ), Feedback.ContentLength );
set( "pwTip", pwTip );
IBlock block = getBlock( "list" );
foreach (Feedback f in serviceData) {
if (f.Creator == null) continue;
block.Set( "f.UserName", f.Creator.Name );
block.Set( "f.UserFace", f.Creator.PicSmall );
block.Set( "f.UserLink", Link.ToMember( f.Creator ) );
block.Set( "f.ReplyLink", t2( new FeedbackController().Reply, f.Id ) );
block.Set( "f.Content", f.GetContent() );
block.Set( "f.Created", cvt.ToTimeString( f.Created ) );
block.Bind( "f", f );
block.Next();
}
}
示例7: bindSectionShow
private void bindSectionShow( ContentSection section, ContentPost video )
{
set( "m.Title", section.Title );
if (video == null) {
set( "video.Content", "" );
set( "video.TitleFull", "" );
set( "video.Title", "" );
set( "video.Url", "" );
}
else {
String content = WebHelper.GetFlash( video.SourceLink, video.Width, video.Height );
set( "video.Content", content );
set( "video.TitleFull", video.Title );
if (strUtil.HasText( video.TitleHome ))
set( "video.Title", video.TitleHome );
else
set( "video.Title", video.Title );
set( "video.Url", alink.ToAppData( video ) );
}
}
示例8: Bind
public void Bind( ContentSection section, IList serviceData )
{
User user = ctx.owner.obj as User;
if (user == null) return;
bind( "user", new UserVo( user ) );
}
示例9: getTitle
private String getTitle( ContentSection section, String moreUrl ) {
if (strUtil.IsNullOrEmpty( moreUrl )) return section.Title;
if (moreUrl.Equals( "#" )) return section.Title;
if (isUrl( moreUrl )) return string.Format( "<a href=\"{0}\">{1}</a>", moreUrl, section.Title );
return section.Title;
}
示例10: bindAddInfo
private void bindAddInfo( ContentSection section ) {
set( "section.Name", section.Title );
set( "section.Id", section.Id );
set( "created", DateTime.Now );
set( "width", ctx.GetLong( "width" ) );
set( "height", ctx.GetLong( "height" ) );
}
示例11: getSectionContent
// TODO 封装
private String getSectionContent( ContentSection section ) {
String content;
if (section.ServiceId <= 0) {
content = getData( section );
} else {
content = getAutoData( section );
}
return content;
}
示例12: loadTemplate
public static void loadTemplate( ControllerBase controller, ContentSection s, IContentCustomTemplateService ctService )
{
if (s.CustomTemplateId <= 0) return;
ContentCustomTemplate ct = ctService.GetById( s.CustomTemplateId, controller.ctx.owner.Id );
if (ct == null) return;
controller.viewContent( ct.Content );
}
示例13: ContentSection_contains_list_of_styles
public void ContentSection_contains_list_of_styles()
{
// Arrange
var contentSection = new ContentSection();
// Act / Assert
Assert.That(contentSection.Styles, Is.Not.Null);
Assert.That(contentSection.Styles, Is.Empty);
}
示例14: GetForCombine
public virtual List<ContentSection> GetForCombine( ContentSection section )
{
List<ContentSection> sections = GetByApp( section.AppId );
List<ContentSection> list = new List<ContentSection>();
foreach (ContentSection s in sections) {
if (s.Id != section.Id && notCombined( sections, s )) list.Add( s );
}
return list;
}
示例15: Bind
public void Bind( ContentSection section, IList serviceData )
{
TemplateUtil.loadTemplate( this, section, ctService );
User user = ctx.owner.obj as User;
if (user == null) return;
bind( "user", new UserVo( user ) );
}