Esempio n. 1
0
 /// <summary>
 /// Standards the single expand.
 /// </summary>
 /// <typeparam name="TModel">The type of the model.</typeparam>
 /// <param name="status">The status.</param>
 /// <param name="observable">The observable.</param>
 /// <param name="builder">The builder.</param>
 protected void StandardSingleExpand <TModel>(AsyncStatus status, IObservable <TModel> observable, Func <TModel, ScopeNode[]> builder)
 {
     _expandStatus = status;
     _expandStatus.EnableManualCompletion();
     Children.Clear();
     observable.Subscribe(new SingleObserver <TModel>(this, status, builder));
 }
Esempio n. 2
0
 /// <summary>
 /// Standards the collection expand.
 /// </summary>
 /// <typeparam name="TModel">The type of the model.</typeparam>
 /// <param name="status">The status.</param>
 /// <param name="observable">The observable.</param>
 /// <param name="mapper">The mapper.</param>
 protected void StandardCollectionExpand <TModel>(AsyncStatus status, IObservable <TModel[]> observable, Func <TModel, ScopeNode> mapper)
 {
     _expandStatus = status;
     _expandStatus.EnableManualCompletion();
     Children.Clear();
     observable.Subscribe(new CollectionObserver <TModel>(this, status, mapper));
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
        /// <summary>
        /// Launch new thread to handle expand tasks
        /// </summary>
        /// <param name="status">asynchronous status for updating the console</param>
        protected override void OnExpand(AsyncStatus status)
        {
            // hang onto status
            expandStatus = status;

            // mark as 
            expandStatus.EnableManualCompletion();

            Thread thread = new Thread(new ThreadStart(Expand));
            thread.Start();
        }
 protected sealed override void OnRefresh(AsyncStatus status)
 {
     try
     {
         SynchronizationContext.SetSynchronizationContext(new SynchronizeInvokeSynchronizationContext(base.SnapIn));
         if (this.DataSource != null)
         {
             status.EnableManualCompletion();
             this.DataSource.Refresh(new StatusProgress(status, base.SnapIn));
         }
         if (this.Refreshing != null)
         {
             this.Refreshing(this, EventArgs.Empty);
         }
     }
     catch (Exception ex)
     {
         if (ExceptionHelper.IsUICriticalException(ex))
         {
             throw;
         }
         this.ShellUI.ShowError(ex);
     }
 }