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

◆ CreateInstance() [1/6]

static unsafe Array System.Array.CreateInstance ( Type elementType,
int length )
inlinestatic

Definition at line 473 of file Array.cs.

474 {
475 if ((object)elementType == null)
476 {
477 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.elementType);
478 }
479 if (length < 0)
480 {
481 ThrowHelper.ThrowLengthArgumentOutOfRange_ArgumentOutOfRange_NeedNonNegNum();
482 }
483 RuntimeType runtimeType = elementType.UnderlyingSystemType as RuntimeType;
484 if (runtimeType == null)
485 {
486 ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_MustBeType, ExceptionArgument.elementType);
487 }
488 return InternalCreate((void*)runtimeType.TypeHandle.Value, 1, &length, null);
489 }
static unsafe Array InternalCreate(void *elementType, int rank, int *pLengths, int *pLowerBounds)

References System.elementType, System.Array.InternalCreate(), System.length, System.ThrowHelper.ThrowArgumentException(), System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowLengthArgumentOutOfRange_ArgumentOutOfRange_NeedNonNegNum().

Referenced by System.Xml.Schema.XmlBaseConverter.XmlBaseConverter(), System.Xml.Serialization.ReflectionXmlSerializationReader.AddItemInArrayMember(), System.Collections.Specialized.NameObjectCollectionBase.BaseGetAllValues(), System.DefaultBinder.BindToMethod(), System.Reflection.CustomAttribute.CreateAttributeArrayHelper(), System.Attribute.CreateAttributeArrayHelper(), System.Xml.Serialization.XmlSerializationReader.EnsureArrayIndex(), System.RuntimeType.RuntimeTypeCache.GetEmptyArray(), System.RuntimeType.GetEnumValues(), System.Runtime.CompilerServices.RuntimeHelpers.GetSubArray< T >(), System.Data.DataTable.NewRowArray(), System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseArray(), System.Xml.Serialization.XmlSerializationReader.ReadArray(), System.Runtime.Serialization.SurrogateDataContract.ReadXmlValue(), System.Linq.Expressions.Interpreter.NewArrayBoundsInstruction.Run(), System.Linq.Expressions.Interpreter.NewArrayInitInstruction.Run(), System.Linq.Expressions.Interpreter.NewArrayInstruction.Run(), System.Xml.Serialization.ReflectionXmlSerializationReader.SetCollectionObjectWithCollectionMember(), System.Xml.Serialization.XmlSerializationReader.ShrinkArray(), System.Collections.ArrayList.IListWrapper.ToArray(), System.Collections.ArrayList.Range.ToArray(), System.Collections.ArrayList.ToArray(), System.Xml.Serialization.CodeIdentifiers.ToArray(), System.Xml.Serialization.NameTable.ToArray(), System.RuntimeType.WrapArgsForInvokeCall(), and System.Xml.Serialization.ReflectionXmlSerializationReader.WriteAttribute().