public DocumentAnalyzerController(IDocumentAnalyzerService documentAnalyzerService, IMlModelService mlModelService, IResultAnalyzer resultAnalyzer, ILogger <DocumentAnalyzerController> logger) { _documentAnalyzerService = documentAnalyzerService; _mlModelService = mlModelService; _resultAnalyzer = resultAnalyzer; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="CodeStructureViewModel"/> class. /// </summary> /// <param name="editor">The <see cref="IEditor"/>.</param> /// <param name="diagnosticProvider">The <see cref="IDiagnosticProvider"/>.</param> /// <param name="documentAnalyzerService">The <see cref="IDocumentAnalyzerService"/>.</param> /// <param name="spaceReservation">The <see cref="IAdornmentSpaceReservation"/>.</param> public CodeStructureViewModel( IEditor editor, IDiagnosticProvider diagnosticProvider, IDocumentAnalyzerService documentAnalyzerService, IAdornmentSpaceReservation spaceReservation, IDispatcherServiceFactory dispatcherServiceFactory) { _editor = editor; _diagnosticProvider = diagnosticProvider ?? throw new ArgumentNullException(nameof(diagnosticProvider)); _documentAnalyzerService = documentAnalyzerService ?? throw new ArgumentNullException(nameof(documentAnalyzerService)); _dispatcherService = dispatcherServiceFactory.Create(); WeakEventManager <IDiagnosticProvider, DiagnosticsChangedEventArgs> .AddHandler(_diagnosticProvider, nameof(IDiagnosticProvider.DiagnosticsChanged), OnDiagnosticsChanged); WeakEventManager <IDocumentAnalyzerService, EventArgs> .AddHandler(_documentAnalyzerService, nameof(IDocumentAnalyzerService.AnalysisFinished), OnAnalysisFinished); SpaceReservation = spaceReservation; }
/// <summary> /// Initializes a new instance of the <see cref="CodeStructureViewModel"/> class. /// </summary> /// <param name="textView">The <see cref="IWpfTextView"/>.</param> /// <param name="adornmentLayer">The <see cref="IAdornmentLayer"/>.</param> /// <param name="diagnosticProvider">The <see cref="IDiagnosticProvider"/>.</param> /// <param name="documentAnalyzerService">The <see cref="IDocumentAnalyzerService"/>.</param> /// <param name="spaceReservation">The <see cref="IAdornmentSpaceReservation"/>.</param> public CodeStructureViewModel( IWpfTextView textView, IAdornmentLayer adornmentLayer, IDiagnosticProvider diagnosticProvider, IDocumentAnalyzerService documentAnalyzerService, IAdornmentSpaceReservation spaceReservation) { _textView = textView; _diagnosticProvider = diagnosticProvider ?? throw new ArgumentNullException(nameof(diagnosticProvider)); _documentAnalyzerService = documentAnalyzerService ?? throw new ArgumentNullException(nameof(documentAnalyzerService)); _adornmentLayer = adornmentLayer ?? throw new ArgumentNullException(nameof(adornmentLayer)); WeakEventManager <IDiagnosticProvider, DiagnosticsChangedEventArgs> .AddHandler(_diagnosticProvider, nameof(IDiagnosticProvider.DiagnosticsChanged), OnDiagnosticsChanged); WeakEventManager <IDocumentAnalyzerService, EventArgs> .AddHandler(_documentAnalyzerService, nameof(IDocumentAnalyzerService.AnalysisFinished), OnAnalysisFinished); SpaceReservation = spaceReservation; }