示例#1
0
        public static string GetAccessLevel(CsAccessLevel accesLevel)
        {
            switch (accesLevel)
            {
            case CsAccessLevel.Public:
                return("public");

            case CsAccessLevel.Protected:
                return("protected");

            case CsAccessLevel.Internal:
                return("internal");

            case CsAccessLevel.ProtectedInternal:
                return("protected internal");

            case CsAccessLevel.Private:
                return("private");

            case CsAccessLevel.PrivateProtected:
                return("private protected");

            case CsAccessLevel.Default:
                return(string.Empty);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
示例#2
0
        private string GetAccessLevel(string keyWord, CsAccessLevel accessLevel)
        {
            switch (accessLevel)
            {
            case CsAccessLevel.Public:
                return(keyWord);

            case CsAccessLevel.Protected:
                return($"protected {keyWord}");

            case CsAccessLevel.Internal:
                return($"internal {keyWord}");

            case CsAccessLevel.ProtectedInternal:
                return($"protected internal {keyWord}");

            case CsAccessLevel.Private:
                return($"private {keyWord}");

            case CsAccessLevel.PrivateProtected:
                return($"private protected {keyWord}");

            case CsAccessLevel.Default:
                return(string.Empty);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
示例#3
0
 public CsConstructor(CsAccessLevel constructorAccessLevel = CsAccessLevel.Public, params CsParameter[] parameters)
 {
     ConstructorAccessLevel = constructorAccessLevel;
     foreach (CsParameter parameter in parameters)
     {
         Parameters.Add(parameter);
     }
 }
示例#4
0
 public CsIndexer(string genericIndexerReturnTypeName, CsAccessLevel indexerAccessLevel = CsAccessLevel.Public, params CsParameter[] parameters)
 {
     IndexerReturnType  = genericIndexerReturnTypeName;
     IndexerAccessLevel = indexerAccessLevel;
     foreach (CsParameter parameter in parameters)
     {
         Parameters.Add(parameter);
     }
 }
示例#5
0
 public CsMethod(string methodName, string genericMethodReturnTypeName = "", CsAccessLevel methodAccessLevel = CsAccessLevel.Public, params CsParameter[] parameters)
 {
     MethodName        = methodName;
     MethodReturnType  = genericMethodReturnTypeName;
     MethodAccessLevel = methodAccessLevel;
     foreach (CsParameter parameter in parameters)
     {
         Parameters.Add(parameter);
     }
 }
示例#6
0
 public CsGetterSetter SetSetterAccessLevel(CsAccessLevel setterAccessLevel)
 {
     Setter = setterAccessLevel;
     return(this);
 }
示例#7
0
 public CsGetterSetter SetGetterAccessLevel(CsAccessLevel getterAccessLevel)
 {
     Getter = getterAccessLevel;
     return(this);
 }
示例#8
0
 public CsGetterSetter(CsAccessLevel getterAccessLevel = CsAccessLevel.Public, CsAccessLevel setterAccessLevel = CsAccessLevel.Public)
 {
     Getter = getterAccessLevel;
     Setter = setterAccessLevel;
 }
示例#9
0
 public CsProperty SetAccessLevel(CsAccessLevel propertyAccessLevel)
 {
     PropertyAccessLevel = propertyAccessLevel;
     return(this);
 }
示例#10
0
 public CsMethod SetAccessLevel(CsAccessLevel methodAccessLevel)
 {
     MethodAccessLevel = methodAccessLevel;
     return(this);
 }
示例#11
0
 public CsConstructor SetAccessLevel(CsAccessLevel constructorAccessLevel)
 {
     ConstructorAccessLevel = constructorAccessLevel;
     return(this);
 }
示例#12
0
 public CsIndexer SetAccessLevel(CsAccessLevel indexerAccessLevel)
 {
     IndexerAccessLevel = indexerAccessLevel;
     return(this);
 }
示例#13
0
 public CsIndexer(Type indexerReturnType, CsAccessLevel indexerAccessLevel = CsAccessLevel.Public, params CsParameter[] parameters)
     : this(indexerReturnType.GetTypeName(), indexerAccessLevel, parameters)
 {
 }
示例#14
0
 public CsFile SetAccessLevel(CsAccessLevel csAccessLevel)
 {
     CsAccessLevel = csAccessLevel;
     return(this);
 }
示例#15
0
 public CsFile(string nameSpace, string csName, CsAccessLevel csAccessLevel = CsAccessLevel.Public)
 {
     NameSpace     = nameSpace;
     CsName        = csName;
     CsAccessLevel = csAccessLevel;
 }
示例#16
0
 public CsMethod(string methodName, Type methodReturnType = null, CsAccessLevel methodAccessLevel = CsAccessLevel.Public, params CsParameter[] parameters)
     : this(methodName, methodReturnType.GetTypeName(), methodAccessLevel, parameters)
 {
 }
示例#17
0
 public CsProperty(string propertyName, string genericPropertyName, CsAccessLevel propertyAccessLevel = CsAccessLevel.Public)
 {
     PropertyName        = propertyName;
     PropertyType        = genericPropertyName;
     PropertyAccessLevel = propertyAccessLevel;
 }
示例#18
0
 public CsProperty(string propertyName, Type propertyType, CsAccessLevel propertyAccessLevel = CsAccessLevel.Public)
     : this(propertyName, propertyType.GetTypeName(), propertyAccessLevel)
 {
 }
示例#19
0
 public CsClass(string nameSpace, string className, CsAccessLevel classAccessLevel = CsAccessLevel.Public) : base(nameSpace, className, classAccessLevel)
 {
 }
示例#20
0
 public CsEnum(string nameSpace, string enumName, CsAccessLevel enumAccessLevel = CsAccessLevel.Public) : base(nameSpace, enumName, enumAccessLevel)
 {
 }