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


C# ReadOnlyCollection.Skip方法代码示例

本文整理汇总了C#中ReadOnlyCollection.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# ReadOnlyCollection.Skip方法的具体用法?C# ReadOnlyCollection.Skip怎么用?C# ReadOnlyCollection.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReadOnlyCollection的用法示例。


在下文中一共展示了ReadOnlyCollection.Skip方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PowerPcArchitecture

        /// <summary>
        /// Creates an instance of PowerPcArchitecture.
        /// </summary>
        /// <param name="wordWidth">Supplies the word width of the PowerPC architecture.</param>
        public PowerPcArchitecture(PrimitiveType wordWidth)
        {
            this.wordWidth = wordWidth;
            this.ptrType = PrimitiveType.Create(Domain.Pointer, wordWidth.Size);

            this.lr = new RegisterStorage("lr", 0x68,   wordWidth);
            this.cr = new RegisterStorage("cr", 0x69,   wordWidth);
            this.ctr = new RegisterStorage("ctr", 0x6A, wordWidth);
            this.xer = new RegisterStorage("xer", 0x6B, wordWidth);
            this.fpscr = new RegisterStorage("fpscr", 0x6C, wordWidth);

            regs = new ReadOnlyCollection<RegisterStorage>(
                Enumerable.Range(0, 0x20)
                    .Select(n => new RegisterStorage("r" + n, n, wordWidth))
                .Concat(Enumerable.Range(0, 0x20)
                    .Select(n => new RegisterStorage("f" + n, n + 0x20, PrimitiveType.Word64)))
                .Concat(Enumerable.Range(0, 0x20)
                    .Select(n => new RegisterStorage("v" + n, n + 0x40, PrimitiveType.Word128)))
                .Concat(Enumerable.Range(0, 8)
                    .Select(n => new RegisterStorage("cr" + n, n + 0x60, PrimitiveType.Byte)))
                .Concat(new[] { lr, cr, ctr, xer })
                .ToList());

            fpregs = new ReadOnlyCollection<RegisterStorage>(
                regs.Skip(0x20).Take(0x20).ToList());

            vregs = new ReadOnlyCollection<RegisterStorage>(
                regs.Skip(0x40).Take(0x20).ToList());

            cregs = new ReadOnlyCollection<RegisterStorage>(
                regs.Skip(0x60).Take(0x8).ToList());

        }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:37,代码来源:PowerPcArchitecture.cs

示例2: PowerPcArchitecture

        /// <summary>
        /// Creates an instance of PowerPcArchitecture.
        /// </summary>
        /// <param name="wordWidth">Supplies the word width of the PowerPC architecture.</param>
        public PowerPcArchitecture(PrimitiveType wordWidth)
        {
            WordWidth = wordWidth;
            PointerType = PrimitiveType.Create(Domain.Pointer, wordWidth.Size);
            FramePointerType = PointerType;
            InstructionBitSize = 32;

            this.lr = new RegisterStorage("lr", 0x68, 0, wordWidth);
            this.ctr = new RegisterStorage("ctr", 0x6A, 0, wordWidth);
            this.xer = new RegisterStorage("xer", 0x6B, 0, wordWidth);
            this.fpscr = new RegisterStorage("fpscr", 0x6C, 0, wordWidth);

            this.cr = new FlagRegister("cr", wordWidth);

            regs = new ReadOnlyCollection<RegisterStorage>(
                Enumerable.Range(0, 0x20)
                    .Select(n => new RegisterStorage("r" + n, n, 0, wordWidth))
                .Concat(Enumerable.Range(0, 0x20)
                    .Select(n => new RegisterStorage("f" + n, n + 0x20, 0, PrimitiveType.Word64)))
                .Concat(Enumerable.Range(0, 0x20)
                    .Select(n => new RegisterStorage("v" + n, n + 0x40, 0, PrimitiveType.Word128)))
                .Concat(Enumerable.Range(0, 8)
                    .Select(n => new RegisterStorage("cr" + n, n + 0x60, 0, PrimitiveType.Byte)))
                .Concat(new[] { lr, ctr, xer })
                .ToList());

            fpregs = new ReadOnlyCollection<RegisterStorage>(
                regs.Skip(0x20).Take(0x20).ToList());

            vregs = new ReadOnlyCollection<RegisterStorage>(
                regs.Skip(0x40).Take(0x20).ToList());

            cregs = new ReadOnlyCollection<RegisterStorage>(
                regs.Skip(0x60).Take(0x8).ToList());

            //$REVIEW: using R1 as the stack register is a _convention_. It 
            // should be platform-specific at the very least.
            StackRegister = regs[1];
        }
