예제 #1
0
 private static object InternalLateIndexGet(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors, ref OverloadResolution.ResolutionFailure Failure, bool[] CopyBack)
 {
     Failure = OverloadResolution.ResolutionFailure.None;
     if (Arguments == null)
     {
         Arguments = Symbols.NoArguments;
     }
     if (ArgumentNames == null)
     {
         ArgumentNames = Symbols.NoArgumentNames;
     }
     Symbols.Container baseReference = new Symbols.Container(Instance);
     if (baseReference.IsCOMObject)
     {
         return(LateBinding.LateIndexGet(Instance, Arguments, ArgumentNames));
     }
     if (!baseReference.IsArray)
     {
         return(CallMethod(baseReference, "", Arguments, ArgumentNames, Symbols.NoTypeArguments, CopyBack, BindingFlags.GetProperty | BindingFlags.InvokeMethod, ReportErrors, ref Failure));
     }
     if (ArgumentNames.Length > 0)
     {
         Failure = OverloadResolution.ResolutionFailure.InvalidArgument;
         if (ReportErrors)
         {
             throw new ArgumentException(Utils.GetResourceString("Argument_InvalidNamedArgs"));
         }
         return(null);
     }
     ResetCopyback(CopyBack);
     return(baseReference.GetArrayValue(Arguments));
 }
예제 #2
0
 internal static object InternalLateIndexGet(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors, ref OverloadResolution.ResolutionFailure Failure)
 {
     Failure = OverloadResolution.ResolutionFailure.None;
     if (Arguments == null)
     {
         Arguments = Symbols.NoArguments;
     }
     if (ArgumentNames == null)
     {
         ArgumentNames = Symbols.NoArgumentNames;
     }
     Symbols.Container baseReference = new Symbols.Container(Instance);
     if (baseReference.IsCOMObject)
     {
         throw new InvalidOperationException("Never expected to see a COM object in Telesto");
     }
     if (!baseReference.IsArray)
     {
         return(CallMethod(baseReference, "", Arguments, ArgumentNames, Symbols.NoTypeArguments, null, BindingFlags.GetProperty | BindingFlags.InvokeMethod, ReportErrors, ref Failure));
     }
     if (ArgumentNames.Length <= 0)
     {
         return(baseReference.GetArrayValue(Arguments));
     }
     Failure = OverloadResolution.ResolutionFailure.InvalidArgument;
     if (ReportErrors)
     {
         throw new ArgumentException(Utils.GetResourceString("Argument_InvalidNamedArgs"));
     }
     return(null);
 }
 private static object InternalLateIndexGet(object Instance, object[] Arguments, string[] ArgumentNames, bool ReportErrors, ref OverloadResolution.ResolutionFailure Failure, bool[] CopyBack)
 {
     Failure = OverloadResolution.ResolutionFailure.None;
     if (Arguments == null)
     {
         Arguments = Symbols.NoArguments;
     }
     if (ArgumentNames == null)
     {
         ArgumentNames = Symbols.NoArgumentNames;
     }
     Symbols.Container baseReference = new Symbols.Container(Instance);
     if (baseReference.IsCOMObject)
     {
         return LateBinding.LateIndexGet(Instance, Arguments, ArgumentNames);
     }
     if (!baseReference.IsArray)
     {
         return CallMethod(baseReference, "", Arguments, ArgumentNames, Symbols.NoTypeArguments, CopyBack, BindingFlags.GetProperty | BindingFlags.InvokeMethod, ReportErrors, ref Failure);
     }
     if (ArgumentNames.Length > 0)
     {
         Failure = OverloadResolution.ResolutionFailure.InvalidArgument;
         if (ReportErrors)
         {
             throw new ArgumentException(Utils.GetResourceString("Argument_InvalidNamedArgs"));
         }
         return null;
     }
     ResetCopyback(CopyBack);
     return baseReference.GetArrayValue(Arguments);
 }