private static VimEditorHost GetOrCreateVimEditorHost() { if (s_cachedVimEditorHost == null) { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly)); // Other Exports needed to construct VsVim editorHostFactory.Add(new TypeCatalog( typeof(TestableClipboardDevice), typeof(TestableKeyboardDevice), typeof(TestableMouseDevice), typeof(global::Vim.UnitTest.Exports.VimHost), typeof(VimErrorDetector), typeof(DisplayWindowBrokerFactoryService), typeof(WordCompletionSessionFactoryService), typeof(AlternateKeyUtil), typeof(VimProtectedOperations), typeof(OutlinerTaggerProvider))); var compositionContainer = editorHostFactory.CreateCompositionContainer(); s_cachedVimEditorHost = new VimEditorHost(compositionContainer); } return(s_cachedVimEditorHost); }
private static VimEditorHost GetOrCreateVimEditorHost() { var key = Thread.CurrentThread.ManagedThreadId; if (!s_cachedVimEditorHostMap.TryGetValue(key, out VimEditorHost host)) { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly)); // Other Exports needed to construct VsVim editorHostFactory.Add(new TypeCatalog( typeof(TestableClipboardDevice), typeof(TestableKeyboardDevice), typeof(TestableMouseDevice), typeof(global::Vim.UnitTest.Exports.VimHost), typeof(VimErrorDetector), typeof(DisplayWindowBrokerFactoryService), typeof(WordCompletionSessionFactoryService), typeof(AlternateKeyUtil), typeof(OutlinerTaggerProvider))); var compositionContainer = editorHostFactory.CreateCompositionContainer(); host = new VimEditorHost(compositionContainer); s_cachedVimEditorHostMap[key] = host; } return(host); }
internal EditorHostLoader() { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(DefaultKeyProcessorProvider).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(MarginFactory).Assembly)); _editorHost = editorHostFactory.CreateEditorHost(); }
internal VimComponentHost() { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(VimKeyProcessor).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(VimComponentHost).Assembly)); _editorHost = editorHostFactory.CreateEditorHost(); _vim = _editorHost.CompositionContainer.GetExportedValue<IVim>(); }
internal VimComponentHost() { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(VimKeyProcessor).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(VimComponentHost).Assembly)); _editorHost = editorHostFactory.CreateEditorHost(); _vim = _editorHost.CompositionContainer.GetExportedValue <IVim>(); }
private static VimEditorHost CreateVimEditorHost() { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(Vim.IVim).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(Vim.UI.Wpf.VimKeyProcessor).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(VsCommandTarget).Assembly)); editorHostFactory.Add(new AssemblyCatalog(typeof(ISharedService).Assembly)); editorHostFactory.Add(new TypeCatalog( typeof(Vim.VisualStudio.UnitTest.MemoryLeakTest.ServiceProvider), typeof(Vim.VisualStudio.UnitTest.MemoryLeakTest.VsEditorAdaptersFactoryService), typeof(VimErrorDetector))); return(new VimEditorHost(editorHostFactory.CreateCompositionContainer())); }
private VsfEditorHost GetOrCreateEditorHost() { if (cachedEditorHost == null) { var editorHostFactory = new EditorHostFactory(); var catalog = new AggregateCatalog( new AssemblyCatalog(typeof(LanguageFactory).Assembly), new AssemblyCatalog(typeof(PkgSource).Assembly), new AssemblyCatalog(typeof(TextBufferBraces).Assembly) ); editorHostFactory.Add(catalog); var compositionContainer = editorHostFactory.CreateCompositionContainer(); cachedEditorHost = new VsfEditorHost(compositionContainer); } return(cachedEditorHost); }
private VsfEditorHost GetOrCreateEditorHost() { if (cachedEditorHost == null) { var editorHostFactory = new EditorHostFactory(); var catalog = new AggregateCatalog( new AssemblyCatalog(typeof(IUpdatableSettings).Assembly), // Viasfora.Settings new AssemblyCatalog(typeof(LanguageFactory).Assembly), // Viasfora.Languages new AssemblyCatalog(typeof(Guids).Assembly), // Viasfora.Core new AssemblyCatalog(typeof(TextBufferBraces).Assembly), // Viasfora.Rainbow new AssemblyCatalog(typeof(XmlTaggerProvider).Assembly) // Viasfora.Xml ); editorHostFactory.Add(catalog); var compositionContainer = editorHostFactory.CreateCompositionContainer(); cachedEditorHost = new VsfEditorHost(compositionContainer); } return(cachedEditorHost); }
private VsfEditorHost GetOrCreateEditorHost() { if ( cachedEditorHost == null ) { var editorHostFactory = new EditorHostFactory(); var catalog = new AggregateCatalog( new AssemblyCatalog(typeof(LanguageFactory).Assembly), new AssemblyCatalog(typeof(PkgSource).Assembly), new AssemblyCatalog(typeof(TextBufferBraces).Assembly) ); editorHostFactory.Add(catalog); var compositionContainer = editorHostFactory.CreateCompositionContainer(); cachedEditorHost = new VsfEditorHost(compositionContainer); } return cachedEditorHost; }
private static VimEditorHost GetOrCreateVimEditorHost() { if (s_cachedVimEditorHost == null) { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly)); // Other Exports needed to construct VsVim editorHostFactory.Add(new TypeCatalog( typeof(TestableClipboardDevice), typeof(TestableKeyboardDevice), typeof(TestableMouseDevice), typeof(global::Vim.UnitTest.Exports.VimHost), typeof(VimErrorDetector), typeof(DisplayWindowBrokerFactoryService), typeof(WordCompletionSessionFactoryService), typeof(AlternateKeyUtil), typeof(VimProtectedOperations), typeof(OutlinerTaggerProvider))); var compositionContainer = editorHostFactory.CreateCompositionContainer(); s_cachedVimEditorHost = new VimEditorHost(compositionContainer); } return s_cachedVimEditorHost; }
private VsfEditorHost GetOrCreateEditorHost() { if ( cachedEditorHost == null ) { var editorHostFactory = new EditorHostFactory(); editorHostFactory.Add(new AssemblyCatalog(typeof(IVsfSettings).Assembly)); var compositionContainer = editorHostFactory.CreateCompositionContainer(); cachedEditorHost = new VsfEditorHost(compositionContainer); } return cachedEditorHost; }