예제 #1
0
 public override void OnActionExecuted(ActionExecutedContext filterContext)
 {
     if (filterContext.HttpContext.Items.GetDocTransformsEnabled()
         && filterContext.Result is ViewResult
         && filterContext.Exception == null)
     {
         sb = new StringBuilder();
         sw = new StringWriter(sb);
         tw = new HtmlTextWriter(sw);
         output = (HttpWriter)filterContext.RequestContext.HttpContext.Response.Output;
         filterContext.RequestContext.HttpContext.Response.Output = tw;
     }
     base.OnActionExecuted(filterContext);
 }
 internal HttpResponseStream(HttpWriter writer) {
     _writer = writer;
 }
 public HtmlTextWriter(TextWriter writer, string tabString) : base(CultureInfo.InvariantCulture)
 {
     this._currentLayout = new Layout(HorizontalAlign.NotSet, true);
     this.writer = writer;
     this.tabString = tabString;
     this.indentLevel = 0;
     this.tabsPending = false;
     this._httpWriter = writer as HttpWriter;
     this._isDescendant = base.GetType() != typeof(HtmlTextWriter);
     this._attrCount = 0;
     this._styleCount = 0;
     this._endTagCount = 0;
     this._inlineCount = 0;
 }
 public HttpResponse(TextWriter writer)
 {
     this._statusCode = 200;
     this._bufferOutput = true;
     this._contentType = "text/html";
     this._wr = null;
     this._httpWriter = null;
     this._writer = writer;
 }
 internal void InitResponseWriter()
 {
     if (this._httpWriter == null)
     {
         this._httpWriter = new HttpWriter(this);
         this._writer = this._httpWriter;
     }
 }
예제 #6
0
		internal void Dispose ()
		{
			if (_Writer != null) {
				_Writer.Dispose ();
				_Writer = null;
			}
		}
예제 #7
0
		internal void InitializeWriter ()
		{
			// We cannot do this in the .ctor because HttpWriter uses configuration and
			// it may not be initialized
			if (_Writer == null) {
				 _Writer = new HttpWriter (this);
				 _TextWriter = _Writer;
			}
		}
예제 #8
0
파일: HttpWriter.cs 프로젝트: nobled/mono
		public void FixtureSetUp ()
		{
			HttpContext context = new HttpContext (null);
			writer = (HttpWriter) context.Response.Output;
		}
 internal HttpResponseStream(HttpWriter Writer) {
    _Writer = Writer;
 }
        internal void InitResponseWriter() {
            if (_httpWriter == null) {
                _httpWriter = new HttpWriter(this);

                _writer = _httpWriter;
            }
        }
 // Public constructor for responses that go to an arbitrary writer
 // Initializes a new instance of the <see langword='HttpResponse'/> class.</para>
 public HttpResponse(TextWriter writer) {
     _wr = null;
     _httpWriter = null;
     _writer = writer;
 }
        private static void HtmlAttributeEncodeInternal(string value, HttpWriter writer) {
            int pos = IndexOfHtmlAttributeEncodingChars(value, 0);
            if (pos == -1) {
                writer.Write(value);
                return;
            }

            int cch = value.Length;
            int startPos = 0;
            for (; ; ) {
                if (pos > startPos) {
                    writer.WriteString(value, startPos, pos - startPos);
                }

                char ch = value[pos];
                switch (ch) {
                    case '"':
                        writer.Write("&quot;");
                        break;
                    case '\'':
                        writer.Write("&#39;");
                        break;
                    case '&':
                        writer.Write("&amp;");
                        break;
                    case '<':
                        // Whidbey 32404: The character '<' is not valid in an XML attribute value.
                        // (See the W3C XML rec).
                        writer.Write("&lt;");
                        break;
                }

                startPos = pos + 1;
                if (startPos >= cch)
                    break;

                pos = IndexOfHtmlAttributeEncodingChars(value, startPos);
                if (pos == -1) {
                    writer.WriteString(value, startPos, cch - startPos);
                    break;
                }
            }
        }
        private static void HtmlAttributeEncodeInternal(string value, HttpWriter writer)
        {
            int num = IndexOfHtmlAttributeEncodingChars(value, 0);
            if (num == -1)
            {
                writer.Write(value);
                return;
            }
            int length = value.Length;
            int index = 0;
        Label_001D:
            if (num > index)
            {
                writer.WriteString(value, index, num - index);
            }
            switch (value[num])
            {
                case '&':
                    writer.Write("&amp;");
                    break;

                case '\'':
                    writer.Write("&#39;");
                    break;

                case '<':
                    writer.Write("&lt;");
                    break;

                case '"':
                    writer.Write("&quot;");
                    break;
            }
            index = num + 1;
            if (index < length)
            {
                num = IndexOfHtmlAttributeEncodingChars(value, index);
                if (num != -1)
                {
                    goto Label_001D;
                }
                writer.WriteString(value, index, length - index);
            }
        }
 internal HttpResponseStreamFilterSink(HttpWriter writer) : base(writer) {
 }
예제 #15
0
 internal HttpResponseStream(HttpWriter writer)
 {
     _writer = writer;
 }
 internal HttpResponseStreamFilterSink(HttpWriter writer) : base(writer)
 {
 }
		internal HttpResponseStreamProxy (HttpWriter writer) : base (writer)
		{
		}