Example #1
0
        private static void AppendType(TypeReference type, StringBuilder name, bool fq_name, bool top_level)
        {
            TypeReference declaringType = type.DeclaringType;

            if (declaringType != null)
            {
                TypeParser.AppendType(declaringType, name, false, top_level);
                name.Append('+');
            }
            string @namespace = type.Namespace;

            if (!string.IsNullOrEmpty(@namespace))
            {
                TypeParser.AppendNamePart(@namespace, name);
                name.Append('.');
            }
            TypeParser.AppendNamePart(type.GetElementType().Name, name);
            if (!fq_name)
            {
                return;
            }
            if (type.IsTypeSpecification())
            {
                TypeParser.AppendTypeSpecification((TypeSpecification)type, name);
            }
            if (TypeParser.RequiresFullyQualifiedName(type, top_level))
            {
                name.Append(", ");
                name.Append(TypeParser.GetScopeFullName(type));
            }
        }