本文整理汇总了C#中Value.Any方法的典型用法代码示例。如果您正苦于以下问题:C# Value.Any方法的具体用法?C# Value.Any怎么用?C# Value.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Value
的用法示例。
在下文中一共展示了Value.Any方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleLayer4Processing
private PacketData HandleLayer4Processing(Handler nextHandler, PacketData packetData, Value[] parameterArray, out String layer3HandlerName)
{
layer3HandlerName = parameterArray.Any(p => p.Name.StartsWith("IPv6Header:")) ? "IPV6" : "IPV4";
IHeader header = nextHandler.Build(parameterArray);
return GeneratePacketData(packetData, header);
}
示例2: ValidateParameterArray
internal static void ValidateParameterArray(Value[] parameterArray)
{
Func<Value, Boolean> doesNotContainScope = p => !p.IsScoped;
if (parameterArray.Any(doesNotContainScope))
{
throw new ArgumentException(string.Format("Argument not scoped ({0}).", parameterArray.First(doesNotContainScope)));
}
}
示例3: VCat
// Make array as vertical concatenation (stack) of the arguments' rows
public static Value VCat(Value[] vs) {
int rows = 0, cols = 0;
foreach (Value v in vs) {
if (v is ErrorValue) {
return v;
}
else if (v is ArrayValue) {
cols = Math.Max(cols, (v as ArrayValue).Cols);
rows += (v as ArrayValue).Rows;
}
else {
cols = Math.Max(cols, 1);
rows += 1;
}
}
if (vs.Any(v => v is ArrayValue && ((ArrayValue)v).Cols != cols)) {
return ErrorValue.Make("#ERR: Column counts differ");
}
Value[,] result = new Value[cols, rows];
int nextRow = 0;
foreach (Value v in vs) {
if (v is ArrayValue) {
ArrayValue arr = v as ArrayValue;
for (int r = 0; r < arr.Rows; r++) {
for (int c = 0; c < cols; c++) {
result[c, nextRow] = arr[c, r];
}
nextRow++;
}
}
else {
for (int c = 0; c < cols; c++) {
result[c, nextRow] = v;
}
nextRow++;
}
}
return new ArrayExplicit(result);
}