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

◆ ElementAt< TSource >() [2/2]

static TSource System.Linq.Enumerable.ElementAt< TSource > ( this IEnumerable< TSource > source,
int index )
inlinestatic

Definition at line 4613 of file Enumerable.cs.

4614 {
4615 if (source == null)
4616 {
4617 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
4618 }
4620 {
4621 bool found;
4622 TSource result = partition.TryGetElementAt(index, out found);
4623 if (found)
4624 {
4625 return result;
4626 }
4627 }
4628 else
4629 {
4631 {
4632 return list[index];
4633 }
4634 if (TryGetElement<TSource>(source, index, out var element))
4635 {
4636 return element;
4637 }
4638 }
4639 ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.index);
4640 return default(TSource);
4641 }

References System.Linq.index, System.list, System.Linq.source, System.Linq.ThrowHelper.ThrowArgumentNullException(), and System.Linq.ThrowHelper.ThrowArgumentOutOfRangeException().