本文整理汇总了C#中Newtonsoft.Json.Linq.JArray.Value方法的典型用法代码示例。如果您正苦于以下问题:C# JArray.Value方法的具体用法?C# JArray.Value怎么用?C# JArray.Value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Newtonsoft.Json.Linq.JArray
的用法示例。
在下文中一共展示了JArray.Value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadFromJObject
public static OrderInfo ReadFromJObject(JArray o) {
if ( o == null )
return null;
return new OrderInfo() {
Price = o.Value<decimal>(0),
Amount = o.Value<decimal>(1),
};
}
示例2: CreateFromJObject
public static SimpleOrderInfo CreateFromJObject(JArray obj)
{
if (obj == null)
{
return null;
}
var r = new SimpleOrderInfo()
{
Price = obj.Value<decimal>(0),
Amount = obj.Value<decimal>(1),
};
return r;
}
示例3: ParseMarketDepth
internal static MarketOrder ParseMarketDepth(JArray depthArray, OrderType orderType)
{
return new MarketOrder(orderType,
depthArray.Value<decimal>(0), depthArray.Value<decimal>(1));
}
示例4: buildElements
protected List<TJSONValue> buildElements(JArray arr)
{
try
{
List<TJSONValue> res = new List<TJSONValue>();
for (int i = 0; i < arr.Count; i++)
{
switch (arr[i].Type)
{
case JTokenType.Null: { res.Add(new TJSONNull()); break; }
case JTokenType.String: { res.Add(new TJSONString(arr.Value<string>(i))); break; }
case JTokenType.Float: { res.Add(new TJSONNumber(arr.Value<float>(i))); break; }
case JTokenType.Integer: { res.Add(new TJSONNumber(arr.Value<long>(i))); break; }
case JTokenType.Array: { res.Add(new TJSONArray(arr.Value<JArray>(i))); break; }
case JTokenType.Object: { res.Add(new TJSONObject(arr.Value<JObject>(i))); break; }
case JTokenType.Boolean: { if (arr.Value<Boolean>(i)) res.Add(new TJSONTrue()); else res.Add(new TJSONFalse()); break; }
}
}
return res;
}
catch (Exception)
{
return null;
}
}
示例5: ApplyMatrix
private static void ApplyMatrix(ref Matrix3D matrix, JArray values)
{
matrix.M11 = values.Value<double>(0);
matrix.M12 = values.Value<double>(1);
matrix.M13 = values.Value<double>(2);
matrix.M14 = values.Value<double>(3);
matrix.M21 = values.Value<double>(4);
matrix.M22 = values.Value<double>(5);
matrix.M23 = values.Value<double>(6);
matrix.M24 = values.Value<double>(7);
matrix.M31 = values.Value<double>(8);
matrix.M32 = values.Value<double>(9);
matrix.M33 = values.Value<double>(10);
matrix.M34 = values.Value<double>(11);
matrix.OffsetX = values.Value<double>(12);
matrix.OffsetY = values.Value<double>(13);
matrix.OffsetZ = values.Value<double>(14);
matrix.M44 = values.Value<double>(15);
}