Пример #1
0
        public static string BuildSigName(this IType type)
        {
            //TODO: support IGenericInstance
            string k = type.CSharpKeyword();

            return(string.IsNullOrEmpty(k) ? ToDisplayName(type.FullName, true) : k);
        }
Пример #2
0
        public static string GetName(this IType type, TypeNameKind kind)
        {
            switch (kind)
            {
            case TypeNameKind.DisplayName:
                return(type.DisplayName);

            case TypeNameKind.FullName:
                return(type.FullName);

            case TypeNameKind.Key:
                return(type.Key);

            case TypeNameKind.Name:
                return(type.Name);

            case TypeNameKind.NestedName:
                return(type.NestedName);

            case TypeNameKind.SigName:
                return(type.SigName);

            case TypeNameKind.CSharpKeyword:
                return(type.CSharpKeyword());
            }
            return(type.FullName);
        }
Пример #3
0
        public static string BuildDisplayName(this IType type)
        {
            string keyword = type.CSharpKeyword();

            if (!string.IsNullOrEmpty(keyword))
            {
                return(keyword);
            }
            var fullName = ToDisplayName(type.FullName);

            return(type.IsGeneric()
                                ? fullName + type.GenericParameters.BuildString(TypeNameKind.DisplayName, false)
                                : fullName);
        }