Exemplo n.º 1
0
 // Token: 0x06001CDE RID: 7390 RVA: 0x000A6820 File Offset: 0x000A4A20
 protected void RenderMenuItem(ToolbarButton button, bool isDisabled)
 {
     if (button == null)
     {
         throw new ArgumentNullException("button");
     }
     this.writer.Write("<div class=\"menuBtn ");
     this.writer.Write(isDisabled ? "miDa" : "miDf");
     this.writer.Write("\"><a class=\"menuA\" id=\"");
     this.writer.Write(button.Command);
     this.writer.Write("\"");
     if ((button.Flags & ToolbarButtonFlags.Image) != ToolbarButtonFlags.None && (button.Flags & ToolbarButtonFlags.Text) == ToolbarButtonFlags.None)
     {
         this.writer.Write(" title=\"");
         this.writer.Write(SanitizedHtmlString.FromStringId(button.TooltipId));
         this.writer.Write("\"");
     }
     this.writer.Write(" name=\"lnkB\" _mnuItm=\"1\" href=\"#\">");
     if ((button.Flags & ToolbarButtonFlags.Image) != ToolbarButtonFlags.None)
     {
         this.sessionContext.RenderThemeImage(this.writer, button.Image, "menuImgLh tbAfter", new object[0]);
     }
     if ((button.Flags & ToolbarButtonFlags.Text) != ToolbarButtonFlags.None)
     {
         this.writer.Write("<span class=\"menuTxtLh\">");
         this.RenderButtonText(this.writer, button.TextId);
         this.writer.Write("</span>");
     }
     this.writer.Write("</a>");
     this.writer.Write("</div>");
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 private void RenderLinkMenuItem(TextWriter writer, ToolbarButton button)
 {
     writer.Write("<div id=\"divMnuItm\" cmd=\"");
     writer.Write(button.Command);
     writer.Write("\"><a id=\"");
     writer.Write(button.Command);
     writer.Write("\" class=\"vwMnItm\" href=\"#\"><div class=\"vwMnChk\"></div><span class=\"tbLh tbBtwn\">");
     Utilities.SanitizeHtmlEncode(LocalizedStrings.GetNonEncoded(button.TextId), writer);
     writer.Write("</span></a></div>");
 }
Exemplo n.º 4
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>");
     }
 }
Exemplo n.º 5
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>");
     }
 }
Exemplo n.º 6
0
 protected void RenderButtons(ToolbarButton newButton, params ToolbarButton[] extraButtons)
 {
     if (newButton == null)
     {
         throw new ArgumentNullException("newButton");
     }
     if ((newButton.Flags & ToolbarButtonFlags.ComboMenu) == ToolbarButtonFlags.ComboMenu || (newButton.Flags & ToolbarButtonFlags.Menu) == ToolbarButtonFlags.Menu)
     {
         base.RenderButton(newButton, new Toolbar.RenderMenuItems(this.RenderAllNewMenuItems));
     }
     else
     {
         base.RenderButton(newButton);
     }
     base.RenderButton(ToolbarButtons.Delete);
     base.RenderFloatedSpacer(3);
     base.RenderButton(ToolbarButtons.Move);
     if (this.ShowCategoryButton)
     {
         base.RenderFloatedSpacer(3);
         base.RenderButton(ToolbarButtons.Categories);
     }
     base.RenderFloatedSpacer(3);
     this.RenderSharingButton();
     if (this.ShowMarkComplete)
     {
         base.RenderButton(ToolbarButtons.MarkCompleteNoText);
     }
     base.RenderButton(ToolbarButtons.ChangeView, new Toolbar.RenderMenuItems(this.RenderChangeViewMenuItems));
     base.RenderButton(ToolbarButtons.CheckMessages);
     if (extraButtons != null)
     {
         foreach (ToolbarButton button in extraButtons)
         {
             base.RenderButton(button);
         }
     }
     base.RenderFloatedSpacer(1, "divMeasure");
 }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 private void RenderCheckboxMenuItem(TextWriter writer, ToolbarButton button, bool selected, bool radioButton)
 {
     writer.Write("<div id=\"divMnuItm\" ");
     writer.Write(radioButton ? "fRdo=\"1\"" : "fChk=\"1\"");
     if (selected)
     {
         writer.Write(" fSel=\"1\"");
     }
     writer.Write(" cmd=\"");
     writer.Write(button.Command);
     writer.Write("\"><a id=\"");
     writer.Write(button.Command);
     writer.Write("\" class=\"vwMnItm\" href=\"#\"><div class=\"vwMnChk\">");
     OwaContext.Current.SessionContext.RenderThemeImage(writer, ThemeFileId.Checkmark, "tbLh", new object[]
     {
         "id=\"imgChk\"",
         selected ? null : "style=\"display:none\""
     });
     writer.Write("</div><span class=\"tbLh tbBtwn\">");
     Utilities.SanitizeHtmlEncode(LocalizedStrings.GetNonEncoded(button.TextId), writer);
     writer.Write("</span></a></div>");
 }
