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


C# ReadOnlyCollection.Take方法代码示例

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


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

示例1: VisitFieldDeclarations

        protected ReadOnlyCollection<FieldDeclaration> VisitFieldDeclarations(ReadOnlyCollection<FieldDeclaration> fields)
        {
            List<FieldDeclaration> alternate = null;

              for (int i = 0, n = fields.Count; i < n; i++)
              {
            FieldDeclaration field = fields[i];
            Expression e = this.Visit(field.Expression);

            if (alternate == null && e != field.Expression)
            {
              alternate = fields.Take(i).ToList();
            }

            if (alternate != null)
            {
              alternate.Add(new FieldDeclaration(field.Name, e));
            }
              }

              if (alternate != null)
              {
            return alternate.AsReadOnly();
              }

              return fields;
        }
开发者ID:Toolate,项目名称:dotSearch,代码行数:27,代码来源:LuceneExpressionVisitor.cs

示例2: VisitFieldDeclarationList

        protected virtual ReadOnlyCollection<FieldDeclaration> VisitFieldDeclarationList(ReadOnlyCollection<FieldDeclaration> fields)
        {
            if (fields == null)
                return fields;

            List<FieldDeclaration> alternate = null;
            for (int i = 0, n = fields.Count; i < n; i++)
            {
                var f = fields[i];
                var e = Visit(f.Expression);
                if (f.Expression != e && alternate == null)
                    alternate = fields.Take(i).ToList();
                if (alternate != null)
                    alternate.Add(new FieldDeclaration(f.Name, e));
            }
            if (alternate != null)
                return alternate.AsReadOnly();
            return fields;
        }
开发者ID:rhwy,项目名称:fluent-mongo,代码行数:19,代码来源:MongoExpressionVisitor.cs

示例3: VisitOrderBy

 protected ReadOnlyCollection<OrderExpression> VisitOrderBy(ReadOnlyCollection<OrderExpression> orderBys)
 {
     if (orderBys != null) 
     {
         List<OrderExpression> alternate = null;
         for (int i = 0, n = orderBys.Count; i < n; i++) 
         {
             OrderExpression expr = orderBys[i];
             Expression e = this.Visit(expr.Expression);
             if (alternate == null && e != expr.Expression) 
                 alternate = orderBys.Take(i).ToList();
             if (alternate != null) 
                 alternate.Add(new OrderExpression(expr.OrderType, e));
         }
         if (alternate != null) 
             return alternate.AsReadOnly();
     }
     return orderBys;
 }
开发者ID:jango2015,项目名称:MongoDB_Client_.Net,代码行数:19,代码来源:MongoExpressionVisitor.cs

示例4: VisitColumnDeclarations

 protected ReadOnlyCollection<ColumnDeclaration> VisitColumnDeclarations(
     ReadOnlyCollection<ColumnDeclaration> nodes)
 {
     List<ColumnDeclaration> alternate = null;
     for (Int32 i = 0, n = nodes.Count; i < n; i++)
     {
         ColumnDeclaration column = nodes[i];
         Expression e = Visit(column.Expression);
         if (alternate == null && e != column.Expression)
         {
             alternate = nodes.Take(i).ToList();
         }
         if (alternate != null)
         {
             alternate.Add(new ColumnDeclaration(column.Name, e));
         }
     }
     if (alternate != null)
     {
         return alternate.AsReadOnly();
     }
     return nodes;
 }
开发者ID:sprucemedia,项目名称:oinq,代码行数:23,代码来源:PigExpressionVisitor.cs

示例5: VisitOrderBy

 protected virtual ReadOnlyCollection<OrderExpression> VisitOrderBy(ReadOnlyCollection<OrderExpression> expressions)
 {
     if (expressions != null)
     {
         List<OrderExpression> alternate = null;
         for (int i = 0, n = expressions.Count; i < n; i++)
         {
             OrderExpression expr = expressions[i];
             Expression e = this.Visit(expr.Expression);
             if (alternate == null && e != expr.Expression)
             {
                 alternate = expressions.Take(i).ToList();
             }
             if (alternate != null)
             {
                 alternate.Add(new OrderExpression(expr.OrderType, e));
             }
         }
         if (alternate != null)
         {
             return alternate.AsReadOnly();
         }
     }
     return expressions;
 }