开发者ID:relaxar,项目名称:reko,代码行数:43,代码来源:PowerPcArchitecture.cs

示例3: EvaluateStandardCallInvoke

 protected object EvaluateStandardCallInvoke(string methodName, ReadOnlyCollection<Expression> operands)
 {
     return operands[0].Type.GetMethod(methodName,
                                operands.Skip(1).Select(op => op.Type).ToArray())
                                .Invoke(operands[0].Evaluate(),
                                        operands.Skip(1).Select(op => op.Evaluate()).ToArray());
 }
开发者ID:TheRealDuckboy,项目名称:mono-soc-2008,代码行数:7,代码来源:SpecialExpression.cs

示例4: EvaluateMathCallInvoke

 private object EvaluateMathCallInvoke(SpecialExpressionType SpecialNodeType, ReadOnlyCollection<Expression> operands)
 {
     return typeof(Math).GetMethod(SpecialNodeType.ToString(), operands.Skip(1).Select(op => op.Type).ToArray())
             .Invoke(null, operands.Skip(1).Select(op => op.Evaluate()).ToArray());
 }
开发者ID:nlhepler,项目名称:mono,代码行数:5,代码来源:SpecialExpression.cs

示例5: ReplaceProjectionSpans

            private void ReplaceProjectionSpans(ReadOnlyCollection<SnapshotSpan> oldProjectionSpans, List<SpanRangeEdit> spanEdits)
            {
                Debug.Assert(spanEdits.Count > 0);

                int start = spanEdits[0].Start;
                int end = spanEdits[spanEdits.Count - 1].End;

                var replacement = new List<object>();
                replacement.AddRange(spanEdits[0].Replacement);
                int lastEnd = spanEdits[0].End;

                for (int i = 1; i < spanEdits.Count; i++)
                {
                    SpanRangeEdit edit = spanEdits[i];

                    int gap = edit.Start - lastEnd;

                    // there is always at least prompt span in between subsequent edits
                    Debug.Assert(gap != 0);

                    // spans can't share more then one span
                    Debug.Assert(gap >= -1);

                    if (gap == -1)
                    {
                        replacement.AddRange(edit.Replacement.Skip(1));
                    }
                    else
                    {
                        replacement.AddRange(oldProjectionSpans.Skip(lastEnd).Take(gap).Select(CreateTrackingSpan));
                        replacement.AddRange(edit.Replacement);
                    }

                    lastEnd = edit.End;
                }

                _projectionBuffer.ReplaceSpans(start, end - start, replacement, EditOptions.None, SuppressPromptInjectionTag);
            }
开发者ID:nileshjagtap,项目名称:roslyn,代码行数:38,代码来源:InteractiveWindow.UIThreadOnly.cs

示例6: GetSizes

    private UriBasedCollection<long> GetSizes(ReadOnlyCollection<Uri> urls, string cookies)
    {
      UriBasedCollection<long> sizes = new UriBasedCollection<long>();
      int parallelDownloadsNumber = WindowsSettings.AppDownloaderParallelThreads.Value;

      for (int i = 0; i < urls.Count; i += parallelDownloadsNumber)
      {
        int remains = urls.Count - i;
        var tasks = urls
          .Skip(i)
          .Take(Math.Min(parallelDownloadsNumber, remains))
          .Select(url => Task.Factory.StartNew(() => this.CheckFileSize(sizes, url, cookies)))
          .ToArray();

        Task.WaitAll(tasks, remains * 60000);
      }

      return sizes;
    }
开发者ID:lennartfranke,项目名称:Sitecore-Instance-Manager,代码行数:19,代码来源:Downloads.xaml.cs


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