Calyptus.Mvc.FormAttribute.TryBinding C# (CSharp) Method

TryBinding() protected method

protected TryBinding ( IHttpContext context, object &value ) : bool
context IHttpContext
value object
return bool
		protected override bool TryBinding(IHttpContext context, out object value)
		{
			if (BindingTargetType == typeof(HttpPostedFile))
			{
				HttpPostedFile file = context.Request.Files[Key];
				if (file != null && file.ContentLength > 0)
				{
					value = file;
					return true;
				}
				else
				{
					value = null;
					return false;
				}
			}
			if (SerializationHelper.TryDeserialize(context.Request.Form, Key, BindingTargetType, out value))
				return Optional ? true : value != null;
			return false;
		}
	}