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


C# Expression.Equals方法代码示例

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


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

示例1: GroupBy

		public GroupBy (QueryBlock block, Expression elementSelector, QueryBlock elementBlock, Expression keySelector, Location loc)
			: base (block, keySelector, loc)
		{
			//
			// Optimizes clauses like `group A by A'
			//
			if (!elementSelector.Equals (keySelector)) {
				this.element_selector = elementSelector;
				this.element_block = elementBlock;
			}
		}
开发者ID:alisci01,项目名称:mono,代码行数:11,代码来源:linq.cs

示例2: AreTheSame

 private bool AreTheSame(Expression first, Expression second)
 {
     //those expressions' properties should point to the same objects, however the expressions themselves might not be the same object
     if (first.CodeNodeType != second.CodeNodeType)
     {
         return false;
     }
     return first.Equals(second);
 }
开发者ID:juancarlosbaezpozos,项目名称:JustDecompileEngine,代码行数:9,代码来源:OperatorStep.cs

示例3: CompareTargets

		protected bool CompareTargets(Expression assignee, Expression target)
		{
			if (target == null || assignee == null || target.CodeNodeType != assignee.CodeNodeType)
			{
				return false;
			}

			switch (target.CodeNodeType)
			{
				case CodeNodeType.PropertyReferenceExpression:
					var propertyReference = target as PropertyReferenceExpression;
					var assigneeProperty = assignee as PropertyReferenceExpression;

					if (!propertyReference.Property.Equals(assigneeProperty.Property))
					{
						return false;
					}

					return CompareTargets(assigneeProperty.Target, propertyReference.Target);

				default:
					return target.Equals(assignee);
			}
		}
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:24,代码来源:BaseInitialisationPattern.cs

示例4: CheckEqualAssign

		bool CheckEqualAssign (Expression t)
		{
			if (source is Assign) {
				Assign a = (Assign) source;
				if (t.Equals (a.Target))
					return true;
				return a is SimpleAssign && ((SimpleAssign) a).CheckEqualAssign (t);
			}
			return t.Equals (source);
		}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:10,代码来源:assign.cs

示例5: AreEqual

 /// <summary>
 /// Decides if two expressions have the same semantics.
 /// </summary>
 /// <param name="first"> The first expression.</param>
 /// <param name="second">The second expression.</param>
 /// <returns>Returns true if the expressions have the same semantics.</returns>
 private bool AreEqual(Expression first, Expression second)
 {
     return first.Equals(second);
 }
开发者ID:Feng2012,项目名称:JustDecompileEngine,代码行数:10,代码来源:TotalGotoEliminationStep.cs


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