本文整理汇总了C#中RavenJArray.All方法的典型用法代码示例。如果您正苦于以下问题:C# RavenJArray.All方法的具体用法?C# RavenJArray.All怎么用?C# RavenJArray.All使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RavenJArray
的用法示例。
在下文中一共展示了RavenJArray.All方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryParseCoordinateArrayArrayArray
private bool TryParseCoordinateArrayArrayArray(RavenJArray coordinates, StringBuilder result)
{
if (coordinates == null)
return false;
var valid = coordinates.All(x => x is RavenJArray);
if (!valid)
return false;
for (var index = 0; index < coordinates.Length; index++)
{
if (index > 0)
result.Append(", ");
result.Append("(");
if (!TryParseCoordinateArrayArray((RavenJArray)coordinates[index], result))
return false;
result.Append(")");
}
return true;
}
示例2: TryParseCoordinateArrayArrayArray
private bool TryParseCoordinateArrayArrayArray(RavenJArray coordinates, out CoordinateInfo[][][] result)
{
result = null;
if (coordinates == null)
return false;
var valid = coordinates.All(x => x is RavenJArray);
if (!valid)
return false;
var tempResult = new CoordinateInfo[coordinates.Length][][];
for (var index = 0; index < coordinates.Length; index++)
{
if (!TryParseCoordinateArrayArray((RavenJArray)coordinates[index], out tempResult[index]))
return false;
}
result = tempResult;
return true;
}
示例3: TryParseCoordinate
private bool TryParseCoordinate(RavenJArray coordinates, StringBuilder result)
{
if (coordinates != null && coordinates.Length > 1 && coordinates.All(x => x is RavenJValue))
{
var vals = coordinates.Cast<RavenJValue>().ToList();
if (vals.All(x => x.Type == JTokenType.Float || x.Type == JTokenType.Integer))
{
result.AppendFormat(
CultureInfo.InvariantCulture,
"{0} {1}",
Convert.ToDouble(vals[0].Value),
Convert.ToDouble(vals[1].Value)
);
return true;
}
}
return false;
}
示例4: TryParseCoordinate
private bool TryParseCoordinate(RavenJArray coordinates, out CoordinateInfo result)
{
if (coordinates != null && coordinates.Length > 1 && coordinates.All(x => x is RavenJValue))
{
var vals = coordinates.Cast<RavenJValue>().ToList();
if (vals.All(x => x.Type == JTokenType.Float || x.Type == JTokenType.Integer))
{
result = new CoordinateInfo
{
X = Convert.ToDouble(vals[0].Value),
Y = Convert.ToDouble(vals[1].Value),
Z = vals.Count > 2 ? Convert.ToDouble(vals[2].Value) : (double?) null,
M = vals.Count > 3 ? Convert.ToDouble(vals[3].Value) : (double?) null
};
return true;
}
}
result = null;
return false;
}