コード例 #1
0
        public void Render(HtmlTextWriter writer)
        {
            if (_isAutomatedTool)
            {
                var console = new StringProgressStatus();
                ProcessInternal(console);

                HttpContext.Current.Response.ContentType = "text/plain";
                HttpContext.Current.Response.Write(Title + "\n\n");
                HttpContext.Current.Response.Write(console.Output);

                if (console.HasErrors)
                {
                    HttpContext.Current.Response.StatusCode = 500;
                    HttpContext.Current.Response.TrySkipIisCustomErrors = true;
                }

                HttpContext.Current.Response.End();
            }
            else
            {
                var console = new CustomStyledHtml5WebConsole(HttpContext.Current.Response);
                console.Title = Title;
                console.Render(ProcessInternal);
            }
        }
コード例 #2
0
ファイル: ControlPanelConsole.cs プロジェクト: Jonne/Unicorn
        public void Render(HtmlTextWriter writer)
        {
            if (_isAutomatedTool)
            {
                var console = new StringProgressStatus();
                ProcessInternal(console);

                HttpContext.Current.Response.ContentType = "text/plain";
                HttpContext.Current.Response.Write(Title + "\n\n");
                HttpContext.Current.Response.Write(console.Output);

                if (console.HasErrors)
                {
                    HttpContext.Current.Response.StatusCode             = 500;
                    HttpContext.Current.Response.TrySkipIisCustomErrors = true;
                }

                HttpContext.Current.Response.End();
            }
            else
            {
                var console = new CustomStyledHtml5WebConsole(HttpContext.Current.Response);
                console.Title = Title;
                console.Render(ProcessInternal);
            }
        }
コード例 #3
0
ファイル: WebConsoleResponse.cs プロジェクト: sw08023/UNICORN
        public virtual void Execute(HttpResponseBase response)
        {
            if (_isAutomatedTool)
            {
                var console = new UnicornStringConsole();
                ProcessInternal(console);

                response.ContentType = "text/plain";
                response.Write(_title + "\n\n");
                response.Write(console.Output);

                if (console.HasErrors)
                {
                    response.StatusCode             = 500;
                    response.TrySkipIisCustomErrors = true;
                }

                response.End();
            }
            else
            {
                var console = new CustomStyledHtml5WebConsole(response);
                console.Title = _title;
                console.Render(ProcessInternal);
            }
        }
コード例 #4
0
        public virtual void Execute(HttpResponseBase response)
        {
            if (_isAutomatedTool)
            {
                var console = new TextWebConsole(response);

                console.WriteLine(_title + "\n\n");

                try
                {
                    console.Render(ProcessInternal);
                }
                catch (Exception ex)
                {
                    // writing the exception will also trigger HasErrors
                    console.WriteException(ex);
                }

                if (console.HasErrors)
                {
                    // we cannot return HTTP 500 because headers will have already been sent by now
                    response.Write("****ERROR OCCURRED****");
                }

                response.End();
            }
            else
            {
                var console = new CustomStyledHtml5WebConsole(response);
                console.Title = _title;
                console.Render(ProcessInternal);
            }
        }
コード例 #5
0
ファイル: WebConsoleResponse.cs プロジェクト: hbopuri/Unicorn
		public virtual void Execute(HttpResponseBase response)
		{
			if (_isAutomatedTool)
			{
				var console = new UnicornStringConsole();
				ProcessInternal(console);

				response.ContentType = "text/plain";
				response.Write(_title + "\n\n");
				response.Write(console.Output);

				if (console.HasErrors)
				{
					response.StatusCode = 500;
					response.TrySkipIisCustomErrors = true;
				}

				response.End();
			}
			else
			{
				var console = new CustomStyledHtml5WebConsole(response);
				console.Title = _title;
				console.Render(ProcessInternal);
			}
		}