Exemplo n.º 9
0
 protected void RenderMenuItem(ToolbarButton button)
 {
     this.RenderMenuItem(button, false);
 }
Exemplo n.º 10
0
 private void RenderNonNewButton(ToolbarButton button)
 {
     base.RenderButton(button, this.flagsForNonNewButton);
 }
Exemplo n.º 11
0
 private void RenderNonNewButton(ToolbarButton button, ToolbarButtonFlags flags)
 {
     base.RenderButton(button, flags | this.flagsForNonNewButton);
 }
Exemplo n.º 12
0
 protected void RenderButton(ToolbarButton button)
 {
     this.RenderButton(button, ToolbarButtonFlags.None, null, null);
 }
Exemplo n.º 13
0
        private void InternalRenderButtonBody(ToolbarButton button, ToolbarButtonFlags flags, SanitizedHtmlString addtionalMarkup, bool isBig, bool isComboDropDown, bool hasDropdown)
        {
            if ((flags & ToolbarButtonFlags.HasInnerControl) != ToolbarButtonFlags.None)
            {
                button.RenderControl(this.writer);
            }
            if (!isBig)
            {
                bool flag  = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.Text);
                bool flag2 = (flags & ToolbarButtonFlags.Image) != ToolbarButtonFlags.None && button.Image != ThemeFileId.None;
                bool flag3 = ToolbarButtonFlags.None != (flags & ToolbarButtonFlags.ImageAfterText);
                List <Toolbar.ButtonComponents> list = new List <Toolbar.ButtonComponents>(4);
                if (flag3)
                {
                    list.Add(Toolbar.ButtonComponents.Text);
                    list.Add(Toolbar.ButtonComponents.Image);
                }
                else
                {
                    if (flag2)
                    {
                        list.Add(Toolbar.ButtonComponents.Image);
                    }
                    if (flag)
                    {
                        list.Add(Toolbar.ButtonComponents.Text);
                    }
                }
                if (addtionalMarkup != null)
                {
                    list.Add(Toolbar.ButtonComponents.AdditionalMarkup);
                }
                if (hasDropdown)
                {
                    list.Add(Toolbar.ButtonComponents.DropDown);
                }
                for (int i = 0; i < list.Count; i++)
                {
                    Toolbar.ButtonComponents buttonComponents = list[i];
                    bool   flag4 = i > 0;
                    bool   flag5 = i < list.Count - 1;
                    string text  = string.Empty;
                    if (buttonComponents == Toolbar.ButtonComponents.Image || buttonComponents == Toolbar.ButtonComponents.Text)
                    {
                        if (flag4 && flag5)
                        {
                            text = "tbLh tbBtwn";
                        }
                        else if (!flag4 && flag5)
                        {
                            text = "tbLh tbBefore";
                        }
                        else if (flag4 && !flag5)
                        {
                            text = "tbLh tbBtwn tbAfter";
                        }
                        else if ((flags & ToolbarButtonFlags.Radio) != ToolbarButtonFlags.None)
                        {
                            text = "tbLh tbRadioBefore tbRadioAfter";
                        }
                        else
                        {
                            text = "tbLh tbBefore tbAfter";
                        }
                    }
                    switch (buttonComponents)
                    {
                    case Toolbar.ButtonComponents.Image:
                        this.sessionContext.RenderThemeImage(this.writer, button.Image, text, new object[]
                        {
                            "id=\"imgToolbarButtonIcon\""
                        });
                        break;

                    case Toolbar.ButtonComponents.Text:
                        this.writer.Write("<span class=\"");
                        this.writer.Write(text);
                        this.writer.Write("\">");
                        this.RenderButtonText(this.writer, button.TextId);
                        this.writer.Write("</span>");
                        break;

                    case Toolbar.ButtonComponents.AdditionalMarkup:
                        this.writer.Write(addtionalMarkup);
                        break;

                    case Toolbar.ButtonComponents.DropDown:
                        if (flag4)
                        {
                            this.sessionContext.RenderThemeImage(this.writer, ThemeFileId.AlertBarDropDownArrow, "tbBtwnDD", new object[]
                            {
                                "id=\"imgToolbarButtonDropdownIcon\""
                            });
                        }
                        else
                        {
                            this.sessionContext.RenderThemeImage(this.writer, ThemeFileId.AlertBarDropDownArrow, "ddSp", new object[]
                            {
                                "id=\"imgToolbarButtonDropdownIcon\""
                            });
                        }
                        break;
                    }
                }
                return;
            }
            if (isComboDropDown)
            {
                this.sessionContext.RenderThemeImage(this.writer, ThemeFileId.AlertBarDropDownArrow, "tbImgBigDD", new object[]
                {
                    "id=\"imgToolbarButtonDropdownIcon\""
                });
                return;
            }
            this.sessionContext.RenderThemeImage(this.writer, button.Image, "tbImgBig", new object[0]);
        }
