//-------------------------------------------------------------- #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); }
public HighlighterViewTaggerProvider( IForegroundNotificationService notificationService, IHighlightingService highlighterService, [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners) : base(new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.KeywordHighlighting), notificationService) { _highlighterService = highlighterService; }
//-------------------------------------------------------------- /// <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 HighlighterViewTaggerProvider( IHighlightingService highlightingService, IForegroundNotificationService notificationService, IAsynchronousOperationListenerProvider listenerProvider) : base(listenerProvider.GetListener(FeatureAttribute.KeywordHighlighting), notificationService) { _highlightingService = highlightingService; }
/// <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(); }
//-------------------------------------------------------------- /// <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; }
public DocumentHighlightsHandler(IHighlightingService highlightingService) { _highlightingService = highlightingService; }
/// <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; }
public HighlighterTagProducer(IHighlightingService highlightingService) { _highlightingService = highlightingService; }