AjScript.ObjectUtilities.SetIndexedValue C# (CSharp) Method

SetIndexedValue() public static method

public static SetIndexedValue ( System array, object indexes, object value ) : void
array System
indexes object
value object
return void
        public static void SetIndexedValue(System.Array array, object[] indexes, object value)
        {
            switch (indexes.Length)
            {
                case 1:
                    array.SetValue(value, (int)indexes[0]);
                    return;
                case 2:
                    array.SetValue(value, (int)indexes[0], (int)indexes[1]);
                    return;
                case 3:
                    array.SetValue(value, (int)indexes[0], (int)indexes[1], (int)indexes[2]);
                    return;
            }

            throw new InvalidOperationException("Invalid number of subindices");
        }

Same methods

ObjectUtilities::SetIndexedValue ( object obj, object indexes, object value ) : void