Exemplo n.º 14
0
 private void InternalRenderLinkStart(ToolbarButton button, ToolbarButtonFlags flags, bool isAlwaysPressed, bool isPressed, bool isComboDropDown, bool renderBigButtonWrapper)
 {
     this.writer.Write("<a _tbb=1 class=\"tba\" id=\"");
     this.writer.Write(button.Command);
     if (isComboDropDown)
     {
         this.writer.Write("d");
     }
     this.writer.Write("\" name=\"lnkB\"");
     if (renderBigButtonWrapper)
     {
         this.writer.Write(" _fBig=\"1\"");
     }
     if (isPressed)
     {
         this.writer.Write(" _pushed=\"1\"");
     }
     if (isAlwaysPressed)
     {
         this.writer.Write(" _alwaysPushed=\"1\"");
     }
     if ((flags & ToolbarButtonFlags.Sticky) != ToolbarButtonFlags.None || (flags & ToolbarButtonFlags.Menu) != ToolbarButtonFlags.None)
     {
         this.writer.Write(" _stky=\"1\"");
     }
     if ((flags & ToolbarButtonFlags.Radio) != ToolbarButtonFlags.None)
     {
         this.writer.Write(" _radio=\"1\"");
     }
     if (button.SwapWithButtons != null)
     {
         this.writer.Write(" _swp=\"");
         for (int i = 0; i < button.SwapWithButtons.Length; i++)
         {
             if (0 < i)
             {
                 this.writer.Write(";");
             }
             this.writer.Write(button.SwapWithButtons[i].Command);
         }
         this.writer.Write("\"");
     }
     if (button.ToggleWithButtons != null)
     {
         this.writer.Write(" _tgl=\"");
         for (int j = 0; j < button.ToggleWithButtons.Length; j++)
         {
             if (0 < j)
             {
                 this.writer.Write(";");
             }
             this.writer.Write(button.ToggleWithButtons[j].Command);
         }
         this.writer.Write("\"");
     }
     if ((flags & ToolbarButtonFlags.Menu) != ToolbarButtonFlags.None)
     {
         this.writer.Write(" _sbMnu=\"tbl");
         this.writer.Write(button.Command);
         this.writer.Write("Mnu\"");
     }
     if (isComboDropDown)
     {
         this.writer.Write(" _ovr=\"");
         this.writer.Write(button.Command);
         this.writer.Write("\"");
     }
     if ((flags & ToolbarButtonFlags.ComboMenu) != ToolbarButtonFlags.None)
     {
         this.writer.Write(" _twsy=\"");
         this.writer.Write(button.Command);
         this.writer.Write("d\"");
     }
     this.writer.Write(" href=\"#\">");
 }
Exemplo n.º 15
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("\">");
 }
Exemplo n.º 16
0
 protected void RenderButton(ToolbarButton button, ToolbarButtonFlags flags, Toolbar.RenderMenuItems renderMenuItems)
 {
     this.RenderButton(button, flags, renderMenuItems, null);
 }
Exemplo n.º 17
0
 protected void RenderButton(ToolbarButton button, ToolbarButtonFlags flags)
 {
     this.RenderButton(button, flags, null, null);
 }
Exemplo n.º 18
0
 protected void RenderButton(ToolbarButton button, SanitizedHtmlString addtionalMarkup)
 {
     this.RenderButton(button, ToolbarButtonFlags.None, null, addtionalMarkup);
 }