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

◆ GetGuid()

static Guid System.Diagnostics.Tracing.EventSource.GetGuid ( Type eventSourceType)
inlinestaticinherited

Definition at line 330 of file EventSource.cs.

331 {
332 if (eventSourceType == null)
333 {
334 throw new ArgumentNullException("eventSourceType");
335 }
336 EventSourceAttribute eventSourceAttribute = (EventSourceAttribute)GetCustomAttributeHelper(eventSourceType, typeof(EventSourceAttribute));
337 string name = eventSourceType.Name;
338 if (eventSourceAttribute != null)
339 {
340 if (eventSourceAttribute.Guid != null && Guid.TryParse(eventSourceAttribute.Guid, out var result))
341 {
342 return result;
343 }
344 if (eventSourceAttribute.Name != null)
345 {
347 }
348 }
349 if (name == null)
350 {
351 throw new ArgumentException(SR.Argument_InvalidTypeName, "eventSourceType");
352 }
353 return GenerateGuidFromName(name.ToUpperInvariant());
354 }
static Guid GenerateGuidFromName(string name)
static Attribute GetCustomAttributeHelper(MemberInfo member, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.PublicProperties)] Type attributeType, EventManifestOptions flags=EventManifestOptions.None)
static bool TryParse([NotNullWhen(true)] string? input, out Guid result)
Definition Guid.cs:206

References System.SR.Argument_InvalidTypeName, System.Diagnostics.Tracing.EventSource.GenerateGuidFromName(), System.Diagnostics.Tracing.EventSource.GetCustomAttributeHelper(), and System.Guid.TryParse().

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