本文整理汇总了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;
}
示例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;
}
示例3: CreateUnaryOperatorStatement
private object CreateUnaryOperatorStatement(string op, Expression expression)
{
this.Append(op);
expression.AcceptVisitor(this, null);
return null;
}
示例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);
}
示例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));
}
}
示例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;
}
示例7: Evaluate
public bool Evaluate(Expression condition)
{
return condition.AcceptVisitor(this, null) == SymbolDefined;
}