public OperationViewModel(IDumpService dumpService, IFileService fileService, IDialogService dialogService) { _dumpService = dumpService; _fileService = fileService; _dialogService = dialogService; DumpCommand = new RelayCommand(DumpScreen); MessengerInstance.Register <DeviceAvailableMessage>(this, NewDeviceAvailable); MessengerInstance.Register <RequestDumpMessage>(this, (message) => DumpScreen()); MessengerInstance.Register <SelectedDeviceChangedMessage>(this, SelectedDeviceChanged); }
public DiagController(ILogger <DiagController> logger, IServiceProvider serviceProvider) { _logger = logger; _diagnosticServices = serviceProvider.GetRequiredService <IDiagnosticServices>(); _diagnosticPortOptions = serviceProvider.GetService <IOptions <DiagnosticPortOptions> >(); _operationsStore = serviceProvider.GetRequiredService <EgressOperationStore>(); _dumpService = serviceProvider.GetRequiredService <IDumpService>(); _counterOptions = serviceProvider.GetRequiredService <IOptionsMonitor <GlobalCounterOptions> >(); _operationTrackerService = serviceProvider.GetRequiredService <OperationTrackerService>(); }
public async Task <IActionResult> DownloadAsJsonAsync([FromServices] IDumpService dumpService) { try { string json = await dumpService.GetGroupDataAsync(HttpContext.RequestAborted); return(File(Encoding.UTF8.GetBytes(json), "text/json", "groups.json")); } catch (InvalidOperationException ex) { _logger.LogError(ex, "Download as JSON"); AddStatusMessage(_localizer["DownloadAsJsonAsync:UnknownError"], StatusMessageTypes.Error); } return(await RenderAsync(0, 0)); }
public async Task <ServerSourceHolder> StartServerAsync(EndpointInfoSourceCallback sourceCallback = null, IDumpService dumpService = null, OperationTrackerService operationTrackerService = null) { DiagnosticPortHelper.Generate(DiagnosticPortConnectionMode.Listen, out _, out string transportName); _outputHelper.WriteLine("Starting server endpoint info source at '" + transportName + "'."); List <IEndpointInfoSourceCallbacks> callbacks = new(); if (null != sourceCallback) { callbacks.Add(sourceCallback); if (null != dumpService) { callbacks.Add(new OperationTrackerServiceEndpointInfoSourceCallback(operationTrackerService)); } } IOptions <DiagnosticPortOptions> portOptions = Extensions.Options.Options.Create( new DiagnosticPortOptions() { ConnectionMode = DiagnosticPortConnectionMode.Listen, EndpointName = transportName }); ServerEndpointInfoSource source = new(portOptions, callbacks, operationTrackerService); await source.StartAsync(CancellationToken.None); return(new ServerSourceHolder(source, transportName)); }
public CollectDumpAction(IServiceProvider serviceProvider, IEndpointInfo endpointInfo, CollectDumpOptions options) : base(endpointInfo, options) { _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); _dumpService = serviceProvider.GetRequiredService <IDumpService>(); }
public ExportService(IApiService apiService, IDumpService dumpService) { _dumpService = dumpService; _apiService = apiService; }