Mono Class Library: System.Array Overview | Members

System.Array.SetValue Method

Sets the value of the element at the specified position in the current three-dimensional instance. [Edit]

public void SetValue (object value, int index1, int index2, int index3)

Parameters

value
A object that contains the new value for the specified element. [Edit]
index1
A int that contains the first-dimension index of the element in the current instance to set. [Edit]
index2
A int that contains the second-dimension index of the element in the current instance to set. [Edit]
index3
A int that contains the third-dimension index of the element in the current instance to set. [Edit]

Exceptions

TypeReason
ArgumentExceptionThe current instance does not have exactly three dimensions. [Edit]
IndexOutOfRangeExceptionAt least one of index1, index2, or index3 is outside the range of valid indices for the corresponding dimension of the current instance. [Edit]
InvalidCastExceptionvalue is not assignment-compatible with the element type of the current instance. [Edit]

Remarks

Note:

For more information regarding valid conversions that will be performed by this method, see Convert.

Use the Array.GetLowerBound(int) and Array.GetUpperBound(int) methods to determine whether any of the indices are out of bounds.

[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0