Full repo available at https://bitbucket.org/createdbyx/codefarts.utilities-extension-methods-only
/// <summary>
/// Gets the depth of the three dimensional sequence.
/// </summary>
/// <typeparam name="T">The type of the array.</typeparam>
/// <param name="array">The array whose value is to be retrieves.</param>
/// <param name="width">The width of the three dimensional sequence.</param>
/// <param name="height">The height of the three dimensional sequence.</param>
/// <returns>Returns the depth of the three dimensional sequence.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// width or height is less then 1.
/// </exception>
public static int Get3DDepth<T>(this T[] array, int width, int height)
{
if (width < 1)
{
throw new ArgumentOutOfRangeException("width");
}
if (height < 1)
{
throw new ArgumentOutOfRangeException("height");
}
return array.Length / (width * height);
}