让asp.net mvc的Action支持jQuery直接提交的javascript对象(4)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-26 11:00 点击:次
var elements = new ValueProviderResult[arraySize];
foreach (var i in indexList)
{
elements[i] = GetValue(subKeys[i.ToString()]);
}
return new ArrayValueProviderResult(elements);
}
}
var properties = new Dictionary<string, ValueProviderResult>(StringComparer.OrdinalIgnoreCase);
foreach (var item in subKeys)
{
properties[item.Key] = GetValue(item.Value);
}
return new ObjectValueProviderResult(properties);
}
}
return result;
}
}
public class ArrayValueProviderResult
: ValueProviderResult
{
private ValueProviderResult[] _Elements;
public ArrayValueProviderResult(ValueProviderResult[] elements)
{
_Elements = elements;
base.RawValue = elements.Select( v => v.RawValue ).ToArray();
base.AttemptedValue = "[" + string.Join(", ", elements.Select(v => v.AttemptedValue)) + "]";
}
public override object ConvertTo(Type type, CultureInfo culture)
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>