Exemplo n.º 1
0
 protected override void WriteResponse(DashboardRequest request, DashboardResponse response)
 {
     foreach (var resourceName in _resourceNames)
     {
         WriteResource(response, $"{_baseNamespace}.{resourceName}");
     }
 }
Exemplo n.º 2
0
        internal void Assign(DashboardContext context)
        {
            Request  = context.Request;
            Response = context.Response;

            AppPath = context.Options.AppPath;
            StatsPollingInterval = context.Options.StatsPollingInterval;
            Url = new UrlHelper(context);
        }
Exemplo n.º 3
0
        /// <exclude />
        public void Assign(RazorPage parentPage)
        {
            Request              = parentPage.Request;
            Response             = parentPage.Response;
            AppPath              = parentPage.AppPath;
            StatsPollingInterval = parentPage.StatsPollingInterval;
            Url = parentPage.Url;

            GenerationTime = parentPage.GenerationTime;
        }
        public virtual bool WriteNotFound(DashboardResponse response)
        {
            var NotFoundRes = "Require resource not found in assembly.";

            response.ContentType = "text/html";
            response.SetExpire(DateTimeOffset.Now.AddHours(-1));
            var data = Encoding.UTF8.GetBytes(NotFoundRes);

            response.Body.Write(data, 0, data.Length);
            return(false);
        }
 protected bool WriteResource(DashboardResponse response, string resourceName)
 {
     if (_assembly.GetManifestResourceInfo(resourceName) == null)
     {
         return(WriteNotFound(response));
     }
     using (var inputStream = _assembly.GetManifestResourceStream(resourceName))
     {
         inputStream.CopyTo(response.Body);
     }
     return(true);
 }
 protected virtual void WriteResponse(DashboardRequest request, DashboardResponse response)
 {
     WriteResource(response, _resourceName);
 }
        protected override void WriteResponse(DashboardRequest request, DashboardResponse response)
        {
            var resourceName = _filter(_resourceNames, request);

            WriteResource(response, $"{_baseNamespace}.{resourceName}");
        }