Esempio n. 1
0
        public void NewParameterizedObject(CorFunction managedFunction, CorType[] argumentTypes, CorValue[] arguments)
        {
            ICorDebugType[] types       = null;
            int             typesLength = 0;

            ICorDebugValue[] values     = null;
            int            valuesLength = 0;
            ICorDebugEval2 eval2        = (ICorDebugEval2)m_eval;

            if (argumentTypes != null)
            {
                types = new ICorDebugType[argumentTypes.Length];
                for (int i = 0; i < argumentTypes.Length; i++)
                {
                    types[i] = argumentTypes[i].m_type;
                }
                typesLength = types.Length;
            }
            if (arguments != null)
            {
                values = new ICorDebugValue[arguments.Length];
                for (int i = 0; i < arguments.Length; i++)
                {
                    values[i] = arguments[i].m_val;
                }
                valuesLength = values.Length;
            }
            eval2.NewParameterizedObject(managedFunction.m_function, (uint)typesLength, types, (uint)valuesLength, values);
        }
Esempio n. 2
0
 /// <summary>
 /// Instantiates a new parameterized type object and calls the object's constructor method
 /// </summary>
 /// <param name="ctor">Constructor</param>
 /// <param name="typeArgs">Type args or null if none required</param>
 /// <param name="args">Constructor arguments</param>
 /// <returns></returns>
 public int NewParameterizedObject(CorFunction ctor, CorType[] typeArgs, CorValue[] args)
 {
     if (eval2 == null)
     {
         if (typeArgs == null || typeArgs.Length == 0)
         {
             return(NewObject(ctor, args));
         }
         return(-1);
     }
     return(eval2.NewParameterizedObject(ctor.RawObject, typeArgs == null ? 0 : typeArgs.Length, typeArgs.ToCorDebugArray(), args.Length, args.ToCorDebugArray()));
 }