private void SetDefValues(int methodNumber, int paramCount, IValue[] arguments) { for (int i = 0; i < paramCount; i++) { if (arguments[i] == null) { NativeApiProxy.GetParamDefValue(_object, methodNumber, i, variant => arguments[i] = NativeApiVariant.GetValue(variant) ); } } }
public MethodInfo GetMethodInfo(int methodNumber) { if (methodNumber < 0) { throw new RuntimeException("Метод не найден"); } var name = String.Empty; var alias = String.Empty; NativeApiProxy.GetMethodName(_object, methodNumber, 0, str => name = NativeApiProxy.Str(str) ); NativeApiProxy.GetMethodName(_object, methodNumber, 1, str => alias = NativeApiProxy.Str(str) ); var paramCount = NativeApiProxy.GetNParams(_object, methodNumber); var paramArray = new ParameterDefinition[paramCount]; for (int i = 0; i < paramCount; i++) { NativeApiProxy.GetParamDefValue(_object, methodNumber, i, variant => { if (NativeApiVariant.NotEmpty(variant)) { paramArray[i].HasDefaultValue = true; paramArray[i].DefaultValueIndex = ParameterDefinition.UNDEFINED_VALUE_INDEX; } }); } return(new MethodInfo { Name = name, Alias = alias, IsFunction = NativeApiProxy.HasRetVal(_object, methodNumber), IsDeprecated = false, IsExport = false, ThrowOnUseDeprecated = false, Params = paramArray, }); }