コード例 #1
0
        public virtual string GetInterfaceName(Type type)
        {
            var n = NamingHelper.GetNonGenericTypeName(type);

            if (type.IsInterface)
            {
                n = NamingHelper.RemovePrefix(InterfacePrefix, n, LetterCasing.Upper);
                n = InterfacePrefix + NamingHelper.FirstLetter(FirstLetterCasing, n);
            }
            else
            {
                n = InterfacePrefixForClasses + NamingHelper.FirstLetter(FirstLetterCasing, n);
            }
            return(n);
        }
コード例 #2
0
        public virtual string GetInterfaceName(DeclarationBase source)
        {
            var name = source.Name;

            if (source is InterfaceType)
            {
                if (name.StartsWith("I") && name.Substring(1, 1) == name.Substring(1, 1).ToUpper())
                {
                    //interface name like "IMyInterface" -> "IObservableMyInterface"
                    name = "IObservable" + name.Substring(1);
                }
                else if (name.StartsWith("i"))
                {
                    //class as interface "iMyclass" -> "iObservableMyClass"
                    name = "iObservable" + NamingHelper.FirstLetter(LetterCasing.Upper, name.Substring(1));
                }
            }
            else
            {
                name = "iObservable" + NamingHelper.FirstLetter(LetterCasing.Upper, name);
            }
            return(name);
        }
コード例 #3
0
 public override string GetClassName(Type type)
 {
     return(NamingHelper.FirstLetter(FirstLetterCasing, NamingHelper.GetNonGenericTypeName(type)));
 }
コード例 #4
0
 public virtual string GetEnumMemberName(FieldInfo value)
 {
     return(NamingHelper.FirstLetter(FirstLetterCasing, value.Name));
 }
コード例 #5
0
 public virtual string GetEnumName(Type type)
 {
     return(NamingHelper.FirstLetter(FirstLetterCasing, type.Name));
 }
コード例 #6
0
 public virtual string GetPropertyName(PropertyInfo property)
 {
     return(NamingHelper.FirstLetter(FirstLetterCasing, property.Name));
 }