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();
        }
Example #2
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();
        }
        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)));
            }
        }