开发者ID:RyanDansie,项目名称:SubSonic-3.0,代码行数:25,代码来源:DbExpressionVisitor.cs

示例6: VisitColumnDeclarations

 protected virtual ReadOnlyCollection<ColumnDeclaration> VisitColumnDeclarations(ReadOnlyCollection<ColumnDeclaration> columns)
 {
     List<ColumnDeclaration> alternate = null;
     for (int i = 0, n = columns.Count; i < n; i++)
     {
         ColumnDeclaration column = columns[i];
         Expression e = this.Visit(column.Expression);
         if (alternate == null && e != column.Expression)
         {
             alternate = columns.Take(i).ToList();
         }
         if (alternate != null)
         {
             alternate.Add(new ColumnDeclaration(column.Name, e));
         }
     }
     if (alternate != null)
     {
         return alternate.AsReadOnly();
     }
     return columns;
 }
开发者ID:RyanDansie,项目名称:SubSonic-3.0,代码行数:22,代码来源:DbExpressionVisitor.cs

示例7: VisitVariableDeclarations

 protected virtual ReadOnlyCollection<DbVariableDeclaration> VisitVariableDeclarations(
     ReadOnlyCollection<DbVariableDeclaration> decls)
 {
     List<DbVariableDeclaration> alternate = null;
     for (int i = 0, n = decls.Count; i < n; i++)
     {
         DbVariableDeclaration decl = decls[i];
         Expression e = Visit(decl.Expression);
         if (alternate == null && e != decl.Expression)
             alternate = decls.Take(i).ToList();
         
         if (alternate != null)
             alternate.Add(new DbVariableDeclaration(decl.Name, decl.DbType, e));
     }
     if (alternate != null)
         return alternate.AsReadOnly();
     
     return decls;
 }
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:19,代码来源:DbExpressionVisitor.cs

示例8: VisitColumnAssignments

 protected virtual ReadOnlyCollection<DbColumnAssignment> VisitColumnAssignments(
     ReadOnlyCollection<DbColumnAssignment> assignments)
 {
     List<DbColumnAssignment> alternate = null;
     for (int i = 0, n = assignments.Count; i < n; i++)
     {
         DbColumnAssignment assignment = VisitColumnAssignment(assignments[i]);
         if (alternate == null && assignment != assignments[i])
             alternate = assignments.Take(i).ToList();
         
         if (alternate != null)
             alternate.Add(assignment);
     }
     if (alternate != null)
         return alternate.AsReadOnly();
     
     return assignments;
 }
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:18,代码来源:DbExpressionVisitor.cs

示例9: VisitFieldAssignments

 protected virtual ReadOnlyCollection<FieldAssignment> VisitFieldAssignments(ReadOnlyCollection<FieldAssignment> assignments)
 {
     List<FieldAssignment> alternate = null;
     for (int i = 0, n = assignments.Count; i < n; i++)
     {
         FieldAssignment assignment = this.VisitFieldAssignment(assignments[i]);
         if (alternate == null && assignment != assignments[i])
         {
             alternate = assignments.Take(i).ToList();
         }
         if (alternate != null)
         {
             alternate.Add(assignment);
         }
     }
     if (alternate != null)
     {
         return alternate.AsReadOnly();
     }
     return assignments;
 }
开发者ID:PaybackMan,项目名称:Cinder,代码行数:21,代码来源:DbExpressionVisitor.cs

示例10: VisitOrderBy

 protected ReadOnlyCollection<OrderByExpression> VisitOrderBy(ReadOnlyCollection<OrderByExpression> nodes)
 {
     if (nodes != null)
     {
         List<OrderByExpression> alternate = null;
         for (Int32 i = 0, n = nodes.Count; i < n; i++)
         {
             OrderByExpression expr = nodes[i];
             Expression e = Visit(expr.Expression);
             if (alternate == null && e != expr.Expression)
             {
                 alternate = nodes.Take(i).ToList();
             }
             if (alternate != null)
             {
                 alternate.Add(new OrderByExpression(e, expr.Direction));
             }
         }
         if (alternate != null)
         {
             return alternate.AsReadOnly();
         }
     }
     return nodes;
 }
开发者ID:sprucemedia,项目名称:oinq,代码行数:25,代码来源:PigExpressionVisitor.cs


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