• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# QueryJoinClause类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: VisitQueryJoinClause

		public void VisitQueryJoinClause(QueryJoinClause queryJoinClause)
		{
			StartNode(queryJoinClause);
			WriteKeyword(QueryJoinClause.JoinKeywordRole);
			queryJoinClause.Type.AcceptVisitor(this);
			Space();
			WriteIdentifier(queryJoinClause.JoinIdentifier, QueryJoinClause.JoinIdentifierRole);
			Space();
			WriteKeyword(QueryJoinClause.InKeywordRole);
			Space();
			queryJoinClause.InExpression.AcceptVisitor(this);
			Space();
			WriteKeyword(QueryJoinClause.OnKeywordRole);
			Space();
			queryJoinClause.OnExpression.AcceptVisitor(this);
			Space();
			WriteKeyword(QueryJoinClause.EqualsKeywordRole);
			Space();
			queryJoinClause.EqualsExpression.AcceptVisitor(this);
			if (queryJoinClause.IsGroupJoin) {
				Space();
				WriteKeyword(QueryJoinClause.IntoKeywordRole);
				WriteIdentifier(queryJoinClause.IntoIdentifier, QueryJoinClause.IntoIdentifierRole);
			}
			EndNode(queryJoinClause);
		}
开发者ID:x-strong,项目名称:ILSpy,代码行数:26,代码来源:CSharpOutputVisitor.cs


示例2: Visit

			public override object Visit(Mono.CSharp.Linq.GroupJoin groupJoin)
			{
				var result = new QueryJoinClause();
				var location = LocationsBag.GetLocations(groupJoin);
				result.AddChild(new CSharpTokenNode(Convert(groupJoin.Location), QueryJoinClause.JoinKeywordRole), QueryJoinClause.JoinKeywordRole);
				
				// mcs seems to have swapped IntoVariable with JoinVariable, so we'll swap it back here
				result.AddChild(Identifier.Create(groupJoin.IntoVariable.Name, Convert(groupJoin.IntoVariable.Location)), QueryJoinClause.JoinIdentifierRole);
				
				if (location != null)
					result.AddChild(new CSharpTokenNode(Convert(location [0]), QueryJoinClause.InKeywordRole), QueryJoinClause.InKeywordRole);

				if (groupJoin.Expr != null)
					result.AddChild((Expression)groupJoin.Expr.Accept(this), QueryJoinClause.InExpressionRole);

				if (location != null && location.Count > 1)
					result.AddChild(new CSharpTokenNode(Convert(location [1]), QueryJoinClause.OnKeywordRole), QueryJoinClause.OnKeywordRole);

				var outer = groupJoin.OuterSelector.Statements.FirstOrDefault() as ContextualReturn;
				if (outer != null)
					result.AddChild((Expression)outer.Expr.Accept(this), QueryJoinClause.OnExpressionRole);
				

				if (location != null && location.Count > 2)
					result.AddChild(new CSharpTokenNode(Convert(location [2]), QueryJoinClause.EqualsKeywordRole), QueryJoinClause.EqualsKeywordRole);
				var inner = groupJoin.InnerSelector.Statements.FirstOrDefault() as ContextualReturn;
				if (inner != null)
					result.AddChild((Expression)inner.Expr.Accept(this), QueryJoinClause.EqualsExpressionRole);
				
				if (location != null && location.Count > 3)
					result.AddChild(new CSharpTokenNode(Convert(location [3]), QueryJoinClause.IntoKeywordRole), QueryJoinClause.IntoKeywordRole);
				
				result.AddChild(Identifier.Create(groupJoin.JoinVariable.Name, Convert(groupJoin.JoinVariable.Location)), QueryJoinClause.IntoIdentifierRole);
				return result;
			}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:35,代码来源:CSharpParser.cs


示例3: VisitQueryJoinClause

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


示例4: DecompileQuery


