public bool SetArrayItem(object baseObject, string arrayName, int index, object value)
{
SetError();
Array ar = baseObject.GetType().InvokeMember(arrayName,
BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty | BindingFlags.GetField,
null, baseObject, null) as Array;
// *** Null assignments are not allowed because we may have to create the array
// *** and a type is required for that. If necessary create an empty instance
if (ar == null)
return false;
ar.SetValue(value, index);
return true;
}