protected override void WriteResponse(DashboardResponse response) { foreach (var resourceName in _resourceNames) { WriteResource( response, _assembly, $"{_baseNamespace}.{resourceName}"); } }
protected override async Task WriteResponse(DashboardResponse response) { foreach (var resourceName in _resourceNames) { await WriteResource( response, _assembly, $"{_baseNamespace}.{resourceName}").ConfigureAwait(false); } }
/// <exclude /> public void Assign(RazorPage parentPage) { Request = parentPage.Request; Response = parentPage.Response; Storage = parentPage.Storage; AppPath = parentPage.AppPath; StatsPollingInterval = parentPage.StatsPollingInterval; Url = parentPage.Url; Url.ApiPath = parentPage.Url.ApiPath; GenerationTime = parentPage.GenerationTime; _statisticsLazy = parentPage._statisticsLazy; }
protected void WriteResource(DashboardResponse response, Assembly assembly, string resourceName) { using (var inputStream = assembly.GetManifestResourceStream(resourceName)) { if (inputStream == null) { throw new ArgumentException($@"Resource with name {resourceName} not found in assembly {assembly}."); } inputStream.CopyTo(response.Body); } }
/// <exclude /> public void Assign(RazorPage parentPage) { Request = parentPage.Request; Response = parentPage.Response; Storage = parentPage.Storage; AppPath = parentPage.AppPath; StatsPollingInterval = parentPage.StatsPollingInterval; Url = parentPage.Url; GenerationTime = parentPage.GenerationTime; _statisticsLazy = parentPage._statisticsLazy; }
protected async Task WriteResource(DashboardResponse response, Assembly assembly, string resourceName) { using (var inputStream = assembly.GetManifestResourceStream(resourceName)) { if (inputStream == null) { throw new ArgumentException($@"Resource with name {resourceName} not found in assembly {assembly}."); } await inputStream.CopyToAsync(response.Body).ConfigureAwait(false); } }
/// <exclude /> public void Assign(RazorPage parentPage) { Request = parentPage.Request; Response = parentPage.Response; Storage = parentPage.Storage; AppPath = parentPage.AppPath; DashboardOptions = parentPage.DashboardOptions; Url = parentPage.Url; GenerationTime = parentPage.GenerationTime; _statisticsLazy = parentPage._statisticsLazy; }
internal void Assign(DashboardContext context) { Request = context.Request; Response = context.Response; Storage = context.Storage; AppPath = context.Options.AppPath; StatsPollingInterval = context.Options.StatsPollingInterval; Url = new UrlHelper(context); Url.ApiPath = context.Options.ApiPath; _statisticsLazy = new Lazy <StatisticsDto>(() => { var monitoring = Storage.GetMonitoringApi(); return(monitoring.GetStatistics()); }); }
protected virtual void WriteResponse(DashboardResponse response) { WriteResource(response, _assembly, _resourceName); }
internal void Assign(DashboardContext context) { Request = context.Request; Response = context.Response; Storage = context.Storage; AppPath = context.Options.AppPath; StatsPollingInterval = context.Options.StatsPollingInterval; Url = new UrlHelper(context); _statisticsLazy = new Lazy<StatisticsDto>(() => { var monitoring = Storage.GetMonitoringApi(); return monitoring.GetStatistics(); }); }
protected virtual Task WriteResponse(DashboardResponse response) { return(WriteResource(response, _assembly, _resourceName)); }