private static object CallMethod(Symbols.Container BaseReference, string MethodName, object[] Arguments, string[] ArgumentNames, Type[] TypeArguments, bool[] CopyBack, BindingFlags InvocationFlags, bool ReportErrors, ref OverloadResolution.ResolutionFailure Failure)
 {
     Failure = OverloadResolution.ResolutionFailure.None;
     if ((ArgumentNames.Length > Arguments.Length) || ((CopyBack != null) && (CopyBack.Length != Arguments.Length)))
     {
         Failure = OverloadResolution.ResolutionFailure.InvalidArgument;
         if (ReportErrors)
         {
             throw new ArgumentException(Utils.GetResourceString("Argument_InvalidValue"));
         }
         return null;
     }
     if (Symbols.HasFlag(InvocationFlags, BindingFlags.SetProperty) && (Arguments.Length < 1))
     {
         Failure = OverloadResolution.ResolutionFailure.InvalidArgument;
         if (ReportErrors)
         {
             throw new ArgumentException(Utils.GetResourceString("Argument_InvalidValue"));
         }
         return null;
     }
     MemberInfo[] members = BaseReference.GetMembers(ref MethodName, ReportErrors);
     if ((members == null) || (members.Length == 0))
     {
         Failure = OverloadResolution.ResolutionFailure.MissingMember;
         if (ReportErrors)
         {
             members = BaseReference.GetMembers(ref MethodName, true);
         }
         return null;
     }
     Symbols.Method targetProcedure = ResolveCall(BaseReference, MethodName, members, Arguments, ArgumentNames, TypeArguments, InvocationFlags, ReportErrors, ref Failure);
     if (Failure == OverloadResolution.ResolutionFailure.None)
     {
         return BaseReference.InvokeMethod(targetProcedure, Arguments, CopyBack, InvocationFlags);
     }
     return null;
 }