当前位置: 首页>>代码示例>>C#>>正文


C# IBlock.Set方法代码示例

本文整理汇总了C#中IBlock.Set方法的典型用法代码示例。如果您正苦于以下问题:C# IBlock.Set方法的具体用法?C# IBlock.Set怎么用?C# IBlock.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IBlock的用法示例。


在下文中一共展示了IBlock.Set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: setBoard

        private void setBoard( IBlock fbBlock, ForumBoard fb ) {

            fbBlock.Set( "board.StyleClass", "" );

            fbBlock.Set( "board.AddUrl", string.Format( "<a href='{0}' class='frmBox' title='" + alang( "addSubBoard" ) + "'>+" + lang( "add" ) + "</a>", to( AddSubBoard, fb.Id ) ) );

            fbBlock.Set( "board.EditUrl", to( EditBoard, fb.Id ) );
            fbBlock.Set( "board.DeleteUrl", to( DeleteBoard, fb.Id ) );
            fbBlock.Set( "lineStyle", "" );

            int categoryCount = categoryService.CountByBoard( fb.Id );
            String categoryCountStr = categoryCount > 0 ? "(" + categoryCount + ")" : "";
            String lnkSetCategory = string.Format( "<a href='{0}' class='frmBox' title='" + alang( "postCategoryAdmin" ) + "'>" + alang( "category" ) + "{1}</a>", to( new CategoryController().Admin, fb.Id ), categoryCountStr );

            String imgUser = strUtil.Join( sys.Path.Img, "users.gif" );
            String imgSecurity = strUtil.Join( sys.Path.Img, "security.gif" );

            String lnkSetModerator = string.Format( "<a href='{0}' class='frmBox' title='" + alang( "setModerator" ) + "'><img src=\"{1}\"/> " + alang( "setModerator" ) + "</a>", to( new ModeratorController().List, fb.Id ), imgUser );
            String lnkSetSecurity = string.Format( "<a href='{0}' class='frmBox' xwidth='600' title='" + alang( "setSecurity" ) + "'><img src=\"{1}\"/> " + alang( "setSecurity" ) + "</a>", to( new SecurityController().BoardSetting, fb.Id ), imgSecurity );

            fbBlock.Set( "board.SetCategory", lnkSetCategory );
            fbBlock.Set( "board.Moderator", moderatorService.GetModeratorText( fb.Moderator ) );
            fbBlock.Set( "board.SetModerator", lnkSetModerator );
            fbBlock.Set( "board.SetSecurity", lnkSetSecurity );
            fbBlock.Set( "deleteMsg", alang( "exDeleteBoardTip" ) );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:26,代码来源:BoardController.cs

示例2: bindColumnList

        private void bindColumnList( List<ContentSection> sectionList, int iRow, int columnCount, IBlock columnBlock )
        {
            for (int i = 1; i < (columnCount + 1); i++) {
                columnBlock.Set( "App.ImgPath", sys.Path.Img );
                columnBlock.Set( "column.Id", string.Concat( new object[] { "row", iRow, "_column", i } ) );

                String ctitle = alang( "columnNo" );
                columnBlock.Set( "column.Name", string.Format( ctitle, i ) );
                columnBlock.Set( "column.Index", i );

                int rowColumnId = cvt.ToInt( iRow + "" + i );

                String addUrl = to( new ContentSectionController().Add, rowColumnId );
                String addAutoUrl = to( new ContentSectionController().AddAuto, rowColumnId );
                String addFeed = to( new ContentSectionController().AddFeed, rowColumnId );
                String editUILink = to( new ContentSectionController().EditUI, rowColumnId );

                columnBlock.Set( "column.AddModuleUrl", addUrl );
                columnBlock.Set( "column.AddAutoSection", addAutoUrl );
                columnBlock.Set( "column.AddFeed", addFeed );

                columnBlock.Set( "column.EditUILink", editUILink );

                List<ContentSection> sections = sectionService.GetByRowColumn( sectionList, iRow, i );
                IBlock sectionBlock = columnBlock.GetBlock( "sectionList" );
                bindSectionList( sections, sectionBlock );
                columnBlock.Next();
            }
        }
开发者ID:ningboliuwei,项目名称:wojilu,代码行数:29,代码来源:ContentController.cs

示例3: bindOneFeed

        private void bindOneFeed( IBlock block, List<FeedView> feedList )
        {
            foreach (FeedView feed in feedList) {

                if (feed.DataType.Equals( typeof( FriendShip ).FullName )) continue;

                if (feed.Creator == null) continue;

                block.Set( "feed.DataType", feed.DataType );
                block.Set( "feed.UserFace", feed.Creator.PicSmall );
                block.Set( "feed.UserLink", Link.ToMember( feed.Creator ) );

                String creatorInfo = string.Format( "<a href='{0}'>{1}</a>", Link.ToMember( feed.Creator ), feed.Creator.Name );
                String feedTitle = feedService.GetHtmlValue( feed.TitleTemplate, feed.TitleData, creatorInfo );
                block.Set( "feed.Title", feedTitle );

                String feedBody = feedService.GetHtmlValue( feed.BodyTemplate, feed.BodyData, creatorInfo );
                block.Set( "feed.Body", feedBody );
                block.Set( "feed.Created", feed.Created );

                block.Set( "feed.BodyGeneral", getComment( feed.BodyGeneral ) );

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

示例4: bindSectionList

        private void bindSectionList( IBlock sectionBlock, IList sections )
        {
            foreach (ContentSection section in sections) {

                String moreUrl = getMoreUrl( section );
                String moreLink = getMoreLink( moreUrl );
                String title = getTitle( section, moreUrl );

                sectionBlock.Set( "section.Title", title );
                sectionBlock.Set( "section.MoreLink", moreLink );
                sectionBlock.Set( "section.CombineIds", section.CombineIds );

                String marquee = section.GetMarquee();
                if (strUtil.HasText( marquee )) {
                    String m = string.Format( "<marquee direction=\"{0}\" onMouseOver=\"stop()\" onMouseOut=\"start()\">", marquee );
                    sectionBlock.Set( "section.MarqueeStart", m );
                    sectionBlock.Set( "section.MarqueeEnd", "</marquee>" );
                }
                else {
                    sectionBlock.Set( "section.MarqueeStart", "" );
                    sectionBlock.Set( "section.MarqueeEnd", "" );
                }

                sectionBlock.Set( "section.Id", section.Id );
                String content = getSectionContent( section );
                sectionBlock.Set( "section.Content", content );
                sectionBlock.Next();

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

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

示例6: bindLink

        private void bindLink( IBlock tpl, String lbl, object obj ) {
            PhotoPost data = obj as PhotoPost;

            String cssClass = getStatus( data );
            tpl.Set( "photo.PickedClass", cssClass );

            tpl.Set( "photo.LinkShow", alink.ToAppData( data ) );
        }
开发者ID:2014AmethystCat,项目名称:wojilu,代码行数:8,代码来源:PostAdminController.cs

示例7: bindAppList

 private void bindAppList( IList apps, IBlock block )
 {
     foreach (IMemberApp app in apps) {
         block.Set( "app.Name", app.Name );
         String lnk = lnkFull( alink.ToUserAppFull( app ) );
         block.Set( "app.Link", lnk );
         block.Next();
     }
 }
开发者ID:robin88,项目名称:wojilu,代码行数:9,代码来源:DashboardController.cs

示例8: bindLinkPrivate

 private static void bindLinkPrivate( List<ForumLink> linkList, IBlock block )
 {
     foreach (ForumLink x in linkList) {
         block.Set( "x.Name", x.Name );
         block.Set( "x.Url", x.Url );
         block.Set( "x.Logo", x.Logo );
         block.Next();
     }
 }
开发者ID:Boshin,项目名称:wojilu,代码行数:9,代码来源:ForumController.cs

示例9: bindLink

        private void bindLink( IBlock tpl, String lbl, object obj ) {

            FooterMenu data = obj as FooterMenu;

            if (data == null) return;

            tpl.Set( "data.Link", lnkFull( data.Link ) );
            tpl.Set( "data.LinkEdit", to( Edit, data.Id ) );
            tpl.Set( "data.LinkDelete", to( Delete, data.Id ) );
        }
开发者ID:bae2014,项目名称:wojilu,代码行数:10,代码来源:FooterMenuController.cs

示例10: bindListItem

        public static void bindListItem( IBlock block, ContentPost post, MvcContext ctx ) {

            if (post.PageSection != null) {

                block.Set( "post.SectionName", post.PageSection.Title );
                block.Set( "post.SectionUrl", clink.toSection( post.PageSection.Id, ctx ) );

            }

            IPageAdminSection sectionController = BinderUtils.GetPageSectionAdmin( post, ctx, "AdminSectionShow" );

            String typeIcon = sectionController.GetSectionIcon( post.SectionId );

            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.ToString( "yyyy-MM-dd HH:mm:ss" ) );
            block.Set( "post.Hits", post.Hits );
            block.Set( "post.Url", alink.ToAppData( post, ctx ) );

            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:2014AmethystCat,项目名称:wojilu,代码行数:32,代码来源:BinderUtils.cs

示例11: bindMenuSingle

        public static void bindMenuSingle( IBlock block, IMenu menu, MvcContext ctx )
        {
            block.Set( "menu.Id", menu.Id );
            block.Set( "menu.Name", menu.Name );
            block.Set( "menu.Style", menu.Style );
            block.Set( "menu.Link", UrlConverter.toMenu( menu, ctx ) );

            String lnkTarget = menu.OpenNewWindow == 1 ? lnkTarget = " target=\"_blank\"" : "";
            block.Set( "menu.LinkTarget", lnkTarget );

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

示例12: bindRoleLine

        private void bindRoleLine( IBlock block, SiteRole role, String lbl ) {

            block.Set( lbl + ".Name", role.Name );
            block.Set( lbl + ".RenameLink", to( Rename, role.Id ) );

            String deleteLink = "";
            if (role.Id != SiteRole.Administrator.Id && role.Id != SiteRole.NormalMember.Id && role.Id != SiteRole.Guest.Id)
                deleteLink = string.Format( " <span href='{0}' class='deleteCmd'>" + lang( "delete" ) + "</span>", to( Delete, role.Id ) );
            block.Set( lbl + ".DeleteLink", deleteLink );

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

示例13: bindColumnList

        private void bindColumnList( List<ContentSection> sectionList, int iRow, int columnCount, IBlock columnBlock ) {
            for (int i = 1; i < (columnCount + 1); i++) {

                columnBlock.Set( "column.Index", i );
                columnBlock.Set( "column.Id", "row" + iRow + "_column" + i );
                columnBlock.Set( "columnId", string.Format( "row{0}_column{1}", iRow, i ) );

                IBlock sectionBlock = columnBlock.GetBlock( "sectionList" );
                List<ContentSection> sections = SectionService.GetByRowColumn( sectionList, iRow, i );
                bindSectionList( sectionBlock, sections );
                columnBlock.Next();
            }
        }
开发者ID:bae2014,项目名称:wojilu,代码行数:13,代码来源:ContentController.cs

示例14: bindUserInfo

        private static void bindUserInfo( IBlock block, MvcContext ctx, Microblog blog, Boolean showUserFace )
        {
            IBlock ufBlock = block.GetBlock( "userFace" );
            if (showUserFace) {

                ufBlock.Set( "blog.UserName", blog.User.Name );
                ufBlock.Set( "blog.UserFace", blog.User.PicSmall );

                if (ctx.GetItemString( "_showType" ) == "microblog") {
                    ufBlock.Set( "blog.UserLink", alink.ToUserMicroblog( blog.User ) );
                    ufBlock.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", alink.ToUserMicroblog( blog.User ), blog.User.Name ) );
                }
                else {
                    ufBlock.Set( "blog.UserLink", Link.ToMember( blog.User ) );
                    ufBlock.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", Link.ToMember( blog.User ), blog.User.Name ) );
                }

                String deleteCmd = getDeleteCmd( ctx, blog );
                ufBlock.Set( "blog.DeleteCmd", deleteCmd );

                ufBlock.Next();

                if (ctx.GetItemString( "_showType" ) == "microblog") {
                    block.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", alink.ToUserMicroblog( blog.User ), blog.User.Name ) );
                }
                else {
                    block.Set( "userNameInfo", string.Format( "<a href=\"{0}\">{1}</a>", Link.ToMember( blog.User ), blog.User.Name ) );
                }

            }
            else {
                block.Set( "userNameInfo", "" );
            }
        }
开发者ID:KDF5000,项目名称:wojilu,代码行数:34,代码来源:MicroblogController.cs

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


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