コード例 #1
0
        public static object CallByName(object Instance, string MethodName, CallType UseCallType, params object[] Arguments)
        {
            switch (UseCallType)
            {
            case CallType.Method:
                return(NewLateBinding.LateCall(Instance, null, MethodName, Arguments, null, null, null, false));

            case CallType.Get:
                return(NewLateBinding.LateGet(Instance, null, MethodName, Arguments, null, null, null));

            case CallType.Let:
            case CallType.Set:
            {
                IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);
                if (instance == null)
                {
                    NewLateBinding.LateSet(Instance, null, MethodName, Arguments, null, null, false, false, UseCallType);
                    break;
                }
                IDOBinder.IDOSet(instance, MethodName, null, Arguments);
                break;
            }

            default:
                throw new ArgumentException(Utils.GetResourceString("Argument_InvalidValue1", new string[] { "CallType" }));
            }
            return(null);
        }
コード例 #2
0
        public static object LateGet(object Instance, Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, Type[] TypeArguments, bool[] CopyBack)
        {
            Symbols.Container container;
            if (Arguments == null)
            {
                Arguments = Symbols.NoArguments;
            }
            if (ArgumentNames == null)
            {
                ArgumentNames = Symbols.NoArgumentNames;
            }
            if (TypeArguments == null)
            {
                TypeArguments = Symbols.NoTypeArguments;
            }
            if (Type != null)
            {
                container = new Symbols.Container(Type);
            }
            else
            {
                container = new Symbols.Container(Instance);
            }
            if (container.IsCOMObject)
            {
                return(LateBinding.LateGet(Instance, Type, MemberName, Arguments, ArgumentNames, CopyBack));
            }
            IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);

            if ((instance != null) && (TypeArguments == Symbols.NoTypeArguments))
            {
                return(IDOBinder.IDOGet(instance, MemberName, Arguments, ArgumentNames, CopyBack));
            }
            return(ObjectLateGet(Instance, Type, MemberName, Arguments, ArgumentNames, TypeArguments, CopyBack));
        }
コード例 #3
0
        private static object InternalLateInvokeDefault(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors, bool[] CopyBack)
        {
            IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);

            if (instance != null)
            {
                return(IDOBinder.IDOInvokeDefault(instance, Arguments, ArgumentNames, ReportErrors, CopyBack));
            }
            return(ObjectLateInvokeDefault(Instance, Arguments, ArgumentNames, ReportErrors, CopyBack));
        }
コード例 #4
0
        public static void LateSetComplex(object Instance, Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, Type[] TypeArguments, bool OptimisticSet, bool RValueBase)
        {
            IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);

            if ((instance != null) && (TypeArguments == null))
            {
                IDOBinder.IDOSetComplex(instance, MemberName, Arguments, ArgumentNames, OptimisticSet, RValueBase);
            }
            else
            {
                ObjectLateSetComplex(Instance, Type, MemberName, Arguments, ArgumentNames, TypeArguments, OptimisticSet, RValueBase);
            }
        }
コード例 #5
0
        public static void LateSet(object Instance, Type Type, string MemberName, object[] Arguments, string[] ArgumentNames, Type[] TypeArguments)
        {
            IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);

            if ((instance != null) && (TypeArguments == null))
            {
                IDOBinder.IDOSet(instance, MemberName, ArgumentNames, Arguments);
            }
            else
            {
                ObjectLateSet(Instance, Type, MemberName, Arguments, ArgumentNames, TypeArguments);
            }
        }
コード例 #6
0
        public static void LateIndexSetComplex(object Instance, object[] Arguments, string[] ArgumentNames, bool OptimisticSet, bool RValueBase)
        {
            IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);

            if (instance != null)
            {
                IDOBinder.IDOIndexSetComplex(instance, Arguments, ArgumentNames, OptimisticSet, RValueBase);
            }
            else
            {
                ObjectLateIndexSetComplex(Instance, Arguments, ArgumentNames, OptimisticSet, RValueBase);
            }
        }
コード例 #7
0
        public static void LateIndexSet(object Instance, object[] Arguments, string[] ArgumentNames)
        {
            IDynamicMetaObjectProvider instance = IDOUtils.TryCastToIDMOP(Instance);

            if (instance != null)
            {
                IDOBinder.IDOIndexSet(instance, Arguments, ArgumentNames);
            }
            else
            {
                ObjectLateIndexSet(Instance, Arguments, ArgumentNames);
            }
        }
コード例 #8
0
 public static object LateGetInvokeDefault(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors)
 {
     if ((IDOUtils.TryCastToIDMOP(Instance) == null) && ((Arguments == null) || (Arguments.Length <= 0)))
     {
         return(Instance);
     }
     return(InternalLateInvokeDefault(Instance, Arguments, ArgumentNames, ReportErrors, IDOBinder.GetCopyBack()));
 }
コード例 #9
0
 public static object LateCallInvokeDefault(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors)
 {
     return(InternalLateInvokeDefault(Instance, Arguments, ArgumentNames, ReportErrors, IDOBinder.GetCopyBack()));
 }
コード例 #10
0
 public static object FallbackInvokeDefault1(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors)
 {
     return(IDOBinder.IDOFallbackInvokeDefault((IDynamicMetaObjectProvider)Instance, Arguments, ArgumentNames, ReportErrors, IDOBinder.GetCopyBack()));
 }
コード例 #11
0
 public static object FallbackGet(object Instance, string MemberName, object[] Arguments, string[] ArgumentNames)
 {
     return(ObjectLateGet(Instance, null, MemberName, Arguments, ArgumentNames, Symbols.NoTypeArguments, IDOBinder.GetCopyBack()));
 }
コード例 #12
0
 public static object FallbackCall(object Instance, string MemberName, object[] Arguments, string[] ArgumentNames, bool IgnoreReturn)
 {
     return(ObjectLateCall(Instance, null, MemberName, Arguments, ArgumentNames, Symbols.NoTypeArguments, IDOBinder.GetCopyBack(), IgnoreReturn));
 }