Calyptus.Mvc.ResponseAttribute.GetBinder C# (CSharp) Method

GetBinder() private static method

private static GetBinder ( Type type ) : object>.Func
type System.Type
return object>.Func
		private static Func<IHttpContext, object> GetBinder(Type type)
		{
			if (type == typeof(IHttpResponse)) return c => c.Response;
			else if (type == typeof(Stream)) return c => c.Response.OutputStream;
			else if (type == typeof(TextWriter)) return c => c.Response.Output;
			else if (type == typeof(BinaryWriter)) return c => new BinaryWriter(c.Response.OutputStream, c.Response.ContentEncoding);
			else if (type == typeof(TextWriter)) return c => c.Response.Output;
			else if (type == typeof(XmlWriter)) return c => System.Xml.XmlWriter.Create(c.Response.Output);
			else return null;
		}