//.........这里部分代码省略.........
                                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(
                                        null, new QueryOrdering {
                                            Expression = orderExpression.Detach(),
                                            Direction = (mre.MemberName == "ThenBy" ? QueryOrderingDirection.None : QueryOrderingDirection.Descending)
                                        });

                                    tmp = (InvocationExpression)mre.Target;
                                    mre = (MemberReferenceExpression)tmp.Target;
                                    MatchSimpleLambda(tmp.Arguments.Single(), out parameterName, out orderExpression);
                                }
                                // insert new ordering at beginning
                                orderClause.Orderings.InsertAfter(
                                    null, new QueryOrdering {
                                        Expression = orderExpression.Detach(),
                                        Direction = (mre.MemberName == "OrderBy" ? QueryOrderingDirection.None : QueryOrderingDirection.Descending)
                                    });

                                QueryExpression query = new QueryExpression();
                                query.Clauses.Add(new QueryFromClause { Identifier = parameterName, Expression = mre.Target.Detach() });
                                query.Clauses.Add(orderClause);
                                return query;
                            }
                        }
                        return null;
                    }
                case "Join":
                case "GroupJoin":
                    {
                        if (invocation.Arguments.Count != 4)
                            return null;
                        Expression source1 = mre.Target;
                        Expression source2 = invocation.Arguments.ElementAt(0);
                        string elementName1, elementName2;
                        Expression key1, key2;
                        if (!MatchSimpleLambda(invocation.Arguments.ElementAt(1), out elementName1, out key1))
                            return null;
                        if (!MatchSimpleLambda(invocation.Arguments.ElementAt(2), out elementName2, out key2))
                            return null;
                        LambdaExpression lambda = invocation.Arguments.ElementAt(3) 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 == elementName1 && (p2.Name == elementName2 || mre.MemberName == "GroupJoin")) {
                                QueryExpression query = new QueryExpression();
                                query.Clauses.Add(new QueryFromClause { Identifier = elementName1, Expression = source1.Detach() });
                                QueryJoinClause joinClause = new QueryJoinClause();
                                joinClause.JoinIdentifier = elementName2;    // join elementName2
                                joinClause.InExpression = source2.Detach();  // in source2
                                joinClause.OnExpression = key1.Detach();     // on key1
                                joinClause.EqualsExpression = key2.Detach(); // equals key2
                                if (mre.MemberName == "GroupJoin") {
                                    joinClause.IntoIdentifier = p2.Name; // into p2.Name
                                }
                                query.Clauses.Add(joinClause);
                                query.Clauses.Add(new QuerySelectClause { Expression = ((Expression)lambda.Body).Detach() });
                                return query;
                            }
                        }
                        return null;
                    }
                default:
                    return null;
            }
        }
开发者ID:ropean,项目名称:Usable,代码行数:101,代码来源:IntroduceQueryExpressions.cs


示例5: Visit

			public override object Visit (Mono.CSharp.Linq.GroupJoin join)
			{
				var result = new QueryJoinClause ();
				var location = LocationsBag.GetLocations (join);
				result.AddChild (new CSharpTokenNode (Convert (join.Location), "join".Length), QueryJoinClause.JoinKeywordRole);
				
				result.AddChild (Identifier.Create (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier);
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[0]), "in".Length), QueryJoinClause.InKeywordRole);
				
				result.AddChild ((Expression)join.Expr.Accept (this), QueryJoinClause.Roles.Expression);
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[1]), "on".Length), QueryJoinClause.OnKeywordRole);
				
				// TODO: on expression
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[2]), "equals".Length), QueryJoinClause.EqualsKeywordRole);
				// TODO: equals expression
				
				if (location != null)
					result.AddChild (new CSharpTokenNode (Convert (location[3]), "into".Length), QueryJoinClause.IntoKeywordRole);
				
				result.AddChild (Identifier.Create (join.JoinVariable.Name, Convert (join.JoinVariable.Location)), Identifier.Roles.Identifier);
				return result;
			}
开发者ID:aleksandersumowski,项目名称:monodevelop,代码行数:28,代码来源:CSharpParser.cs


示例6: VisitQueryJoinClause

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


示例7: VisitQueryJoinClause

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


示例8: VisitQueryJoinClause

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


示例9: VisitQueryJoinClause

		public virtual void VisitQueryJoinClause(QueryJoinClause queryJoinClause)
		{
			DebugExpression(queryJoinClause);
			StartNode(queryJoinClause);
			WriteKeyword(QueryJoinClause.JoinKeywordRole);
			queryJoinClause.Type.AcceptVisitor(this);
			Space();
			WriteIdentifier(queryJoinClause.JoinIdentifierToken, CSharpMetadataTextColorProvider.Instance.GetColor(queryJoinClause.JoinIdentifierToken.Annotation<object>()));
			Space();
			WriteKeyword(QueryJoinClause.InKeywordRole);
			Space();
			queryJoinClause.InExpression.AcceptVisitor(this);
			Space();
			WriteKeyword(QueryJoinClause.OnKeywordRole);
			Space();
			queryJoinClause.OnExpression.AcceptVisitor(this);
			Space();
			WriteKeyword(QueryJoinClause.EqualsKeywordRole);
			Space();
			queryJoinClause.EqualsExpression.AcceptVisitor(this);
			if (queryJoinClause.IsGroupJoin) {
				Space();
				WriteKeyword(QueryJoinClause.IntoKeywordRole);
				WriteIdentifier(queryJoinClause.IntoIdentifierToken, CSharpMetadataTextColorProvider.Instance.GetColor(queryJoinClause.IntoIdentifierToken.Annotation<object>()));
			}
			EndNode(queryJoinClause);
		}
开发者ID:0xd4d,项目名称:NRefactory,代码行数:27,代码来源:CSharpOutputVisitor.cs


示例10: VisitQueryJoinClause

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


示例11: VisitQueryJoinClause

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# QueryKind类代码示例发布时间:2022-05-24
下一篇:
C# QueryInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap