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

◆ AddProviderEnumKind()

static void System.Diagnostics.Tracing.EventSource.AddProviderEnumKind ( ManifestBuilder manifest,
FieldInfo staticField,
string providerEnumKind )
inlinestaticprivateinherited

Definition at line 2426 of file EventSource.cs.

2427 {
2428 bool reflectionOnly = staticField.Module.Assembly.ReflectionOnly;
2429 Type fieldType = staticField.FieldType;
2430 if ((!reflectionOnly && fieldType == typeof(EventOpcode)) || AttributeTypeNamesMatch(fieldType, typeof(EventOpcode)))
2431 {
2432 if (!(providerEnumKind != "Opcodes"))
2433 {
2434 int value = (int)staticField.GetRawConstantValue();
2435 manifest.AddOpcode(staticField.Name, value);
2436 return;
2437 }
2438 }
2440 {
2441 if (!(providerEnumKind != "Tasks"))
2442 {
2443 int value2 = (int)staticField.GetRawConstantValue();
2444 manifest.AddTask(staticField.Name, value2);
2445 return;
2446 }
2447 }
2448 else
2449 {
2450 if ((reflectionOnly || !(fieldType == typeof(EventKeywords))) && !AttributeTypeNamesMatch(fieldType, typeof(EventKeywords)))
2451 {
2452 return;
2453 }
2454 if (!(providerEnumKind != "Keywords"))
2455 {
2456 ulong value3 = (ulong)(long)staticField.GetRawConstantValue();
2457 manifest.AddKeyword(staticField.Name, value3);
2458 return;
2459 }
2460 }
2461 manifest.ManifestError(SR.Format(SR.EventSource_EnumKindMismatch, staticField.Name, staticField.FieldType.Name, providerEnumKind));
2462 }
static bool AttributeTypeNamesMatch(Type attributeType, Type reflectedAttributeType)

References System.Diagnostics.Tracing.EventSource.AttributeTypeNamesMatch(), System.SR.EventSource_EnumKindMismatch, System.SR.Format(), and System.value.

Referenced by System.Diagnostics.Tracing.EventSource.CreateManifestAndDescriptors().