本文整理汇总了C#中Mono.CSharp.FieldExpr.Resolve方法的典型用法代码示例。如果您正苦于以下问题:C# FieldExpr.Resolve方法的具体用法?C# FieldExpr.Resolve怎么用?C# FieldExpr.Resolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.CSharp.FieldExpr
的用法示例。
在下文中一共展示了FieldExpr.Resolve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFieldExpression
//
// Creates field access expression for hoisted variable
//
protected FieldExpr GetFieldExpression (EmitContext ec)
{
if (ec.CurrentAnonymousMethod == null || ec.CurrentAnonymousMethod.Storey == null) {
if (cached_outer_access != null)
return cached_outer_access;
//
// When setting top-level hoisted variable in generic storey
// change storey generic types to method generic types (VAR -> MVAR)
//
cached_outer_access = storey.MemberName.IsGeneric ?
new FieldExpr (field.FieldBuilder, storey.Instance.Type, field.Location) :
new FieldExpr (field.FieldBuilder, field.Location);
cached_outer_access.InstanceExpression = storey.GetStoreyInstanceExpression (ec);
cached_outer_access.Resolve (ec);
return cached_outer_access;
}
FieldExpr inner_access;
if (cached_inner_access != null) {
inner_access = (FieldExpr) cached_inner_access [ec.CurrentAnonymousMethod];
} else {
inner_access = null;
cached_inner_access = new Hashtable (4);
}
if (inner_access == null) {
inner_access = new FieldExpr (field.FieldBuilder, field.Location);
inner_access.InstanceExpression = storey.GetStoreyInstanceExpression (ec);
inner_access.Resolve (ec);
cached_inner_access.Add (ec.CurrentAnonymousMethod, inner_access);
}
return inner_access;
}