public override IRazorSpanMappingService GetMappingService() { if (_mappingService == null) { _mappingService = new RazorLSPSpanMappingService(_lspDocumentMappingProvider, _documentSnapshot, _textSnapshot); } return(_mappingService); }
public TService GetService <TService>() where TService : class { if (_documentContainer == null) { return(this as TService); } if (typeof(TService) == typeof(IRazorSpanMappingService)) { if (_spanMappingService == null) { lock (_lock) { if (_spanMappingService == null) { _spanMappingService = _documentContainer.GetMappingService(); } } } return((TService)_spanMappingService); } if (typeof(TService) == typeof(IRazorDocumentExcerptService)) { if (_excerptService == null) { lock (_lock) { if (_excerptService == null) { _excerptService = _documentContainer.GetExcerptService(); } } } return((TService)_excerptService); } if (typeof(TService) == typeof(IRazorDocumentPropertiesService)) { if (_documentPropertiesService == null) { lock (_lock) { if (_documentPropertiesService == null) { _documentPropertiesService = _documentContainer.GetDocumentPropertiesService(); } } } return((TService)_documentPropertiesService); } return(this as TService); }
public RazorDocumentExcerptService(DocumentSnapshot document, IRazorSpanMappingService mapper) { if (mapper == null) { throw new ArgumentNullException(nameof(mapper)); } _document = document; _mapper = mapper; }
public RazorDocumentExcerptService(DocumentSnapshot document, IRazorSpanMappingService mappingService) { if (document is null) { throw new ArgumentNullException(nameof(document)); } if (mappingService is null) { throw new ArgumentNullException(nameof(mappingService)); } _document = document; _mappingService = mappingService; }
public CSharpDocumentExcerptService( IRazorSpanMappingService mappingService, LSPDocumentSnapshot documentSnapshot) { if (mappingService is null) { throw new ArgumentNullException(nameof(mappingService)); } if (documentSnapshot is null) { throw new ArgumentNullException(nameof(documentSnapshot)); } _mappingService = mappingService; _documentSnapshot = documentSnapshot; }
public RazorSpanMappingServiceWrapper(IRazorSpanMappingService razorSpanMappingService) { _razorSpanMappingService = razorSpanMappingService ?? throw new ArgumentNullException(nameof(razorSpanMappingService)); }