Exemple #1
0
        /// <summary>
        /// Creates contained language host with default settings.
        /// </summary>
        /// <param name="document">Markdown editor document</param>
        /// <param name="editorBuffer">Contained language text buffer</param>
        public MdContainedLanguageHost(IEditorDocument document, IEditorBuffer editorBuffer)
        {
            _textBuffer = editorBuffer.As <ITextBuffer>();

            _document          = document;
            _document.Closing += OnDocumentClosing;

            editorBuffer.AddService(this);
        }
Exemple #2
0
        public MdEditorDocument(IEditorBuffer editorBuffer, IServiceContainer services)
        {
            _services = services;

            EditorBuffer = editorBuffer;
            EditorBuffer.AddService(this);

            var textBuffer = editorBuffer.As <ITextBuffer>();

            _projectionBufferManager = new ProjectionBufferManager(textBuffer, services, MdProjectionContentTypeDefinition.ContentType, RContentTypeDefinition.ContentType);
            ContainedLanguageHandler = _rLanguageHandler = new RLanguageHandler(textBuffer, _projectionBufferManager, services);
        }