コード例 #1
0
 internal InteractiveWindowTestHost(
     IInteractiveWindowFactoryService interactiveWindowFactory
     )
 {
     Evaluator = new TestInteractiveEvaluator();
     Window    = interactiveWindowFactory.CreateWindow(Evaluator);
     Window.InitializeAsync().Wait();
 }
コード例 #2
0
        internal InteractiveWindowTestHost(ExportProvider exportProvider)
        {
            _exportProvider = exportProvider.AsExportProvider();

            Evaluator = new TestInteractiveEvaluator();
            Window    = _exportProvider.GetExport <IInteractiveWindowFactoryService>().Value.CreateWindow(Evaluator);
            Window.InitializeAsync().Wait();
        }
コード例 #3
0
        internal InteractiveWindowTestHost()
        {
            _exportProvider = new CompositionContainer(
                s_lazyCatalog.Value,
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = _exportProvider.GetExport<IContentTypeRegistryService>().Value;
            Evaluator = new TestInteractiveEvaluator();
            Window = _exportProvider.GetExport<IInteractiveWindowFactoryService>().Value.CreateWindow(Evaluator);
            Window.InitializeAsync().Wait();
        }
コード例 #4
0
        internal InteractiveWindowTestHost(Action<InteractiveWindow.State> stateChangedHandler = null)
        {
            ExportProvider = new CompositionContainer(
                s_lazyCatalog.Value,
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = ExportProvider.GetExport<IContentTypeRegistryService>().Value;
            Evaluator = new TestInteractiveEngine(contentTypeRegistryService);
            Window = ExportProvider.GetExport<IInteractiveWindowFactoryService>().Value.CreateWindow(Evaluator);
            ((InteractiveWindow)Window).StateChanged += stateChangedHandler;
            Window.InitializeAsync().Wait();
        }
コード例 #5
0
        internal InteractiveWindowTestHost()
        {
            _exportProvider = new CompositionContainer(
                s_lazyCatalog.Value,
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = _exportProvider.GetExport <IContentTypeRegistryService>().Value;

            Evaluator = new TestInteractiveEvaluator();
            Window    = _exportProvider.GetExport <IInteractiveWindowFactoryService>().Value.CreateWindow(Evaluator);
            Window.InitializeAsync().Wait();
        }
コード例 #6
0
        internal InteractiveWindowTestHost(Action <InteractiveWindow.State> stateChangedHandler = null)
        {
            ExportProvider = new CompositionContainer(
                _lazyCatalog.Value,
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = ExportProvider.GetExport <IContentTypeRegistryService>().Value;

            Evaluator = new TestInteractiveEngine(contentTypeRegistryService);
            Window    = ExportProvider.GetExport <IInteractiveWindowFactoryService>().Value.CreateWindow(Evaluator);
            ((InteractiveWindow)Window).StateChanged += stateChangedHandler;
            Window.InitializeAsync().Wait();
        }
コード例 #7
0
        internal InteractiveWindowTestHost(Action<InteractiveWindow.State> stateChangedHandler = null)
        {
            SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

            _exportProvider = new CompositionContainer(
                _lazyCatalog.Value,
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = _exportProvider.GetExport<IContentTypeRegistryService>().Value;
            _window = _exportProvider.GetExport<IInteractiveWindowFactoryService>().Value.CreateWindow(new TestInteractiveEngine(contentTypeRegistryService));
            ((InteractiveWindow)_window).StateChanged += stateChangedHandler;
            _window.InitializeAsync().PumpingWait();
        }
コード例 #8
0
        internal InteractiveWindowTestHost(Action <InteractiveWindow.State> stateChangedHandler = null)
        {
            SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

            _exportProvider = new CompositionContainer(
                _lazyCatalog.Value,
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = _exportProvider.GetExport <IContentTypeRegistryService>().Value;

            _window = _exportProvider.GetExport <IInteractiveWindowFactoryService>().Value.CreateWindow(new TestInteractiveEngine(contentTypeRegistryService));
            ((InteractiveWindow)_window).StateChanged += stateChangedHandler;
            _window.InitializeAsync().PumpingWait();
        }
コード例 #9
0
        public InteractiveWindowTestHost()
        {
            SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

            var types = new[] { typeof(TestInteractiveEngine), typeof(InteractiveWindow) }.Concat(GetVisualStudioTypes());
            _exportProvider = new CompositionContainer(
                new AggregateCatalog(types.Select(t => new AssemblyCatalog(t.Assembly))),
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = _exportProvider.GetExport<IContentTypeRegistryService>().Value;
            _window = _exportProvider.GetExport<IInteractiveWindowFactoryService>().Value.CreateWindow(new TestInteractiveEngine(contentTypeRegistryService));

            _window.InitializeAsync().PumpingWait();
        }
コード例 #10
0
        public InteractiveWindowTestHost()
        {
            SynchronizationContext.SetSynchronizationContext(new DispatcherSynchronizationContext());

            var types = new[] { typeof(TestInteractiveEngine), typeof(InteractiveWindow) }.Concat(GetVisualStudioTypes());

            _exportProvider = new CompositionContainer(
                new AggregateCatalog(types.Select(t => new AssemblyCatalog(t.Assembly))),
                CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

            var contentTypeRegistryService = _exportProvider.GetExport <IContentTypeRegistryService>().Value;

            _window = _exportProvider.GetExport <IInteractiveWindowFactoryService>().Value.CreateWindow(new TestInteractiveEngine(contentTypeRegistryService));

            _window.InitializeAsync().PumpingWait();
        }
コード例 #11
0
        internal InteractiveWindowTestHost(Action <InteractiveWindow.State> stateChangedHandler = null)
        {
            try
            {
                ExportProvider = new CompositionContainer(
                    s_lazyCatalog.Value,
                    CompositionOptions.DisableSilentRejection | CompositionOptions.IsThreadSafe);

                Evaluator = new TestInteractiveEngine();
                Window    = ExportProvider.GetExport <IInteractiveWindowFactoryService>().Value.CreateWindow(Evaluator);
                ((InteractiveWindow)Window).StateChanged += stateChangedHandler;
                Window.InitializeAsync().Wait();
            }
            catch (ReflectionTypeLoadException e)
            {
                Assert.False(true,
                             e.Message +
                             "LoaderExceptions: " +
                             Environment.NewLine +
                             string.Join(Environment.NewLine, e.LoaderExceptions.Select(l => l.Message)));
            }
        }