コード例 #1
0
        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);
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 public UsingScope(MethodGenerator owner)
     : base(owner)
 {
 }
コード例 #4
0
 public LabeledScope(MethodGenerator owner)
     : base(owner)
 {
     EndLabel = owner._writer.DefineLabel();
 }
コード例 #5
0
 public Scope(MethodGenerator owner, int evalStackOverflow)
     : this(owner)
 {
     _evalStackOverflow = evalStackOverflow;
 }
コード例 #6
0
 public Scope(MethodGenerator owner)
 {
     _owner = owner;
 }
コード例 #7
0
 public Expression(MethodGenerator owner, IVariable variable)
 {
     _owner    = owner;
     _variable = variable;
     _members  = new List <MemberInfo>();
 }
コード例 #8
0
 public Parameter(MethodGenerator owner, IVariable innerParameter)
 {
     _owner          = owner;
     _innerParameter = innerParameter;
 }
コード例 #9
0
 public LocalDefinition(MethodGenerator owner, IVariable innerVariable)
 {
     _owner         = owner;
     _innerVariable = innerVariable;
     InScope        = true;
 }
コード例 #10
0
 public ForEachScope(MethodGenerator owner, Type elementType)
     : base(owner)
 {
     ElementType = elementType;
 }