示例#1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ObjectCallingOn">Object calling on</param>
 /// <param name="Method">Method builder</param>
 /// <param name="MethodCalling">Method calling on the object</param>
 /// <param name="Parameters">List of parameters to send in</param>
 public Call(IMethodBuilder Method, VariableBase ObjectCallingOn, ConstructorInfo MethodCalling, object[] Parameters)
     : base()
 {
     this.ObjectCallingOn    = ObjectCallingOn;
     this.ConstructorCalling = MethodCalling;
     this.MethodCallingFrom  = Method;
     if (Parameters != null)
     {
         this.Parameters = new VariableBase[Parameters.Length];
         for (int x = 0; x < Parameters.Length; ++x)
         {
             if (Parameters[x] is VariableBase)
             {
                 this.Parameters[x] = (VariableBase)Parameters[x];
             }
             else
             {
                 this.Parameters[x] = MethodCallingFrom.CreateConstant(Parameters[x]);
             }
         }
     }
     else
     {
         this.Parameters = null;
     }
 }
示例#2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ObjectCallingOn">Object calling on</param>
 /// <param name="Method">Method builder</param>
 /// <param name="MethodCalling">Method calling on the object</param>
 /// <param name="Parameters">List of parameters to send in</param>
 public Call(IMethodBuilder Method, VariableBase ObjectCallingOn, MethodInfo MethodCalling, object[] Parameters)
     : base()
 {
     this.ObjectCallingOn   = ObjectCallingOn;
     this.MethodCalling     = MethodCalling;
     this.MethodCallingFrom = Method;
     if (MethodCalling.ReturnType != null && MethodCalling.ReturnType != typeof(void))
     {
         Result = Method.CreateLocal(MethodCalling.Name + "ReturnObject" + Utilities.Reflection.Emit.BaseClasses.MethodBase.ObjectCounter.ToString(CultureInfo.InvariantCulture), MethodCalling.ReturnType);
     }
     if (Parameters != null)
     {
         this.Parameters = new VariableBase[Parameters.Length];
         for (int x = 0; x < Parameters.Length; ++x)
         {
             if (Parameters[x] is VariableBase)
             {
                 this.Parameters[x] = (VariableBase)Parameters[x];
             }
             else
             {
                 this.Parameters[x] = MethodCallingFrom.CreateConstant(Parameters[x]);
             }
         }
     }
     else
     {
         this.Parameters = null;
     }
 }