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); }
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); } }