本文整理汇总了C#中ISequence.GetLength方法的典型用法代码示例。如果您正苦于以下问题:C# ISequence.GetLength方法的具体用法?C# ISequence.GetLength怎么用?C# ISequence.GetLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISequence
的用法示例。
在下文中一共展示了ISequence.GetLength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StatResult
public StatResult(ISequence statResult, [DefaultParameterValue(null)]object dict)
{
// dict is allowed by CPython's stat_result, but doesn't seem to do anything, so we ignore it here.
if (statResult.GetLength() != 10) {
throw Ops.TypeError("stat_result() takes a 10-sequence ({0}-sequence given)", statResult.GetLength());
}
this.mode = Converter.ConvertToBigInteger(statResult[0]);
this.ino = Converter.ConvertToBigInteger(statResult[1]);
this.dev = Converter.ConvertToBigInteger(statResult[2]);
this.nlink = Converter.ConvertToBigInteger(statResult[3]);
this.uid = Converter.ConvertToBigInteger(statResult[4]);
this.gid = Converter.ConvertToBigInteger(statResult[5]);
this.size = Converter.ConvertToBigInteger(statResult[6]);
this.atime = Converter.ConvertToBigInteger(statResult[7]);
this.mtime = Converter.ConvertToBigInteger(statResult[8]);
this.ctime = Converter.ConvertToBigInteger(statResult[9]);
}
示例2: SequenceSliceAssign
private static void SequenceSliceAssign(SliceAssign assign, int start, int n, int step, ISequence lst)
{
if (lst.GetLength() < n) throw Ops.ValueError("too few items in the enumerator. need {0}", n);
else if (lst.GetLength() != n) throw Ops.ValueError("too many items in the enumerator need {0}", n);
for (int i = 0, index = start; i < n; i++, index += step) {
assign(index, lst[i]);
}
}