Пример #1
0
        internal EditorHostLoader()
        {
            var editorHostFactory = new EditorHostFactory();

            editorHostFactory.Add(new AssemblyCatalog(typeof(DefaultKeyProcessorProvider).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(MarginFactory).Assembly));
            _editorHost = editorHostFactory.CreateEditorHost();
        }
Пример #2
0
        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>();
        }
Пример #3
0
        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>();
        }
Пример #4
0
        private EditorHost GetOrCreateEditorHost()
        {
            if (EditorHostCache != null)
            {
                return(EditorHostCache);
            }

            var editorHostFactory = new EditorHostFactory();

            EditorHostCache = editorHostFactory.CreateEditorHost();
            return(EditorHostCache);
        }
Пример #5
0
        public MainWindow()
        {
            InitializeComponent();

            var editorHostFactory = new EditorHostFactory(EditorVersion.Vs2015);
            var editorHost        = editorHostFactory.CreateEditorHost();

            var textBuffer = editorHost.TextBufferFactoryService.CreateTextBuffer();

            textBuffer.Insert(0, "Hello Editor");

            var wpfTextView     = editorHost.TextEditorFactoryService.CreateTextView(textBuffer);
            var wpfTextViewHost = editorHost.TextEditorFactoryService.CreateTextViewHost(wpfTextView, setFocus: true);

            Content = wpfTextViewHost.HostControl;
        }
Пример #6
0
        private EditorHost GetOrCreateEditorHost()
        {
            if (EditorHostCache != null)
            {
                return EditorHostCache;
            }

            var editorHostFactory = new EditorHostFactory();
            EditorHostCache = editorHostFactory.CreateEditorHost();
            return EditorHostCache;
        }