public static string ToILNameString(this FullTypeName typeName)
        {
            string name;

            if (typeName.IsNested)
            {
                name = typeName.Name;
                int localTypeParameterCount = typeName.GetNestedTypeAdditionalTypeParameterCount(typeName.NestingLevel - 1);
                if (localTypeParameterCount > 0)
                {
                    name += "`" + localTypeParameterCount;
                }
                name = Disassembler.DisassemblerHelpers.Escape(name);
                return($"{typeName.GetDeclaringType().ToILNameString()}/{name}");
            }
            if (!string.IsNullOrEmpty(typeName.TopLevelTypeName.Namespace))
            {
                name = $"{typeName.TopLevelTypeName.Namespace}.{typeName.Name}";
                if (typeName.TypeParameterCount > 0)
                {
                    name += "`" + typeName.TypeParameterCount;
                }
            }
            else
            {
                name = typeName.Name;
                if (typeName.TypeParameterCount > 0)
                {
                    name += "`" + typeName.TypeParameterCount;
                }
            }
            return(Disassembler.DisassemblerHelpers.Escape(name));
        }
 public ITypeDefinitionModel this[FullTypeName fullTypeName] {
     get {
         ITypeDefinitionModel model = this[fullTypeName.TopLevelTypeName];
         for (int i = 0; i < fullTypeName.NestingLevel && model != null; i++)
         {
             string name = fullTypeName.GetNestedTypeName(i);
             int    atpc = fullTypeName.GetNestedTypeAdditionalTypeParameterCount(i);
             model = model.GetNestedType(name, atpc);
         }
         return(model);
     }
 }
        public NUnitTestClass GetTestClass(FullTypeName fullTypeName)
        {
            var testClass = (NUnitTestClass)base.GetTestClass(fullTypeName.TopLevelTypeName);
            int tpc       = fullTypeName.TopLevelTypeName.TypeParameterCount;

            for (int i = 0; i < fullTypeName.NestingLevel; i++)
            {
                if (testClass == null)
                {
                    break;
                }
                tpc      += fullTypeName.GetNestedTypeAdditionalTypeParameterCount(i);
                testClass = testClass.FindNestedTestClass(fullTypeName.GetNestedTypeName(i), tpc);
            }
            return(testClass);
        }
 /// <summary>
 /// Gets the type definition for the specified unresolved type.
 /// Returns null if the unresolved type does not belong to this assembly.
 /// </summary>
 public static ITypeDefinition GetTypeDefinition(this IAssembly assembly, FullTypeName fullTypeName)
 {
     if (assembly == null)
         throw new ArgumentNullException("assembly");
     TopLevelTypeName topLevelTypeName = fullTypeName.TopLevelTypeName;
     ITypeDefinition typeDef = assembly.GetTypeDefinition(topLevelTypeName);
     if (typeDef == null)
         return null;
     int typeParameterCount = topLevelTypeName.TypeParameterCount;
     for (int i = 0; i < fullTypeName.NestingLevel; i++) {
         string name = fullTypeName.GetNestedTypeName(i);
         typeParameterCount += fullTypeName.GetNestedTypeAdditionalTypeParameterCount(i);
         typeDef = FindNestedType(typeDef, name, typeParameterCount);
         if (typeDef == null)
             break;
     }
     return typeDef;
 }
		public NUnitTestClass GetTestClass(FullTypeName fullTypeName)
		{
			var testClass = (NUnitTestClass)base.GetTestClass(fullTypeName.TopLevelTypeName);
			int tpc = fullTypeName.TopLevelTypeName.TypeParameterCount;
			for (int i = 0; i < fullTypeName.NestingLevel; i++) {
				if (testClass == null)
					break;
				tpc += fullTypeName.GetNestedTypeAdditionalTypeParameterCount(i);
				testClass = testClass.FindNestedTestClass(fullTypeName.GetNestedTypeName(i), tpc);
			}
			return testClass;
		}