protected override void OnShow() { ExTraceGlobals.ProgramFlowTracer.TraceFunction <ExchangeFormView>(0L, "-->ExchangeFormView.OnShow: {0}", this); ViewSharedData sharedData = this.SharedData; if (sharedData != null) { sharedData.CurrentActiveView = this; try { IAcceptExternalSelection acceptExternalSelection = base.Control as IAcceptExternalSelection; if (acceptExternalSelection != null && sharedData.SelectionObject != null) { ExTraceGlobals.ProgramFlowTracer.TraceDebug <string, object>(0L, "ExchangeFormView.OnShow: requesting {0} to select item {1}.", base.Control.Name, sharedData.SelectionObject); acceptExternalSelection.SetSelection(sharedData.SelectionObject); sharedData.SelectionObject = null; } IResultPaneSelectionService resultPaneSelectionService = base.Control as IResultPaneSelectionService; if (resultPaneSelectionService != null && sharedData.SelectedResultPaneName != null) { ExTraceGlobals.ProgramFlowTracer.TraceDebug <string, string>(0L, "ExchangeFormView.OnShow: requesting {0} to select pane {1}.", base.Control.Name, sharedData.SelectedResultPaneName); resultPaneSelectionService.SelectResultPaneByName(sharedData.SelectedResultPaneName); sharedData.SelectedResultPaneName = null; } } catch (Exception ex) { if (ExceptionHelper.IsUICriticalException(ex)) { throw; } this.uiService.ShowError(ex); } if (ExchangeFormView.ViewShown != null) { ExchangeFormView.ViewShown(this, EventArgs.Empty); } this.ResultPane.OnSetActive(); } ExTraceGlobals.ProgramFlowTracer.TraceFunction <ExchangeFormView>(0L, "<--ExchangeFormView.OnShow: {0}", this); ExTraceGlobals.ProgramFlowTracer.TracePerformance <ExchangeFormView, string>(0L, "Time:{1}. End Load View. <--ExchangeFormView.OnShow: {0}", this, ExDateTime.Now.ToString("MM/dd/yyyy HH:mm:ss.fff")); }
public CommandsActionsAdapter(IServiceProvider serviceProvider, ActionsPaneItemCollection actions, CommandCollection commands, bool showGroupsAsRegions, IExchangeSnapIn snapIn, ExchangeFormView view, bool createActionsAtBottom) { this.snapIn = snapIn; this.serviceProvider = serviceProvider; this.actions = actions; this.commands = commands; this.adapters = new List <CommandActionAdapter>(commands.Count); this.showGroupsAsRegions = showGroupsAsRegions; this.createActionsAtBottom = createActionsAtBottom; this.view = view; this.commands.CommandAdded += new CommandEventHandler(this.commands_CommandAdded); this.commands.CommandRemoved += new CommandEventHandler(this.commands_CommandRemoved); ActionsPaneItemCollection actionsPaneItemCollection = new ActionsPaneItemCollection(); for (int i = 0; i < this.commands.Count; i++) { CommandActionAdapter commandActionAdapter = this.CreateAdapter(this.commands[i]); this.adapters.Add(commandActionAdapter); if (commandActionAdapter.Command.Visible) { actionsPaneItemCollection.Add(commandActionAdapter.ActionItem); } } this.actions.AddRange(actionsPaneItemCollection.ToArray()); }
public CommandsActionsAdapter(IServiceProvider serviceProvider, ActionsPaneItemCollection actions, CommandCollection commands, bool showGroupsAsRegions, IExchangeSnapIn snapIn, ExchangeFormView view) : this(serviceProvider, actions, commands, showGroupsAsRegions, snapIn, view, false) { }
public CommandActionAdapter(IServiceProvider serviceProvider, Command command, bool treatCommandAsGroup, IExchangeSnapIn snapIn, ExchangeFormView view) { this.serviceProvider = serviceProvider; this.command = command; if (this.command.Name == "-") { this.actionItem = new ActionSeparator(); } else { if (this.command.HasCommands || this.command.Style == 4 || treatCommandAsGroup) { ActionGroup actionGroup = new ActionGroup(); actionGroup.RenderAsRegion = true; this.actionItem = actionGroup; this.groupItemsAdapter = new CommandsActionsAdapter(this.serviceProvider, actionGroup.Items, this.Command.Commands, false, snapIn, view); } else { Action action = new Action(); this.actionItem = action; action.Triggered += new Action.ActionEventHandler(this.action_Triggered); this.Command.EnabledChanged += this.command_EnabledChanged; this.command_EnabledChanged(this.Command, EventArgs.Empty); this.Command.CheckedChanged += this.command_CheckedChanged; this.command_CheckedChanged(this.Command, EventArgs.Empty); } this.Command.TextChanged += this.command_TextChanged; this.command_TextChanged(this.Command, EventArgs.Empty); this.Command.DescriptionChanged += this.command_DescriptionChanged; this.command_DescriptionChanged(this.Command, EventArgs.Empty); if (snapIn != null) { (this.ActionItem as ActionsPaneExtendedItem).ImageIndex = snapIn.RegisterIcon(this.Command.Name, this.Command.Icon); } (this.ActionItem as ActionsPaneExtendedItem).LanguageIndependentName = this.ActionItem.GetHashCode().ToString(); } this.ActionItem.Tag = this; }