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


C# Expression.AcceptVisitor方法代码示例

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


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

示例1: Resolve

		public ResolveResult Resolve (Expression expression)
		{
			ResolveResult result = expression.AcceptVisitor (this, null) as ResolveResult;
			if (result == null)
				result = CreateResult ("");
			return result;
		}
开发者ID:Ein,项目名称:monodevelop,代码行数:7,代码来源:ResolveVisitor.cs

示例2: Resolve

		public ResolveResult Resolve(Expression expression)
		{
			ResolveResult rr;
			if (!cachedResults.TryGetValue(expression, out rr)) {
				rr = (ResolveResult)expression.AcceptVisitor(this, null);
				if (rr != null)
					rr.Freeze();
				cachedResults[expression] = rr;
			}
			return rr;
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:11,代码来源:ResolveVisitor.cs

示例3: CreateUnaryOperatorStatement

 private object CreateUnaryOperatorStatement(string op, Expression expression)
 {
     this.Append(op);
     expression.AcceptVisitor(this, null);
     return null;
 }
开发者ID:L3tum,项目名称:BesiegeScriptingMod,代码行数:6,代码来源:NRefactoryToPythonConverter.cs

示例4: CreateSwitchCaseCondition

 private void CreateSwitchCaseCondition(string prefix, Expression switchExpression, CaseLabel label)
 {
     this.Append(prefix);
     switchExpression.AcceptVisitor(this, null);
     this.Append(" == ");
     label.Label.AcceptVisitor(this, null);
 }
开发者ID:L3tum,项目名称:BesiegeScriptingMod,代码行数:7,代码来源:NRefactoryToPythonConverter.cs

示例5: AddEventHandler

        void AddEventHandler(Expression eventExpr, Expression handler, object data)
        {
            methodReference = true;
            CodeExpression methodInvoker = (CodeExpression)handler.AcceptVisitor(this, data);
            methodReference = false;
            if (!(methodInvoker is CodeObjectCreateExpression)) {
                // we need to create an event handler here
                methodInvoker = new CodeObjectCreateExpression(new CodeTypeReference("System.EventHandler"), methodInvoker);
            }

            if (eventExpr is IdentifierExpression) {
                AddStmt(new CodeAttachEventStatement(new CodeEventReferenceExpression(new CodeThisReferenceExpression(), ((IdentifierExpression)eventExpr).Identifier),
                                                     methodInvoker));
            } else {
                MemberReferenceExpression fr = (MemberReferenceExpression)eventExpr;
                AddStmt(new CodeAttachEventStatement(new CodeEventReferenceExpression((CodeExpression)fr.TargetObject.AcceptVisitor(this, data), fr.MemberName),
                                                     methodInvoker));
            }
        }
开发者ID:almazik,项目名称:ILSpy,代码行数:19,代码来源:CodeDOMOutputVisitor.cs

示例6: CreateRemoveHandlerStatement

		/// <summary>
		/// Creates a remove statement (i.e. button.Click -= ButtonClick)
		/// </summary>
		object CreateRemoveHandlerStatement(Expression eventExpression, Expression eventHandlerExpression)
		{
			CreateEventReferenceExpression(eventExpression);
			Append(".remove(On");
			eventHandlerExpression.AcceptVisitor(this, null);
			Append(")");
			return null;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:11,代码来源:NRefactoryToRubyConverter.cs

示例7: Evaluate

 public bool Evaluate(Expression condition)
 {
     return condition.AcceptVisitor(this, null) == SymbolDefined;
 }
开发者ID:pusp,项目名称:o2platform,代码行数:4,代码来源:ConditionalCompilation.cs


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