public IDropDownCommand AddDropDownCommand(string id) { var cmd = new DropDownCommand(); commands.Add(id, cmd); return(cmd); }
private void BuildNameDropDown() { RbacPrincipal rbacPrincipal = RbacPrincipal.Current; DropDownCommand dropDownCommand = this.nameDropDown.DropDownCommand; dropDownCommand.Name = "UserName"; dropDownCommand.Text = rbacPrincipal.Name; if (this.hasHelpdesk) { dropDownCommand.Commands.Add(new Command { Name = "Helpdesk", Text = Strings.EntryOnBehalfOf, OnClientClick = "CrossPremise.NavTo('helpdesk');" }); } if (rbacPrincipal.IsInRole("MailboxFullAccess") && !rbacPrincipal.IsInRole("DelegatedAdmin") && !rbacPrincipal.IsInRole("ByoidAdmin")) { if (dropDownCommand.Commands.Count > 0) { dropDownCommand.Commands.Add(new SeparatorCommand()); } dropDownCommand.Commands.Add(new Command { Name = "SignOff", Text = Strings.SignOff, OnClientClick = "CrossPremise.NavTo('dualLogout');" }); } }
protected void RebuildRecentFilesMenu() { ribbon.ControlBoxMenu.RightCommands.Clear(); //int numFilesMax = int.Parse(ChemDevEnv.Properties.Resources.NumberOfRecentFilesShown); int count = 1; for (int file = recentFiles.Files.Count - 1; file >= 0; file--) { string text = count + " " + PathTools.ShortenPath(recentFiles.Files[file].Filename, 40); DropDownCommand item = new DropDownCommand("rencetFile#" + file, text); item.Tag = recentFiles.Files[file]; item.Click += OpenRecentFile; ribbon.ControlBoxMenu.RightCommands.Add(item); count++; } }
private void BuildNameDropDown() { RbacPrincipal rbacPrincipal = RbacPrincipal.Current; DropDownCommand dropDownCommand = this.nameDropDown.DropDownCommand; dropDownCommand.Name = "UserName"; dropDownCommand.Text = rbacPrincipal.Name; if (NavigationUtil.ShouldRenderOwaLink(rbacPrincipal, this.showAdminFeatures.Value)) { dropDownCommand.Commands.Add(new Command { Name = "MailLnk", Text = Strings.MyMail, OnClientClick = "JumpTo('" + EcpUrl.OwaVDir + "', true);" }); } if (this.HasAccessTo("helpdesk")) { dropDownCommand.Commands.Add(new Command { Name = "Helpdesk", Text = Strings.EntryOnBehalfOf, OnClientClick = "JumpTo('helpdesk');" }); } if (NavigationUtil.ShouldRenderLogoutLink(rbacPrincipal)) { if (dropDownCommand.Commands.Count > 0) { dropDownCommand.Commands.Add(new SeparatorCommand()); } dropDownCommand.Commands.Add(new Command { Name = "SignOff", Text = Strings.SignOff, OnClientClick = "Navigation.SignOut();" }); } }
public IDropDownCommand AddDropDownCommand(string id) { var cmd = new DropDownCommand(); commands.Add(id, cmd); return cmd; }
protected override void CreateChildControls() { base.CreateChildControls(); LiteralControl child = new LiteralControl("\r\n <div class='brandingArrowContainer'>\r\n <svg version='1.1' width='6px' height='8px' viewBox='0 0 6 8'>\r\n <polygon class='vectorFillColor' points='0.504,0.161 0.504,7.849 5.504,4.005 '/>\r\n </svg>\r\n </div>\r\n <div class='appIconContainer'>\r\n <svg version='1.1' width='24px' height='24px' viewBox='0 0 48 48'>\r\n <g>\r\n <path class='vectorFillColor' d='M37.586,32.563c-0.557-0.164-1.48-0.335-2.258-0.335c-2.734,0-4.15,1.416-4.15,1.416v6.836h5.078 l0.004-6.836C36.26,33.645,36.644,32.823,37.586,32.563z'/>\r\n <polyline class='vectorStrokeColor' fill='none' stroke-width='1.5' stroke-miterlimit='10' points='28.785,35.256 1.148,35.256 1.148,8.156 43.824,8.156 43.824,22.609 \t'/>\r\n <path class='vectorFillColor' d='M46.852,33.645c0,0-1.367-1.416-4.102-1.416s-4.15,1.416-4.15,1.416v6.836h8.252V33.645z'/>\r\n <circle class='vectorFillColor' cx='34.879' cy='27.734' r='2.969'/>\r\n <circle class='vectorFillColor' cx='42.645' cy='27.734' r='2.969'/>\r\n <rect class='vectorFillColor' x='31.91' y='11.188' width='8.141' height='6'/>\r\n <line class='vectorStrokeColor' fill='none' stroke-width='1.5' stroke-miterlimit='10' x1='7.863' y1='23.229' x2='28.885' y2='23.229'/>\r\n <line class='vectorStrokeColor' fill='none' stroke-width='1.5' stroke-miterlimit='10' x1='7.863' y1='27.042' x2='25.885' y2='27.042'/>\r\n </g>\r\n </svg>\r\n </div>\r\n "); Label label = new Label(); label.ID = "brandingLabel"; label.CssClass = "brandingLabel"; label.Text = OwaOptionStrings.TeamMailboxAppTitle; Panel panel = new Panel(); panel.ID = "brandingPanel"; panel.CssClass = "newTMNavBrandingPanel"; this.brandingLink.Text = AntiXssEncoder.HtmlEncode(this.displayName, true); panel.Controls.Add(this.brandingLink); panel.Controls.Add(child); panel.Controls.Add(label); DropDownButton dropDownButton = new DropDownButton(HtmlTextWriterTag.Span); dropDownButton.ID = "nameDropDown"; dropDownButton.DropDownCommand.Name = "UserName"; dropDownButton.DropDownCommand.Text = RbacPrincipal.Current.Name; dropDownButton.DropDownCommand.Commands.Add(new Command { Name = "SignOff", Text = Strings.SignOff, OnClientClick = NewTeamMailboxControl.GetLogoffScript() }); DropDownButton dropDownButton2 = new DropDownButton(HtmlTextWriterTag.Span); dropDownButton2.ID = "helpControl"; DropDownCommand dropDownCommand = dropDownButton2.DropDownCommand; dropDownCommand.Name = "Help"; dropDownCommand.DefaultCommandName = "ContextualHelp"; dropDownCommand.Text = Strings.Help; if (Util.IsDataCenter) { Command command = new Command(); command.Name = "Community"; command.Text = Strings.Community; command.OnClientClick = string.Format("PopupWindowManager.showHelpClient('{0}');", HttpUtility.HtmlEncode(HelpUtil.BuildCommunitySiteHref())); dropDownCommand.Commands.Add(command); Command command2 = new Command(); command2.Name = "Privacy"; command2.Text = Strings.Privacy; command2.OnClientClick = string.Format("PopupWindowManager.showHelpClient('{0}');", HttpUtility.HtmlEncode(HelpUtil.BuildPrivacyStatmentHref())); dropDownCommand.Commands.Add(command2); } Command command3 = new Command(); command3.Name = "Copyright"; command3.Text = Strings.CopyRight; command3.OnClientClick = string.Format("PopupWindowManager.showHelpClient('{0}');", "http://go.microsoft.com/fwlink/p/?LinkId=256676"); dropDownCommand.Commands.Add(command3); Panel panel2 = new Panel(); panel2.ID = "topRightNavPanel"; panel2.CssClass = "newTMNavRight"; panel2.Controls.Add(dropDownButton); panel2.Controls.Add(dropDownButton2); Panel panel3 = new Panel(); panel3.ID = "headerPanel"; panel3.CssClass = "newTMNavHeader"; panel3.Controls.Add(panel); panel3.Controls.Add(panel2); Panel panel4 = new Panel(); panel4.CssClass = "newTMSeparator"; panel4.ID = "headerSeparatorPanel"; this.Controls.Add(panel3); this.Controls.Add(panel4); this.Controls.Add(this.contentPanel); }