Example #1
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="TextDocumentViewModel"/> class.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="document"/> is <see langword="null"/>.
        /// </exception>
        public TextDocumentViewModel(TextDocument document)
            : base(document)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            var editor = document.Editor;

            // Mandatory services.
            _textService   = editor.Services.GetInstance <ITextService>().ThrowIfMissing();
            _windowService = editor.Services.GetInstance <IWindowService>().ThrowIfMissing();

            // Optional services.
            _searchService       = editor.Services.GetInstance <ISearchService>().WarnIfMissing();
            _highlightingService = editor.Services.GetInstance <IHighlightingService>().WarnIfMissing();

            _textContextMenu      = _textService.ContextMenu;
            PrintPreviewCommand   = new DelegateCommand(ShowPrintPreview);
            PrintCommand          = new DelegateCommand(Print);
            FindCommand           = new DelegateCommand(Find, CanFind);
            FindAndReplaceCommand = new DelegateCommand(FindAndReplace);
            CancelCommand         = new DelegateCommand(Cancel);
        }
Example #2
0
 public HighlighterViewTaggerProvider(
     IForegroundNotificationService notificationService,
     IHighlightingService highlighterService,
     [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners)
     : base(new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.KeywordHighlighting), notificationService)
 {
     _highlighterService = highlighterService;
 }
Example #3
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="SyntaxHighlightingItem"/> class.
        /// </summary>
        /// <param name="textExtension">The text editor extension.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="textExtension"/> is <see langword="null"/>.
        /// </exception>
        public SyntaxHighlightingItem(TextExtension textExtension)
        {
            if (textExtension == null)
                throw new ArgumentNullException(nameof(textExtension));

            _textExtension = textExtension;
            _highlightingService = textExtension.Editor.Services.GetInstance<IHighlightingService>().ThrowIfMissing();
        }
Example #4
0
 public HighlighterViewTaggerProvider(
     IHighlightingService highlightingService,
     IForegroundNotificationService notificationService,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(listenerProvider.GetListener(FeatureAttribute.KeywordHighlighting), notificationService)
 {
     _highlightingService = highlightingService;
 }
Example #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SyntaxHighlightingItem"/> class.
        /// </summary>
        /// <param name="textExtension">The text editor extension.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="textExtension"/> is <see langword="null"/>.
        /// </exception>
        public SyntaxHighlightingItem(TextExtension textExtension)
        {
            if (textExtension == null)
            {
                throw new ArgumentNullException(nameof(textExtension));
            }

            _textExtension       = textExtension;
            _highlightingService = textExtension.Editor.Services.GetInstance <IHighlightingService>().ThrowIfMissing();
        }
 public RepositoryController(
     ISettingsProvider settingsProvider,
     IRepositoryResolver repoResolver,
     IHighlightingService hightlightingService)
 {
     _hightlightingService = hightlightingService;
     _repoResolver = repoResolver;
     _configurationProvider = settingsProvider;
     _settings = _configurationProvider.Load();
 }
Example #7
0
        //--------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="TextDocumentViewModel"/> class.
        /// </summary>
        /// <param name="document">The document.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="document"/> is <see langword="null"/>.
        /// </exception>
        public TextDocumentViewModel(TextDocument document)
            : base(document)
        {
            if (document == null)
                throw new ArgumentNullException(nameof(document));

            var editor = document.Editor;

            // Mandatory services.
            _textService = editor.Services.GetInstance<ITextService>().ThrowIfMissing();
            _windowService = editor.Services.GetInstance<IWindowService>().ThrowIfMissing();

            // Optional services.
            _searchService = editor.Services.GetInstance<ISearchService>().WarnIfMissing();
            _highlightingService = editor.Services.GetInstance<IHighlightingService>().WarnIfMissing();

            _textContextMenu = _textService.ContextMenu;
            PrintPreviewCommand = new DelegateCommand(ShowPrintPreview);
            PrintCommand = new DelegateCommand(Print);
            FindCommand = new DelegateCommand(Find, CanFind);
            FindAndReplaceCommand = new DelegateCommand(FindAndReplace);
            CancelCommand = new DelegateCommand(Cancel);
        }
 public DocumentHighlightsHandler(IHighlightingService highlightingService, IGlobalOptionService globalOptions)
 {
     _highlightingService = highlightingService;
     _globalOptions       = globalOptions;
 }
Example #9
0
 public DocumentHighlightsHandler(IHighlightingService highlightingService)
 {
     _highlightingService = highlightingService;
 }
Example #10
0
		/// <summary>
		/// Overrides the default highlighting manager. (See property <see cref="Instance"/>.)
		/// </summary>
		/// <param name="highlightingManager">The highlighting manager.</param>
		public static void SetHighlightingManager(IHighlightingService highlightingManager)
		{
			_instance = highlightingManager;
		}
Example #11
0
 /// <summary>
 /// Overrides the default highlighting manager. (See property <see cref="Instance"/>.)
 /// </summary>
 /// <param name="highlightingManager">The highlighting manager.</param>
 public static void SetHighlightingManager(IHighlightingService highlightingManager)
 {
     _instance = highlightingManager;
 }
Example #12
0
 public HighlighterTagProducer(IHighlightingService highlightingService)
 {
     _highlightingService = highlightingService;
 }