本文整理汇总了C#中IdentifierExpression.ReplaceWith方法的典型用法代码示例。如果您正苦于以下问题:C# IdentifierExpression.ReplaceWith方法的具体用法?C# IdentifierExpression.ReplaceWith怎么用?C# IdentifierExpression.ReplaceWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdentifierExpression
的用法示例。
在下文中一共展示了IdentifierExpression.ReplaceWith方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitIdentifierExpression
public override void VisitIdentifierExpression(IdentifierExpression identifierExpression)
{
base.VisitIdentifierExpression(identifierExpression);
switch (identifierExpression.Identifier)
{
case "__cx":
case "__cy":
case "__cz":
case "__cwidth":
case "__cheight":
case "__cdepth":
identifierExpression.ReplaceWith(this.m_CInitializers[identifierExpression.Identifier].Clone());
break;
}
}
示例2: VisitIdentifierExpression
public override void VisitIdentifierExpression(IdentifierExpression identifierExpression)
{
if (this.m_Mappings.ContainsKey(identifierExpression.Identifier))
{
identifierExpression.ReplaceWith(
new IdentifierExpression(
this.m_Mappings[identifierExpression.Identifier]));
}
base.VisitIdentifierExpression(identifierExpression);
}
示例3: VisitIdentifierExpression
public override void VisitIdentifierExpression (IdentifierExpression identifierExpression)
{
base.VisitIdentifierExpression (identifierExpression);
Expression change;
if (Subs.TryGetValue (identifierExpression.Identifier, out change)) {
identifierExpression.ReplaceWith (change.Clone ());
}
}
示例4: VisitIdentifierExpression
public void VisitIdentifierExpression(IdentifierExpression node)
{
VisitChildren(node);
// Make member references explicit
var result = resolver.Resolve(node) as MemberResolveResult;
if (result != null && result.Member.SymbolKind == SymbolKind.Field) {
if (((IField)result.Member).IsStatic) {
node.ReplaceWith(FullReference(result.Member));
} else {
node.ReplaceWith(new MemberReferenceExpression(new ThisReferenceExpression(), node.Identifier));
}
}
}