You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// check if we still miss parameters compared to metadata which may include optional parameters.
273
-
// if the rpc-call didn't supply a value for an optional parameter, we should be assinging the default value of it.
274
-
if(parameters.Length<metaDataParamCount&&metadata.defaultValues.Length>0)// rpc call didn't set values for all optional parameters, so we need to assign the default values for them.
275
-
{
276
-
varparamIndex=parameters.Length;// the index we should start storing default values of optional parameters.
277
-
varmissingParamsCount=metaDataParamCount-parameters.Length;// the amount of optional parameters without a value set by rpc-call.
278
-
Array.Resize(refparameters,parameters.Length+missingParamsCount);// resize the array to include all optional parameters.
279
-
280
-
// we need to add in reverse order as parameters can appear after all required parameters.
281
-
// as some of the optional parameters could already have assigned their values in rpc-call,
282
-
// by starting from the end we can make sure we only add the required default values.
283
-
for(intk=missingParamsCount;k>0;k--)
284
-
{
285
-
varoptionalParamIndex=k-1;// the index of the optional parameter we will be currently setting a default value.
286
-
parameters[paramIndex]=metadata.defaultValues[optionalParamIndex].Value;// set the default value for the optional parameter that rpc-call didn't set a value for.
287
-
paramIndex++;
288
-
paramCount++;// we need to increase the paramCount by one each time we add default-value for an optional parameter that rpc-call didn't set a value for.
289
-
}
290
-
}
269
+
}
270
+
271
+
// Optional Parameter support
272
+
// check if we still miss parameters compared to metadata which may include optional parameters.
273
+
// if the rpc-call didn't supply a value for an optional parameter, we should be assinging the default value of it.
274
+
if(parameters.Length<metaDataParamCount&&metadata.defaultValues.Length>0)// rpc call didn't set values for all optional parameters, so we need to assign the default values for them.
275
+
{
276
+
varsuppliedParamsCount=parameters.Length;// the index we should start storing default values of optional parameters.
277
+
varmissingParamsCount=metaDataParamCount-parameters.Length;// the amount of optional parameters without a value set by rpc-call.
278
+
Array.Resize(refparameters,parameters.Length+missingParamsCount);// resize the array to include all optional parameters.
279
+
280
+
for(intparamIndex=parameters.Length-1,defaultIndex=metadata.defaultValues.Length-1;// fill missing parameters from the back
281
+
paramIndex>=suppliedParamsCount&&defaultIndex>=0;// to don't overwrite supplied ones.
0 commit comments