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

◆ GetNullableContext()

NullabilityState System.Reflection.NullabilityInfoContext.GetNullableContext ( MemberInfo memberInfo)
inlineprivate

Definition at line 24 of file NullabilityInfoContext.cs.

25 {
26 while (memberInfo != null)
27 {
29 {
30 return value;
31 }
32 foreach (CustomAttributeData customAttributesDatum in memberInfo.GetCustomAttributesData())
33 {
34 if (customAttributesDatum.AttributeType.Name == "NullableContextAttribute" && customAttributesDatum.AttributeType.Namespace == "System.Runtime.CompilerServices" && customAttributesDatum.ConstructorArguments.Count == 1)
35 {
36 value = TranslateByte(customAttributesDatum.ConstructorArguments[0].Value);
38 return value;
39 }
40 }
41 memberInfo = memberInfo.DeclaringType;
42 }
43 return NullabilityState.Unknown;
44 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void Add(TKey key, TValue value)
static NullabilityState TranslateByte(object value)
readonly Dictionary< MemberInfo, NullabilityState > _context

References System.Reflection.NullabilityInfoContext._context, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Reflection.NullabilityInfoContext.TranslateByte(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Reflection.NullabilityInfoContext.CheckGenericParameters(), and System.Reflection.NullabilityInfoContext.GetNullabilityInfo().