protected override void OnInitialize(AsyncStatus status) { ExTraceGlobals.ProgramFlowTracer.TraceFunction <ExchangeFormView>(0L, "-->ExchangeFormView.OnInitialize: {0}", this); try { SynchronizationContext.SetSynchronizationContext(new SynchronizeInvokeSynchronizationContext(base.SnapIn)); this.uiService = new ViewUIService(this); this.selectionService = new Selection(); this.services = new ServiceContainer(); this.settingsProvider = new ExchangeSettingsProvider(); this.settingsProvider.Initialize(null, null); this.progressProvider = new ScopeNodeProgressProvider(base.ScopeNode); this.services.AddService(typeof(SynchronizationContext), SynchronizationContext.Current); this.services.AddService(typeof(IUIService), this.uiService); this.services.AddService(typeof(ISelectionService), this.selectionService); this.services.AddService(typeof(ISettingsProviderService), this.settingsProvider); this.services.AddService(typeof(IProgressProvider), this.progressProvider); this.services.AddService(typeof(INodeSelectionService), this); this.services.AddService(typeof(ISharedViewDataService), this); this.components = new ServicedContainer(this.services); this.components.Add(base.Control, base.Control.Name); IResultPaneControl resultPaneControl = base.Control as IResultPaneControl; ExchangeScopeNode exchangeScopeNode = base.ScopeNode as ExchangeScopeNode; IExchangeSnapIn exchangeSnapIn = base.SnapIn as IExchangeSnapIn; if (resultPaneControl != null && exchangeSnapIn != null) { resultPaneControl.SharedSettings = exchangeSnapIn.Settings; } if (exchangeScopeNode != null) { exchangeScopeNode.Refreshing += this.exchangeScopeNode_Refreshing; status.EnableManualCompletion(); exchangeScopeNode.InitializeView(base.Control, new StatusProgress(status, base.ScopeNode.SnapIn)); } base.Control.Dock = DockStyle.Fill; bool showGroupsAsRegions = base.Control is WorkCenter; this.selectionCommandsAdapter = new CommandsActionsAdapter(this.services, base.SelectionData.ActionsPaneItems, this.ResultPane.SelectionCommands, showGroupsAsRegions, exchangeSnapIn, this); this.resultPaneCommandsAdapter = new CommandsActionsAdapter(this.services, base.ActionsPaneItems, this.ResultPane.ResultPaneCommands, false, exchangeSnapIn, null); this.viewModeCommandsAdapter = new CommandsActionsAdapter(this.services, base.ModeActionsPaneItems, this.ResultPane.ViewModeCommands, false, exchangeSnapIn, null); base.ActionsPaneItems.Add(new ActionSeparator()); this.exportListCommandsAdapter = new CommandsActionsAdapter(this.services, base.ActionsPaneItems, this.ResultPane.ExportListCommands, false, exchangeSnapIn, null, true); this.selectionService.SelectionChanged += this.selectionService_SelectionChanged; this.ResultPane.IsModifiedChanged += this.ResultPane_IsModifiedChanged; this.ResultPane_IsModifiedChanged(this.ResultPane, EventArgs.Empty); this.ResultPane.HelpRequested += this.ResultPane_HelpRequested; base.OnInitialize(status); } catch (Exception ex) { if (ExceptionHelper.IsUICriticalException(ex)) { throw; } base.Control.Enabled = false; this.uiService.ShowError(ex); } ExTraceGlobals.ProgramFlowTracer.TraceFunction <ExchangeFormView>(0L, "<--ExchangeFormView.OnInitialize: {0}", this); }