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

◆ GetTypeNoLock()

Type System.Reflection.Emit.ModuleBuilder.GetTypeNoLock ( string className,
bool throwOnError,
bool ignoreCase )
inlineprivate

Definition at line 481 of file ModuleBuilder.cs.

482 {
484 if (type != null)
485 {
486 return type;
487 }
488 string text = null;
489 string text2 = null;
490 int num = 0;
491 while (num <= className.Length)
492 {
493 int num2 = className.AsSpan(num).IndexOfAny('[', '*', '&');
494 if (num2 == -1)
495 {
496 text = className;
497 text2 = null;
498 break;
499 }
500 num2 += num;
501 int num3 = 0;
502 int num4 = num2 - 1;
503 while (num4 >= 0 && className[num4] == '\\')
504 {
505 num3++;
506 num4--;
507 }
508 if (num3 % 2 == 1)
509 {
510 num = num2 + 1;
511 continue;
512 }
513 text = className.Substring(0, num2);
514 text2 = className.Substring(num2);
515 break;
516 }
517 if (text == null)
518 {
519 text = className;
520 text2 = null;
521 }
522 text = text.Replace("\\\\", "\\").Replace("\\[", "[").Replace("\\*", "*")
523 .Replace("\\&", "&");
524 if (text2 != null)
525 {
527 }
528 if (type == null)
529 {
531 if (type == null && Assembly is AssemblyBuilder)
532 {
535 for (int i = 0; i < count; i++)
536 {
537 if (!(type == null))
538 {
539 break;
540 }
542 type = moduleBuilder.FindTypeBuilderWithName(text, ignoreCase);
543 }
544 }
545 if (type == null)
546 {
547 return null;
548 }
549 }
550 if (text2 == null)
551 {
552 return type;
553 }
554 return GetType(text2, type);
555 }
readonly List< ModuleBuilder > _moduleBuilderList
InternalModuleBuilder InternalModule
ModuleBuilder(AssemblyBuilder assemblyBuilder, InternalModuleBuilder internalModuleBuilder)
static Type GetType(string strFormat, Type baseType)
virtual Type FindTypeBuilderWithName(string strTypeName, bool ignoreCase)
static void GetType(QCallModule module, string className, bool throwOnError, bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive)

References System.Reflection.Emit.AssemblyBuilder._assemblyData, System.Reflection.Emit.AssemblyBuilderData._moduleBuilderList, System.Reflection.Emit.ModuleBuilder.ContainingAssemblyBuilder, System.count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Reflection.Emit.ModuleBuilder.FindTypeBuilderWithName(), System.Reflection.RuntimeModule.GetType(), System.Reflection.Emit.ModuleBuilder.GetType(), System.Reflection.Emit.ModuleBuilder.InternalModule, System.text, and System.type.

Referenced by System.Reflection.Emit.ModuleBuilder.GetType().