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

C# ContentPost类代码示例

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

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



ContentPost类属于命名空间,在下文中一共展示了ContentPost类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: bindAttachments

        private void bindAttachments( ContentPost post ) {

            set( "addLink", to( new AttachmentController().Add, post.Id ) );
            set( "sortAction", to( new AttachmentController().SaveSort, post.Id ) );

            ContentPost topic = postService.GetById( post.Id, ctx.owner.Id );
            List<ContentAttachment> attachList = attachService.GetAttachmentsByPost( post.Id );

            String cmd;
            if (topic.IsAttachmentLogin == 1) {
                String lockImg = strUtil.Join( sys.Path.Img, "edit.gif" );
                cmd = alang( "currentDownloadPermission" );
                cmd += string.Format( "<img src=\"{1}\" /> <a href=\"{0}\" class=\"frmBox\">", to( new AttachmentController().SetPermission, post.Id ), lockImg );
                cmd += lang( "edit" ) + "</a>";
            }
            else {
                String lockImg = strUtil.Join( sys.Path.Img, "lock.gif" );
                cmd = string.Format( "<img src=\"{1}\" /> <a href=\"{0}\" class=\"frmBox\">" + alang( "setDownloadPermission" ) + "</a>", to( new AttachmentController().SetPermission, post.Id ), lockImg );
            }
            set( "cmd", cmd );


            bindAttachments( attachList );

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


示例2: BeforeAction

        public override bool BeforeAction( MvcContext ctx )
        {
            ContentPost post = postService.GetById( ctx.route.id, ctx.owner.Id );
            _contentPost = post;

            return base.BeforeAction( ctx );
        }
开发者ID:Boshin,项目名称:wojilu,代码行数:7,代码来源:PostDeleteObserver.cs


示例3: bindSectionShow

        private void bindSectionShow( int sectionId, int imgcat, List<ContentPost> posts, ContentPost first )
        {
            set( "sectionId", sectionId );
            set( "addUrl", Link.To( new PostController().Add, sectionId ) + "?categoryId=" + imgcat );
            set( "listUrl", Link.To( new ListController().AdminList, sectionId ) + "?categoryId=" + imgcat );

            int slideWidth = first == null ? 300 : first.Width;
            int slideHeight = first == null ? 220 : first.Height;

            set( "slideWidth", slideWidth );
            set( "slideHeight", slideHeight );

            IBlock block = getBlock( "nav" );

            foreach (ContentPost photo in posts) {

                block.Set( "photo.TitleFull", photo.Title );

                if (strUtil.HasText( photo.TitleHome ))
                    block.Set( "photo.Title", photo.TitleHome );
                else
                    block.Set( "photo.Title", photo.Title );

                block.Set( "photo.ImgUrl", photo.GetImgMedium() );
                String lnk = photo.HasImg() ? Link.To( new PostController().EditImg, photo.Id ) : "#";
                block.Set( "photo.Link", lnk );
                block.Next();

            }
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:30,代码来源:SlideController.cs


示例4: bindFocus

 private void bindFocus( IBlock fblock, ContentPost article )
 {
     fblock.Set( "article.Title", strUtil.SubString( article.Title, 19 ) );
     fblock.Set( "article.SummaryInfo", strUtil.CutString( article.Summary, 100 ) );
     fblock.Set( "article.Url", alink.ToAppData( article, ctx ) );
     fblock.Next();
 }
开发者ID:ningboliuwei,项目名称:wojilu,代码行数:7,代码来源:FocusBinderController.cs


示例5: bindSectionShow

        private void bindSectionShow( int sectionId, List<ContentPost> posts, ContentPost first )
        {
            IBlock block = getBlock( "nav" );

            int width = first.Width - 20;
            int height = first.Height;
            set( "first.Width", width );
            set( "first.Height", height );

            foreach (ContentPost photo in posts) {

                block.Set( "photo.Width", width );
                block.Set( "photo.Height", height );

                block.Set( "photo.TitleFull", photo.Title );

                if (strUtil.HasText( photo.TitleHome ))
                    block.Set( "photo.Title", photo.TitleHome );
                else
                    block.Set( "photo.Title", photo.Title );

                block.Set( "photo.ImgUrl", photo.GetImgMedium() );
                block.Set( "photo.Link", alink.ToAppData( photo ) );

                block.Bind( "photo", photo );

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


示例6: bindShow

        private void bindShow( ContentPost post, DataPage<ContentImg> imgPage )
        {
            ctx.SetItem( "ContentPost", post );
            set( "post.Title", post.Title );
            set( "post.Content", post.Content );
            set( "post.CreateTime", post.Created );
            set( "post.ReplyCount", post.Replies );
            set( "post.Hits", post.Hits );

            set( "post.Source", post.SourceLink );

            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", "нч" );
            }

            IBlock block = getBlock( "list" );
            foreach (ContentImg img in imgPage.Results) {
                block.Set( "img.Url", img.GetImgUrl() );
                block.Set( "img.Description", img.Description );
                block.Next();
            }

            String postLink = alink.ToAppData( post );
            String pageBar = ObjectPage.GetPageBarByLink( postLink, imgPage.PageCount, imgPage.Current );

            set( "page", pageBar );
        }
开发者ID:robin88,项目名称:wojilu,代码行数:30,代码来源:ImgController.cs


示例7: getStatus

        private String getStatus( ContentPost post ) {

            if (post.HasImg()==false) return "";

            return "<img src=\""+strUtil.Join( sys.Path.Img, "img.gif" )+"\" />";

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


示例8: bindSectionShow

        private void bindSectionShow( List<ContentPost> posts, ContentPost img ) {
            IBlock block = getBlock( "list" );
            foreach (ContentPost post in posts) {

                BinderUtils.bindPostSingle( block, post, ctx );

                block.Next();
            }

            IBlock imgBlock = getBlock( "img" );
            if (img != null) {

                imgBlock.Set( "ipost.TitleCss", img.Style );

                String content = strUtil.HasText( img.Summary ) ? img.Summary : strUtil.ParseHtml( img.Content, 50 );
                imgBlock.Set( "ipost.Content", content );

                int width = img.Width <= 0 ? 120 : img.Width;
                int height = img.Height <= 0 ? 90 : img.Height;

                imgBlock.Set( "ipost.Width", width );
                imgBlock.Set( "ipost.Height", height );

                imgBlock.Set( "ipost.Url", alink.ToAppData( img, ctx ) );

                imgBlock.Bind( "ipost", img );

                imgBlock.Next();
            }
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:30,代码来源:NormalController.cs


示例9: transSectionOne

        private void transSectionOne( ContentPost x )
        {
            if (x.PageSection == null || x.PageSection.Id <= 0) return;

            int sectionId = x.PageSection.Id;

            ContentPostSection ps = hasTrans( x, sectionId );

            if (ps != null) {

                ps.SaveStatus = x.SaveStatus;
                ps.update();

            }
            else {

                ContentPostSection newPs = new ContentPostSection();
                newPs.Post = x;
                newPs.Section = x.PageSection;
                newPs.SaveStatus = x.SaveStatus;

                newPs.insert();

                logger.Info( "transSectionOne=> postId=" + x.Id + ", sectionId=" + x.PageSection.Id );
            }
        }
开发者ID:vthinker,项目名称:wojilu,代码行数:26,代码来源:ContentUpdateController.cs


示例10: getPickedIcon

        public static String getPickedIcon( ContentPost post ) {

            if (post.PickStatus == PickStatus.Picked) return iconPicked;
            if (post.PickStatus == PickStatus.Focus) return iconFocus;
            return "";

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


示例11: bindAddList

        private void bindAddList( int postId, ContentPost post, List<ContentImg> imgList )
        {
            set( "section.Name", post.PageSection.Title );
            set( "post.EditListInfo", to( EditListInfo, postId ) );
            IBlock block = getBlock( "list" );
            foreach (ContentImg img in imgList) {
                block.Set( "img.Url", img.GetImgUrl() );
                block.Set( "img.Thumb", img.GetThumb() );
                block.Set( "img.Description", strUtil.CutString( img.Description, 8 ) );
                block.Set( "img.DeleteUrl", to( DeleteImg, img.Id ) );
                String setLogoCmd = string.Empty;
                if (img.ImgUrl.Equals( post.ImgLink )) {
                    setLogoCmd = "<span style='font-weight:bold;color:red;'>" + alang( "currentCover" ) + "</span>";
                }
                else {
                    setLogoCmd = string.Format( "<a href='{0}' class=\"putCmd cmd\">" + alang( "setCover" ) + "</a>", to( SetLogo, img.Id ) );
                }
                block.Set( "img.SetLogo", setLogoCmd );
                block.Next();
            }

            int upCounts = 3;
            IBlock upblock = getBlock( "upList" );
            for (int i = 1; i < (upCounts + 1); i++) {
                upblock.Set( "photoIndex", i );
                upblock.Next();
            }
        }
开发者ID:robin88,项目名称:wojilu,代码行数:28,代码来源:ImgController.cs


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


示例13: bindEditCmd

        private void bindEditCmd( IBlock block, ContentPost post ) {
            String lnkEdit = "";

            lnkEdit = to( AddImgList, post.Id );

            block.Set( "post.EditUrl", lnkEdit );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:7,代码来源:ImgController.cs


示例14: 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


示例15: bindEditInfo

        private void bindEditInfo( long postId, ContentPost post ) {
            set( "section.Name", post.SectionName );
            set( "section.Id", post.SectionId );
            set( "post.Author", post.Author );
            set( "post.SourceLink", post.SourceLink );
            set( "post.Style", post.Style );
            set( "post.OrderId", post.OrderId );
            set( "post.Content", post.Content );


            set( "post.Created", post.Created );
            set( "post.Hits", post.Hits );
            set( "post.OrderId", post.OrderId );

            set( "post.RedirectUrl", post.RedirectUrl );
            set( "post.MetaKeywords", post.MetaKeywords );
            set( "post.MetaDescription", post.MetaDescription );


            set( "post.Summary", post.Summary );
            set( "post.SourceLink", post.SourceLink );
            set( "post.Style", post.Style );


            set( "post.TagList", post.Tag.TextString );
            String val = AccessStatusUtil.GetRadioList( post.AccessStatus );
            set( "post.AccessStatus", val );
            set( "post.IsCloseComment", Html.CheckBox( "IsCloseComment", lang( "closeComment" ), "1", cvt.ToBool( post.CommentCondition ) ) );

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


示例16: SetPostValue

        public static ContentPost SetPostValue( ContentPost post, MvcContext ctx ) {

            post.Author = strUtil.CutString( ctx.Post( "Author" ), 100 );
            post.Title = strUtil.CutString( ctx.Post( "Title" ), 100 );
            post.TitleHome = strUtil.CutString( ctx.Post( "TitleHome" ), 100 );
            post.Content = ctx.PostHtml( "Content" );
            post.Summary = ctx.Post( "Summary" );
            post.SourceLink = strUtil.CutString( ctx.Post( "SourceLink" ), 250 );
            post.AccessStatus = cvt.ToInt( ctx.Post( "AccessStatus" ) );
            post.CommentCondition = cvt.ToInt( ctx.Post( "IsCloseComment" ) );

            post.Hits = ctx.PostInt( "Hits" );
            post.Created = ctx.PostTime( "Created" );

            post.MetaKeywords = strUtil.CutString( ctx.Post( "MetaKeywords" ), 250 );
            post.MetaDescription = strUtil.CutString( ctx.Post( "MetaDescription" ), 250 );
            post.RedirectUrl = strUtil.CutString( ctx.Post( "RedirectUrl" ), 250 );
            post.PickStatus = ctx.PostInt( "PickStatus" );

            post.SaveStatus = 0;
            post.Ip = ctx.Ip;
            post.Style = strUtil.CutString( ctx.Post( "Style" ), 250 );
            post.OrderId = ctx.PostInt( "OrderId" );

            post.ImgLink = sys.Path.GetPhotoRelative( ctx.Post( "ImgLink" ) );

            post.Width = ctx.PostInt( "Width" );
            post.Height = ctx.PostInt( "Height" );

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


示例17: bindSectionShow

        private void bindSectionShow( long sectionId, ContentPost video ) {

            int vWidth = 320;
            int vHeight = 240;

            set( "addUrl", to( new VideoController().Add, sectionId ) + "?width=" + vWidth + "&height=" + vHeight );
            set( "listUrl", to( new VideoController().AdminList, sectionId ) );

            if (video == null) {
                set( "post.Content", "" );
                set( "post.Title", "" );
            }
            else {
                String content = WebHelper.GetFlash( video.SourceLink, video.Width, video.Height );
                set( "post.Content", content );

                if (strUtil.HasText( video.TitleHome ))
                    set( "post.Title", video.TitleHome );
                else
                    set( "post.Title", video.Title );
            }

            IBlock editlinkBlock = getBlock( "editlink" );
            if (video != null) {
                editlinkBlock.Set( "post.EditUrl", to( new VideoController().Edit, video.Id ) );
                editlinkBlock.Next();
            }
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:28,代码来源:VideoShowController.cs


示例18: bindSectionShow

        private void bindSectionShow( int sectionId, ContentPost video )
        {
            set( "addUrl", to( Add, sectionId ) );
            set( "listUrl", to( AdminList, sectionId ) );

            if (video == null) {
                set( "post.Content", "" );
                set( "post.Title", "" );
            }
            else {
                String content = WebHelper.GetFlash( video.SourceLink, video.Width, video.Height );
                set( "post.Content", content );

                if (strUtil.HasText( video.TitleHome ))
                    set( "post.Title", video.TitleHome );
                else
                    set( "post.Title", video.Title );
            }

            IBlock editlinkBlock = getBlock( "editlink" );
            if (video != null) {
                editlinkBlock.Set( "post.EditUrl", to( Edit, video.Id ) );
                editlinkBlock.Next();
            }
        }
开发者ID:robin88,项目名称:wojilu,代码行数:25,代码来源:VideoShowController.cs


示例19: PostUpdate

        public static void PostUpdate( ContentPost post )
        {
            HtmlJobItem item = new HtmlJobItem();
            item.Name = typeof( JobProcessor ).FullName;
            item.Method = getMethodName( new JobProcessor().AfterPostUpdate );
            item.PostId = post.Id;

            cdb.insert( item );
        }
开发者ID:ningboliuwei,项目名称:wojilu,代码行数:9,代码来源:JobManager.cs


示例20: ValidateTitleBody

        public static ContentPost ValidateTitleBody( ContentPost post, MvcContext ctx ) {

            if (strUtil.IsNullOrEmpty( post.Title ))
                ctx.errors.Add( lang.get( "exTitle" ) );

            if (strUtil.IsNullOrEmpty( post.Content ) && strUtil.IsNullOrEmpty( post.SourceLink ))
                ctx.errors.Add( ctx.controller.alang( "exContentLink" ) );

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ContentProcessorContext类代码示例发布时间:2022-05-24
下一篇:
C# ContentPage类代码示例发布时间: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