コード例 #1
0
        protected void RenderButton(ToolbarButton button, ToolbarButtonFlags flags, Toolbar.RenderMenuItems renderMenuItems, SanitizedHtmlString addtionalMarkup)
        {
            if (button == null)
            {
                throw new ArgumentNullException("button");
            }
            flags |= button.Flags;
            bool flag                   = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.BigSize);
            bool isDisabled             = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.Disabled);
            bool flag2                  = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.AlwaysPressed);
            bool isPressed              = flag2 || ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.Pressed);
            bool isComboMenu            = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.ComboMenu);
            bool flag3                  = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.ComboDropDown);
            bool flag4                  = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.NoAction);
            bool renderBigButtonWrapper = this.HasBigButton && (!flag3 || !flag);
            bool hasDropdown            = (flags & ToolbarButtonFlags.Menu) != ToolbarButtonFlags.None || ((flags & ToolbarButtonFlags.CustomMenu) != ToolbarButtonFlags.None && ToolbarButtonFlags.None == (flags & ToolbarButtonFlags.ComboMenu));
            bool isShareButton          = false;

            if (button.TextId == 2009299861 || button.TextId == -1011044205 || button.TextId == -1230529569 || button.TextId == -142048603)
            {
                isShareButton = true;
            }
            this.InternalRenderButtonStart(button, flags, renderMenuItems, flag, isDisabled, isPressed, flag3, flag4, renderBigButtonWrapper, isComboMenu, hasDropdown, isShareButton);
            if (!flag4)
            {
                this.InternalRenderLinkStart(button, flags, flag2, isPressed, flag3, renderBigButtonWrapper);
            }
            this.InternalRenderButtonBody(button, flags, addtionalMarkup, flag, flag3, hasDropdown);
            if (!flag4)
            {
                this.InternalRenderLinkEnd();
            }
            if ((flags & ToolbarButtonFlags.Radio) != ToolbarButtonFlags.None)
            {
                RenderingUtilities.RenderDropShadows(this.writer, this.sessionContext);
            }
            this.InternalRenderMenu(button, flags, renderMenuItems);
            this.InternalRenderButtonEnd(button, flags, renderMenuItems, flag, renderBigButtonWrapper, isComboMenu);
        }
コード例 #2
0
        private void RenderComboDropDown(ToolbarButton button, ToolbarButtonFlags flags, Toolbar.RenderMenuItems renderMenuItems)
        {
            ToolbarButtonFlags toolbarButtonFlags = ToolbarButtonFlags.ComboDropDown | (flags & ToolbarButtonFlags.BigSize) | (flags & ToolbarButtonFlags.CustomMenu) | (flags & ToolbarButtonFlags.Disabled) | (flags & ToolbarButtonFlags.Hidden) | (flags & ToolbarButtonFlags.AlwaysPressed);

            if ((flags & ToolbarButtonFlags.CustomMenu) == ToolbarButtonFlags.None)
            {
                toolbarButtonFlags |= ToolbarButtonFlags.Menu;
            }
            this.RenderButton(new ToolbarButton(button.Command, toolbarButtonFlags), renderMenuItems);
        }
コード例 #3
0
 private void InternalRenderButtonEnd(ToolbarButton button, ToolbarButtonFlags flags, Toolbar.RenderMenuItems renderMenuItems, bool isBig, bool renderBigButtonWrapper, bool isComboMenu)
 {
     this.writer.Write("</div>");
     if ((!this.IsRightAligned || isBig) && isComboMenu)
     {
         this.RenderComboDropDown(button, flags, renderMenuItems);
     }
     if (renderBigButtonWrapper)
     {
         this.writer.Write("</div>");
     }
 }
コード例 #4
0
 private void InternalRenderMenu(ToolbarButton button, ToolbarButtonFlags flags, Toolbar.RenderMenuItems renderMenuItems)
 {
     if ((flags & ToolbarButtonFlags.Menu) != ToolbarButtonFlags.None)
     {
         this.writer.Write("<div id=\"tbl");
         this.writer.Write(button.Command);
         this.writer.Write("Mnu\" class=\"subMenu\" style=\"display:none;\">");
         renderMenuItems();
         RenderingUtilities.RenderDropShadows(this.writer, this.sessionContext);
         this.writer.Write("</div>");
     }
 }
コード例 #5
0
 private void InternalRenderButtonStart(ToolbarButton button, ToolbarButtonFlags flags, Toolbar.RenderMenuItems renderMenuItems, bool isBig, bool isDisabled, bool isPressed, bool isComboDropDown, bool isNoAction, bool renderBigButtonWrapper, bool isComboMenu, bool hasDropdown, bool isShareButton)
 {
     if (renderBigButtonWrapper)
     {
         this.writer.Write("<div class=\"tbBigWrap ");
         this.RenderFloatCssClass();
         this.writer.Write("\"");
         if ((flags & ToolbarButtonFlags.Hidden) != ToolbarButtonFlags.None)
         {
             this.writer.Write(" style=\"display:none;\"");
         }
         this.writer.Write(">");
     }
     if (this.IsRightAligned && !isBig && isComboMenu)
     {
         this.RenderComboDropDown(button, flags, renderMenuItems);
     }
     this.writer.Write("<div id=\"divToolbarButton");
     this.writer.Write(button.Command);
     this.writer.Write("\" class=\"");
     if (isBig)
     {
         if (isComboDropDown)
         {
             this.writer.Write("tbfBigDD");
         }
         else if ((flags & ToolbarButtonFlags.ComboMenu) != ToolbarButtonFlags.None)
         {
             this.writer.Write("tbfBigCMB");
         }
         else
         {
             this.writer.Write("tbfBig");
         }
     }
     else
     {
         this.writer.Write("tbf");
         if (!this.HasBigButton)
         {
             this.writer.Write(" ");
             this.RenderFloatCssClass();
         }
     }
     if (isNoAction)
     {
         this.writer.Write(" tbfNA");
     }
     else
     {
         if (isDisabled && isPressed)
         {
             this.writer.Write(" tbfD tbfP");
         }
         else if (isDisabled)
         {
             this.writer.Write(" tbfD");
         }
         else if (isPressed)
         {
             this.writer.Write(" tbfP");
         }
         else if (isShareButton)
         {
             this.writer.Write(" tbfShareHvr");
         }
         else
         {
             this.writer.Write(" tbfHvr");
         }
         if (isComboDropDown && !isBig)
         {
             this.writer.Write(" tbfDd");
         }
     }
     if (hasDropdown && !isComboDropDown)
     {
         this.writer.Write(" tbfMnuDd");
     }
     if (isComboMenu)
     {
         this.writer.Write(" tbfCmb");
     }
     if (!this.HasBigButton && (flags & ToolbarButtonFlags.Hidden) != ToolbarButtonFlags.None)
     {
         this.writer.Write("\" style=\"display:none;");
     }
     if (((flags & ToolbarButtonFlags.Tooltip) != ToolbarButtonFlags.None || (flags & ToolbarButtonFlags.Text) == ToolbarButtonFlags.None) && button.TooltipId != -1018465893)
     {
         this.writer.Write("\" title=\"");
         this.writer.Write(SanitizedHtmlString.FromStringId(button.TooltipId));
     }
     this.writer.Write("\">");
 }
コード例 #6
0
 protected void RenderButton(ToolbarButton button, ToolbarButtonFlags flags, Toolbar.RenderMenuItems renderMenuItems)
 {
     this.RenderButton(button, flags, renderMenuItems, null);
 }