当前位置: 首页>>代码示例>>C#>>正文


C# ISequence.GetLength方法代码示例

本文整理汇总了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]);
            }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:19,代码来源:nt.cs

示例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]);
            }
        }
开发者ID:FabioNascimento,项目名称:DICommander,代码行数:9,代码来源:Slice.cs


注:本文中的ISequence.GetLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。