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


C# QueryOrderClause类代码示例

本文整理汇总了C#中QueryOrderClause的典型用法代码示例。如果您正苦于以下问题:C# QueryOrderClause类的具体用法?C# QueryOrderClause怎么用?C# QueryOrderClause使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: VisitQueryOrderClause

		public void VisitQueryOrderClause(QueryOrderClause queryOrderClause)
		{
			StartNode(queryOrderClause);
			WriteKeyword(QueryOrderClause.OrderbyKeywordRole);
			Space();
			WriteCommaSeparatedList(queryOrderClause.Orderings);
			EndNode(queryOrderClause);
		}
开发者ID:x-strong,项目名称:ILSpy,代码行数:8,代码来源:CSharpOutputVisitor.cs

示例2: Visit

			public override object Visit(Mono.CSharp.Linq.OrderByDescending orderByDescending)
			{
				currentQueryOrderClause = new QueryOrderClause();
				
				var ordering = new QueryOrdering();
				if (orderByDescending.Expr != null)
					ordering.AddChild((Expression)orderByDescending.Expr.Accept(this), Roles.Expression);
				var location = LocationsBag.GetLocations(orderByDescending);
				if (location != null) {
					ordering.Direction = QueryOrderingDirection.Descending;
					ordering.AddChild(new CSharpTokenNode(Convert(location [0]), QueryOrdering.DescendingKeywordRole), QueryOrdering.DescendingKeywordRole);
				}
				currentQueryOrderClause.AddChild(ordering, QueryOrderClause.OrderingRole);
				return currentQueryOrderClause;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:15,代码来源:CSharpParser.cs

示例3: VisitQueryOrderClause

		public virtual void VisitQueryOrderClause(QueryOrderClause queryOrderClause)
		{
			VisitChildren (queryOrderClause);
		}
开发者ID:modulexcite,项目名称:ICSharpCode.Decompiler-retired,代码行数:4,代码来源:DepthFirstAstVisitor.cs

示例4: Visit

			public override object Visit (Mono.CSharp.Linq.ThenByDescending thenByDescending)
			{
				var result = new QueryOrderClause ();
				
				var ordering = new QueryOrdering ();
				
				ordering.AddChild ((Expression)thenByDescending.Expr.Accept (this), QueryWhereClause.Roles.Expression);
				var location = LocationsBag.GetLocations (thenByDescending);
				if (location != null) {
					ordering.Direction = QueryOrderingDirection.Descending;
					ordering.AddChild (new CSharpTokenNode (Convert (location[0]), "ascending".Length), QueryWhereClause.Roles.Keyword);
				}
				result.AddChild (ordering, QueryOrderClause.OrderingRole);
				return result;
			}
开发者ID:N3X15,项目名称:ILSpy,代码行数:15,代码来源:CSharpParser.cs

示例5: VisitQueryOrderClause

 public virtual void VisitQueryOrderClause(QueryOrderClause queryOrderClause)
 {
     if (this.ThrowException)
     {
         throw (Exception)this.CreateException(queryOrderClause);
     }
 }
开发者ID:fabriciomurta,项目名称:BridgeUnified,代码行数:7,代码来源:Visitor.Exception.cs

示例6: DecompileQuery

        QueryExpression DecompileQuery(InvocationExpression invocation)
        {
            if (invocation == null)
                return null;
            MemberReferenceExpression mre = invocation.Target as MemberReferenceExpression;
            if (mre == null)
                return null;
            switch (mre.MemberName) {
                case "Select":
                    {
                        if (invocation.Arguments.Count != 1)
                            return null;
                        string parameterName;
                        Expression body;
                        if (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out body)) {
                            QueryExpression query = new QueryExpression();
                            query.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = mre.Target.Detach() });
                            query.Clauses.Add(new QuerySelectClause { Expression = body.Detach() });
                            return query;
                        }
                        return null;
                    }
                case "GroupBy":
                    {
                        if (invocation.Arguments.Count == 2) {
                            string parameterName1, parameterName2;
                            Expression keySelector, elementSelector;
                            if (MatchSimpleLambda(invocation.Arguments.ElementAt(0), out parameterName1, out keySelector)
                                && MatchSimpleLambda(invocation.Arguments.ElementAt(1), out parameterName2, out elementSelector)
                                && parameterName1 == parameterName2)
                            {
                                QueryExpression query = new QueryExpression();
                                query.Clauses.Add(new QueryFromClause { Identifier = parameterName1, Expression = mre.Target.Detach() });
                                query.Clauses.Add(new QueryGroupClause { Projection = elementSelector.Detach(), Key = keySelector.Detach() });
                                return query;
                            }
                        } else if (invocation.Arguments.Count == 1) {
                            string parameterName;
                            Expression keySelector;
                            if (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out keySelector)) {
                                QueryExpression query = new QueryExpression();
                                query.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = mre.Target.Detach() });
                                query.Clauses.Add(new QueryGroupClause { Projection = new IdentifierExpression(parameterName), Key = keySelector.Detach() });
                                return query;
                            }
                        }
                        return null;
                    }
                case "SelectMany":
                    {
                        if (invocation.Arguments.Count != 2)
                            return null;
                        string parameterName;
                        Expression collectionSelector;
                        if (!MatchSimpleLambda(invocation.Arguments.ElementAt(0), out parameterName, out collectionSelector))
                            return null;
                        LambdaExpression lambda = invocation.Arguments.ElementAt(1) as LambdaExpression;
                        if (lambda != null && lambda.Parameters.Count == 2 && lambda.Body is Expression) {
                            ParameterDeclaration p1 = lambda.Parameters.ElementAt(0);
                            ParameterDeclaration p2 = lambda.Parameters.ElementAt(1);
                            if (p1.Name == parameterName) {
                                QueryExpression query = new QueryExpression();
                                query.Clauses.Add(new QueryFromClause { Identifier = p1.Name, Expression = mre.Target.Detach() });
                                query.Clauses.Add(new QueryFromClause { Identifier = p2.Name, Expression = collectionSelector.Detach() });
                                query.Clauses.Add(new QuerySelectClause { Expression = ((Expression)lambda.Body).Detach() });
                                return query;
                            }
                        }
                        return null;
                    }
                case "Where":
                    {
                        if (invocation.Arguments.Count != 1)
                            return null;
                        string parameterName;
                        Expression body;
                        if (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out body)) {
                            QueryExpression query = new QueryExpression();
                            query.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = mre.Target.Detach() });
                            query.Clauses.Add(new QueryWhereClause { Condition = body.Detach() });
                            return query;
                        }
                        return null;
                    }
                case "OrderBy":
                case "OrderByDescending":
                case "ThenBy":
                case "ThenByDescending":
                    {
                        if (invocation.Arguments.Count != 1)
                            return null;
                        string parameterName;
                        Expression orderExpression;
                        if (MatchSimpleLambda(invocation.Arguments.Single(), out parameterName, out orderExpression)) {
                            if (ValidateThenByChain(invocation, parameterName)) {
                                QueryOrderClause orderClause = new QueryOrderClause();
                                InvocationExpression tmp = invocation;
                                while (mre.MemberName == "ThenBy" || mre.MemberName == "ThenByDescending") {
                                    // insert new ordering at beginning
                                    orderClause.Orderings.InsertAfter(
//.........这里部分代码省略.........
开发者ID:ropean,项目名称:Usable,代码行数:101,代码来源:IntroduceQueryExpressions.cs

示例7: Visit

			public override object Visit (Mono.CSharp.Linq.ThenByDescending thenByDescending)
			{
				var result = new QueryOrderClause ();
/*				result.OrderAscending = false;
				result.AddChild ((AstNode)thenByDescending.Expr.Accept (this), QueryWhereClause.Roles.Expression);
				var location = LocationsBag.GetLocations (thenByDescending);
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[0]), "descending".Length), QueryWhereClause.Roles.Keyword);*/
				return result;
			}
开发者ID:sandyarmstrong,项目名称:monodevelop,代码行数:10,代码来源:CSharpParser.cs

示例8: VisitQueryOrderClause

 public StringBuilder VisitQueryOrderClause(QueryOrderClause queryOrderClause, int data)
 {
     throw new SLSharpException("SL# does not understand LINQ.");
 }
开发者ID:hach-que,项目名称:SLSharp,代码行数:4,代码来源:VisitorBase.Illegal.cs

示例9: VisitQueryOrderClause

 public override void VisitQueryOrderClause(QueryOrderClause queryOrderClause)
 {
     base.VisitQueryOrderClause(queryOrderClause);
     indexData.HasOrder = true;
 }
开发者ID:j2jensen,项目名称:ravendb,代码行数:5,代码来源:IndexVisitor.cs

示例10: VisitQueryOrderClause

		public override void VisitQueryOrderClause(QueryOrderClause queryOrderClause)
		{
			FixClauseIndentation(queryOrderClause, queryOrderClause.OrderbyToken);
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:4,代码来源:FormattingVisitor_Query.cs

示例11: VisitQueryOrderClause

		public virtual void VisitQueryOrderClause(QueryOrderClause queryOrderClause)
		{
			DebugExpression(queryOrderClause);
			StartNode(queryOrderClause);
			WriteKeyword(QueryOrderClause.OrderbyKeywordRole);
			Space();
			WriteCommaSeparatedList(queryOrderClause.Orderings);
			EndNode(queryOrderClause);
		}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:9,代码来源:CSharpOutputVisitor.cs

示例12: VisitQueryOrderClause

 public void VisitQueryOrderClause(QueryOrderClause queryOrderClause)
 {
     throw new NotImplementedException();
 }
开发者ID:CompilerKit,项目名称:CodeWalk,代码行数:4,代码来源:AstCsToJson.cs

示例13: VisitQueryOrderClause

 public void VisitQueryOrderClause(QueryOrderClause node)
 {
     NotSupported(node);
 }
开发者ID:evanw,项目名称:minisharp,代码行数:4,代码来源:Lower.cs


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