public MethodGenerator DefineMethod(string name, MethodAttributes attributes, Type returnType, params Type[] parameterTypes) { var method = _typeBuilder.DefineMethod(name, attributes, returnType, parameterTypes); MethodGenerator g = new MethodGenerator(method, method.GetILGenerator()); return(g); }
/// <summary> /// 定义一个公开的构造函数 /// </summary> /// <param name="parameterTypes"></param> /// <returns></returns> public MethodGenerator DefineConstructor(params Type[] parameterTypes) { var ctor = _typeBuilder.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, parameterTypes); MethodGenerator g = new MethodGenerator(ctor, ctor.GetILGenerator()); return(g); }
public UsingScope(MethodGenerator owner) : base(owner) { }
public LabeledScope(MethodGenerator owner) : base(owner) { EndLabel = owner._writer.DefineLabel(); }
public Scope(MethodGenerator owner, int evalStackOverflow) : this(owner) { _evalStackOverflow = evalStackOverflow; }
public Scope(MethodGenerator owner) { _owner = owner; }
public Expression(MethodGenerator owner, IVariable variable) { _owner = owner; _variable = variable; _members = new List <MemberInfo>(); }
public Parameter(MethodGenerator owner, IVariable innerParameter) { _owner = owner; _innerParameter = innerParameter; }
public LocalDefinition(MethodGenerator owner, IVariable innerVariable) { _owner = owner; _innerVariable = innerVariable; InScope = true; }
public ForEachScope(MethodGenerator owner, Type elementType) : base(owner) { ElementType = elementType; }