• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ContentSection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ContentSection的典型用法代码示例。如果您正苦于以下问题:C# ContentSection类的具体用法?C# ContentSection怎么用?C# ContentSection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ContentSection类属于命名空间,在下文中一共展示了ContentSection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 );
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:31,代码来源:PollController.cs


示例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();

            }

        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:29,代码来源:ListTimeBinderController.cs


示例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 );
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:34,代码来源:ListController.cs


示例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();
            }

        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:30,代码来源:ExcerptBinderController.cs


示例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;
 }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:7,代码来源:SectionDataController.cs


示例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();
            }
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:34,代码来源:MyFeedbackBinderController.cs


示例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 ) );
            }
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:26,代码来源:VideoShowController.cs


示例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 ) );
        }
开发者ID:Boshin,项目名称:wojilu,代码行数:7,代码来源:MyInfoBinderController.cs


示例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;
        }
开发者ID:bae2014,项目名称:wojilu,代码行数:8,代码来源:ContentController.cs


示例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" ) );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:8,代码来源:VideoController.cs


示例11: getSectionContent

 // TODO 封装
 private String getSectionContent( ContentSection section ) {
     String content;
     if (section.ServiceId <= 0) {
         content = getData( section );
     } else {
         content = getAutoData( section );
     }
     return content;
 }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:10,代码来源:SectionDataController.cs


示例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 );
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:9,代码来源:TemplateUtil.cs


示例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);
        }
开发者ID:ukp-webdev,项目名称:veneer-client,代码行数:9,代码来源:ContractTests.cs


示例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;
 }
开发者ID:Boshin,项目名称:wojilu,代码行数:9,代码来源:ContentSectionService.cs


示例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 ) );
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:9,代码来源:MyInfoBinderController.cs


示例16: getTemplatePath

        // wojilu.Web.Controller.Content.Section.TextController => Content/Section/Text/SectionShow
        private static String getTemplatePath( ContentSection s ) {
            String tpath = strUtil.TrimStart( s.SectionType, "wojilu.Web.Controller." );
            tpath = strUtil.TrimEnd( tpath, "Controller" );
            tpath = tpath.Replace( ".", "/" );

            tpath = strUtil.Join( tpath, "SectionShow" );

            return tpath;
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:10,代码来源:TemplateCustomController.cs


示例17: ContentSection_contains_html_fragment

        public void ContentSection_contains_html_fragment()
        {
            // Arrange
            const string content = "<div id=\"test\">test</div>";
            var contentSection = new ContentSection { Html = content };

            // Act / Assert
            Assert.That(contentSection.Html, Is.EqualTo(content));
        }
开发者ID:ukp-webdev,项目名称:veneer-client,代码行数:9,代码来源:ContractTests.cs


示例18: Bind

        public void Bind( ContentSection section, IList serviceData )
        {
            IBlock fblock = getBlock( "focus" );
            IBlock block = getBlock( "list" );
            if (serviceData.Count == 0) return;

            bindFocus( fblock, (ContentPost)serviceData[0] ); // 第一篇是焦点要闻
            bindPickedList( serviceData, block );
        }
开发者ID:ningboliuwei,项目名称:wojilu,代码行数:9,代码来源:FocusBinderController.cs


示例19: bindSectionShow

        private void bindSectionShow( ContentSection section, List<ContentPost> posts )
        {
            set( "m.Title", section.Title );
            IBlock block = getBlock( "list" );
            foreach (ContentPost post in posts) {
                BinderUtils.bindPostSingle( block, post );

                block.Next();
            }
        }
开发者ID:robin88,项目名称:wojilu,代码行数:10,代码来源:ListTwoController.cs


示例20: Bind

        public void Bind( ContentSection section, IList serviceData )
        {
            User user = ctx.owner.obj as User;

            if (user == null) {
                content( "" );
                return;
            }

            bindFace( user );
        }
开发者ID:Boshin,项目名称:wojilu,代码行数:11,代码来源:MyFaceBinderController.cs



注:本文中的ContentSection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ContentType类代码示例发布时间:2022-05-24
下一篇:
C# ContentRef类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap