internal void ReBuildBrowserGoForwardHistoryCommandItems(ITextImageItem[] items) { _browserGoForwardCommand.Tools.Clear(); for (int i = 0; items != null && i < items.Length; i++) { ITextImageItem item = items[i]; string toolKey = "cmdBrowserGoForward_" + i.ToString(); AppButtonToolCommand cmd = null; if (this._browserGoForwardCommand.ToolbarsManager.Tools.Exists(toolKey)) { cmd = (AppButtonToolCommand)this._browserGoForwardCommand.ToolbarsManager.Tools[toolKey]; } if (cmd == null) { cmd = new AppButtonToolCommand(toolKey, this.mediator, this.CmdBrowserGoForwardHistoryItem, item.Text, String.Empty); this._browserGoForwardCommand.ToolbarsManager.Tools.Add(cmd); } if (cmd.Mediator == null) { cmd.Mediator = this.mediator; cmd.OnExecute += this.CmdBrowserGoForwardHistoryItem; this.mediator.RegisterCommand(toolKey, cmd); } else if (cmd.Mediator != this.mediator) { this.mediator.ReRegisterCommand(cmd); } cmd.SharedProps.ShowInCustomizer = false; cmd.SharedProps.AppearancesSmall.Appearance.Image = item.Image; cmd.SharedProps.Caption = item.Text; cmd.Tag = i; this._browserGoForwardCommand.Tools.Add(cmd); } //end foreach if (this._browserGoForwardCommand.Tools.Count == 0) { this._browserGoForwardCommand.DropDownArrowStyle = DropDownArrowStyle.None; } else { this._browserGoForwardCommand.DropDownArrowStyle = DropDownArrowStyle.Segmented; } }
internal static void ResetBrowserHistory(NavigationToolbar historyToolbar, ITabState state) { historyToolbar.ResetNavigationHistory(); if (state == null || state.CurrentHistoryItem == null) { return; } List <NavigationHistoryItem> back = null; List <NavigationHistoryItem> forward = null; if (state.GoBackHistoryItems != null && state.GoBackHistoryItems.Length > 0) { back = new List <NavigationHistoryItem>(state.GoBackHistoryItems.Length); for (int i = 0; i < state.GoBackHistoryItems.Length; i++) { ITextImageItem item = state.GoBackHistoryItems[i]; back.Add(new NavigationHistoryItem(item.Text, item)); } } if (state.GoForwardHistoryItems != null && state.GoForwardHistoryItems.Length > 0) { forward = new List <NavigationHistoryItem>(state.GoForwardHistoryItems.Length); for (int i = 0; i < state.GoForwardHistoryItems.Length; i++) { ITextImageItem item = state.GoForwardHistoryItems[i]; forward.Add(new NavigationHistoryItem(item.Text, item)); } } historyToolbar.InitializeHistory( back == null ? null : back.ToArray(), forward == null ? null : forward.ToArray(), new NavigationHistoryItem(state.CurrentHistoryItem.Text, state.CurrentHistoryItem)); }