Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateInstance() [6/6]

static Array System.Array.CreateInstance ( Type elementType,
params long[] lengths )
inlinestatic

Definition at line 926 of file Array.cs.

927 {
928 if (lengths == null)
929 {
930 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.lengths);
931 }
932 if (lengths.Length == 0)
933 {
934 ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_NeedAtLeast1Rank);
935 }
936 int[] array = new int[lengths.Length];
937 for (int i = 0; i < lengths.Length; i++)
938 {
939 long num = lengths[i];
940 int num2 = (int)num;
941 if (num != num2)
942 {
943 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.len, ExceptionResource.ArgumentOutOfRange_HugeArrayNotSupported);
944 }
945 array[i] = num2;
946 }
948 }

References System.array, System.Reflection.CreateInstance, System.elementType, System.lengths, System.ThrowHelper.ThrowArgumentException(), System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowArgumentOutOfRangeException().