本文整理汇总了C#中Mono.CSharp.AnonymousMethodStorey类的典型用法代码示例。如果您正苦于以下问题:C# AnonymousMethodStorey类的具体用法?C# AnonymousMethodStorey怎么用?C# AnonymousMethodStorey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnonymousMethodStorey类属于Mono.CSharp命名空间,在下文中一共展示了AnonymousMethodStorey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MutateHoistedGenericType
public override void MutateHoistedGenericType (AnonymousMethodStorey storey)
{
foreach (Argument a in arguments)
a.Expr.MutateHoistedGenericType (storey);
mg.MutateHoistedGenericType (storey);
}
示例2: MutateHoistedGenericType
public override void MutateHoistedGenericType (AnonymousMethodStorey storey)
{
expr.MutateHoistedGenericType (storey);
}
示例3: HoistedLocalVariable
public HoistedLocalVariable (AnonymousMethodStorey storey, LocalVariable local, string name)
: base (storey, name, local.Type)
{
}
示例4: HoistedVariable
protected HoistedVariable (AnonymousMethodStorey storey, Field field)
{
this.storey = storey;
this.field = field;
}
示例5: GetReferencedStoreyField
//
// Returns a field which holds referenced storey instance
//
Field GetReferencedStoreyField (AnonymousMethodStorey storey)
{
if (used_parent_storeys == null)
return null;
foreach (StoreyFieldPair sf in used_parent_storeys) {
if (sf.Storey == storey)
return sf.Field;
}
return null;
}
示例6: AddParentStoreyReference
public void AddParentStoreyReference (EmitContext ec, AnonymousMethodStorey storey)
{
CheckMembersDefined ();
if (used_parent_storeys == null)
used_parent_storeys = new List<StoreyFieldPair> ();
else if (used_parent_storeys.Exists (i => i.Storey == storey))
return;
TypeExpr type_expr = storey.CreateStoreyTypeExpression (ec);
Field f = AddCompilerGeneratedField ("<>f__ref$" + storey.ID, type_expr);
used_parent_storeys.Add (new StoreyFieldPair (storey, f));
}
示例7: AddCapturedThisField
public void AddCapturedThisField (EmitContext ec, AnonymousMethodStorey parent)
{
TypeExpr type_expr = new TypeExpression (ec.CurrentType, Location);
Field f = AddCompilerGeneratedField ("$this", type_expr);
hoisted_this = new HoistedThis (this, f);
initialize_hoisted_this = true;
hoisted_this_parent = parent;
}
示例8: ThisInitializer
public ThisInitializer (HoistedThis hoisted_this, AnonymousMethodStorey parent)
{
this.hoisted_this = hoisted_this;
this.parent = parent;
}
示例9: CreateAnonymousMethodStorey
//
// Creates anonymous method storey in current block
//
public AnonymousMethodStorey CreateAnonymousMethodStorey (ResolveContext ec)
{
//
// When referencing a variable in iterator storey from children anonymous method
//
if (Toplevel.am_storey is IteratorStorey) {
return Toplevel.am_storey;
}
//
// An iterator has only 1 storey block
//
if (ec.CurrentIterator != null)
return ec.CurrentIterator.Storey;
if (am_storey == null) {
MemberBase mc = ec.MemberContext as MemberBase;
GenericMethod gm = mc == null ? null : mc.GenericMethod;
//
// Creates anonymous method storey for this block
//
am_storey = new AnonymousMethodStorey (this, ec.CurrentMemberDefinition.Parent.PartialContainer, mc, gm, "AnonStorey");
}
return am_storey;
}
示例10: AnonymousMethodMethod
public AnonymousMethodMethod (TypeDefinition parent, AnonymousExpression am, AnonymousMethodStorey storey,
TypeExpr return_type,
Modifiers mod, MemberName name,
ParametersCompiled parameters)
: base (parent, return_type, mod | Modifiers.COMPILER_GENERATED,
name, parameters, null)
{
this.AnonymousMethod = am;
this.Storey = storey;
Parent.PartialContainer.Members.Add (this);
Block = new ToplevelBlock (am.block, parameters);
}
示例11: CreateAnonymousMethodStorey
//
// Creates anonymous method storey in current block
//
public AnonymousMethodStorey CreateAnonymousMethodStorey (ResolveContext ec)
{
//
// An iterator has only 1 storey block
//
if (ec.CurrentIterator != null)
return ec.CurrentIterator.Storey;
//
// When referencing a variable in iterator storey from children anonymous method
//
if (ParametersBlock.am_storey is IteratorStorey) {
return ParametersBlock.am_storey;
}
if (am_storey == null) {
MemberBase mc = ec.MemberContext as MemberBase;
//
// Creates anonymous method storey for this block
//
am_storey = new AnonymousMethodStorey (this, ec.CurrentMemberDefinition.Parent.PartialContainer, mc, ec.CurrentTypeParameters, "AnonStorey");
}
return am_storey;
}
示例12: StoreyFieldPair
public StoreyFieldPair (AnonymousMethodStorey storey, Field field)
{
this.Storey = storey;
this.Field = field;
}
示例13: HoistedLocalVariable
public HoistedLocalVariable (AnonymousMethodStorey scope, LocalInfo local, string name)
: base (scope, name, local.VariableType)
{
this.name = local.Name;
}
示例14: SetNestedStoryParent
public void SetNestedStoryParent (AnonymousMethodStorey parentStorey)
{
Parent = parentStorey;
spec.IsGeneric = false;
spec.DeclaringType = parentStorey.CurrentType;
MemberName.TypeParameters = null;
}
示例15: AnonymousMethodMethod
public AnonymousMethodMethod (DeclSpace parent, AnonymousExpression am, AnonymousMethodStorey storey,
GenericMethod generic, TypeExpr return_type,
Modifiers mod, string real_name, MemberName name,
ParametersCompiled parameters)
: base (parent, generic, return_type, mod | Modifiers.COMPILER_GENERATED,
name, parameters, null)
{
this.AnonymousMethod = am;
this.Storey = storey;
this.RealName = real_name;
Parent.PartialContainer.AddMethod (this);
Block = new ToplevelBlock (am.block, parameters);
}