Exemple #1
0
        /// <summary>Executes a method on an object, or sets or returns a property on an object.</summary>
        /// <param name="Instance">Required. <see langword="Object" />. A pointer to the object exposing the property or method.</param>
        /// <param name="MethodName">Required. <see langword="String" />. A string expression containing the name of the property or method on the object.</param>
        /// <param name="UseCallType">Required. An enumeration member of type <see cref="T:Ported.VisualBasic.CallType" /> representing the type of procedure being called. The value of <see langword="CallType" /> can be <see langword="Method" />, <see langword="Get" />, or <see langword="Set" />.</param>
        /// <param name="Arguments">Optional. <see langword="ParamArray" />. A parameter array containing the arguments to be passed to the property or method being called.</param>
        /// <returns>Executes a method on an object, or sets or returns a property on an object.</returns>
        public static object CallByName(object Instance, string MethodName, CallType UseCallType, params object[] Arguments)
        {
            switch (UseCallType)
            {
            case CallType.Method:
                return(NewLateBinding.LateCall(Instance, (Type)null, MethodName, Arguments, (string[])null, (Type[])null, (bool[])null, false));

            case CallType.Get:
                return(NewLateBinding.LateGet(Instance, (Type)null, MethodName, Arguments, (string[])null, (Type[])null, (bool[])null));

            case CallType.Let:
            case CallType.Set:
                NewLateBinding.LateSet(Instance, (Type)null, MethodName, Arguments, (string[])null, (Type[])null, false, false, UseCallType);
                return((object)null);

            default:
                throw new ArgumentException(Utils.GetResourceString("Argument_InvalidValue1", new string[1]
                {
                    "CallType"
                }));
            }
        }
Exemple #2
0
 public static void LateSet(object Instance, Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, Type[] TypeArguments)
 {
     NewLateBinding.LateSet(Instance, Type, MemberName, Arguments, ArgumentNames, TypeArguments, false, false, (CallType)0);
 }
Exemple #3
0
 public static void LateSetComplex(object Instance, Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, Type[] TypeArguments, bool OptimisticSet, bool RValueBase)
 {
     NewLateBinding.LateSet(Instance, Type, MemberName, Arguments, ArgumentNames, TypeArguments, OptimisticSet, RValueBase, (CallType)0);
 }