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

◆ GetMetadataLengthForTypeV2()

static bool System.Diagnostics.Tracing.EventParameterInfo.GetMetadataLengthForTypeV2 ( TraceLoggingTypeInfo typeInfo,
out uint size )
inlinestaticprivate

Definition at line 330 of file EventParameterInfo.cs.

331 {
332 size = 0u;
333 if (typeInfo == null)
334 {
335 return false;
336 }
337 if (typeInfo is InvokeTypeInfo invokeTypeInfo)
338 {
339 size += 8u;
340 PropertyAnalysis[] properties = invokeTypeInfo.properties;
341 if (properties != null)
342 {
343 PropertyAnalysis[] array = properties;
344 foreach (PropertyAnalysis propertyAnalysis in array)
345 {
346 if (!GetMetadataLengthForNamedTypeV2(propertyAnalysis.name, propertyAnalysis.typeInfo, out var size2))
347 {
348 return false;
349 }
350 size += size2;
351 }
352 }
353 }
354 else if (typeInfo is EnumerableTypeInfo enumerableTypeInfo)
355 {
356 size += 4u;
357 if (!GetMetadataLengthForTypeV2(enumerableTypeInfo.ElementInfo, out var size3))
358 {
359 return false;
360 }
361 size += size3;
362 }
363 else if (typeInfo is ScalarArrayTypeInfo scalarArrayTypeInfo)
364 {
365 if (!scalarArrayTypeInfo.DataType.HasElementType || !GetTypeInfoFromType(scalarArrayTypeInfo.DataType.GetElementType(), out var typeInfo2))
366 {
367 return false;
368 }
369 size += 4u;
370 if (!GetMetadataLengthForTypeV2(typeInfo2, out var size4))
371 {
372 return false;
373 }
374 size += size4;
375 }
376 else
377 {
378 size += 4u;
379 }
380 return true;
381 }
static bool GetMetadataLengthForTypeV2(TraceLoggingTypeInfo typeInfo, out uint size)
static bool GetTypeInfoFromType(Type type, out TraceLoggingTypeInfo typeInfo)
static bool GetMetadataLengthForNamedTypeV2(string name, TraceLoggingTypeInfo typeInfo, out uint size)

References System.array, System.Diagnostics.Tracing.EventParameterInfo.GetMetadataLengthForNamedTypeV2(), System.Diagnostics.Tracing.EventParameterInfo.GetMetadataLengthForTypeV2(), System.Diagnostics.Tracing.EventParameterInfo.GetTypeInfoFromType(), System.Diagnostics.Tracing.PropertyAnalysis.name, and System.Diagnostics.Tracing.PropertyAnalysis.typeInfo.

Referenced by System.Diagnostics.Tracing.EventParameterInfo.GetMetadataLengthForNamedTypeV2(), and System.Diagnostics.Tracing.EventParameterInfo.GetMetadataLengthForTypeV2().