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

◆ TryGetFirst< TSource >() [1/2]

static TSource System.Linq.Enumerable.TryGetFirst< TSource > ( this IEnumerable< TSource > source,
Func< TSource, bool > predicate,
out bool found )
inlinestaticprivate

Definition at line 4916 of file Enumerable.cs.

4917 {
4918 if (source == null)
4919 {
4920 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
4921 }
4922 if (predicate == null)
4923 {
4924 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.predicate);
4925 }
4926 foreach (TSource item in source)
4927 {
4928 if (predicate(item))
4929 {
4930 found = true;
4931 return item;
4932 }
4933 }
4934 found = false;
4935 return default(TSource);
4936 }

References System.item, System.Linq.predicate, System.Linq.source, and System.Linq.ThrowHelper.ThrowArgumentNullException().