コード例 #1
0
        /// <inheritdoc/>
        protected override void OnUninitialize()
        {
            Editor.Services.UnregisterView(typeof(GoToLineViewModel));

            Editor.Services.Unregister(typeof(ITextService));
            Editor.Services.Unregister(typeof(IHighlightingService));

            ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.SetHighlightingManager(ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance);
            _highlightingManager = null;
        }
コード例 #2
0
        //--------------------------------------------------------------
        #region Methods
        //--------------------------------------------------------------

        /// <inheritdoc/>
        protected override void OnInitialize()
        {
            // Override AvalonEdits highlighting manager.
            _highlightingManager = new HighlightingManager(Editor);
            ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.SetHighlightingManager(_highlightingManager);

            // Register services.
            Editor.Services.Register(typeof(ITextService), null, this);
            Editor.Services.Register(typeof(IHighlightingService), null, _highlightingManager);

            // Register views.
            Editor.Services.RegisterView(typeof(GoToLineViewModel), typeof(GoToLineView));
        }