@@ -11,18 +11,18 @@ public class CSMethod : CodeElementCollection<ICodeElement> {
11
11
public CSMethod ( CSVisibility vis , CSMethodKind kind , CSType type , CSIdentifier name , CSParameterList parms , CSCodeBlock body )
12
12
: this ( vis , kind , type , name , parms , null , false , body )
13
13
{
14
-
14
+
15
15
}
16
16
public CSMethod ( CSVisibility vis , CSMethodKind kind , CSType type , CSIdentifier name ,
17
- CSParameterList parms , CSBaseExpression [ ] baseOrThisCallParms , bool callsBase , CSCodeBlock body , bool isSealed = false )
17
+ CSParameterList parms , CSBaseExpression [ ] baseOrThisCallParms , bool callsBase , CSCodeBlock body , bool isSealed = false )
18
18
{
19
19
GenericParameters = new CSGenericTypeDeclarationCollection ( ) ;
20
20
GenericConstraints = new CSGenericConstraintCollection ( ) ;
21
21
Visibility = vis ;
22
22
Kind = kind ;
23
23
Type = type ; // no throw on null - could be constructor
24
- Name = Exceptions . ThrowOnNull ( name , nameof ( name ) ) ;
25
- Parameters = Exceptions . ThrowOnNull ( parms , nameof ( parms ) ) ;
24
+ Name = Exceptions . ThrowOnNull ( name , nameof ( name ) ) ;
25
+ Parameters = Exceptions . ThrowOnNull ( parms , nameof ( parms ) ) ;
26
26
CallsBase = callsBase ;
27
27
BaseOrThisCallParameters = baseOrThisCallParms ;
28
28
@@ -31,25 +31,25 @@ public CSMethod (CSVisibility vis, CSMethodKind kind, CSType type, CSIdentifier
31
31
32
32
LineCodeElementCollection < ICodeElement > lc = new LineCodeElementCollection < ICodeElement > ( new ICodeElement [ 0 ] , false , true ) ;
33
33
if ( vis != CSVisibility . None ) {
34
- lc . And ( new SimpleElememt ( VisibilityToString ( vis ) ) ) . And ( SimpleElememt . Spacer ) ;
34
+ lc . And ( new SimpleElement ( VisibilityToString ( vis ) ) ) . And ( SimpleElement . Spacer ) ;
35
35
}
36
36
37
37
if ( isSealed ) {
38
- lc . And ( new SimpleElememt ( "sealed" ) ) . And ( SimpleElememt . Spacer ) ;
38
+ lc . And ( new SimpleElement ( "sealed" ) ) . And ( SimpleElement . Spacer ) ;
39
39
}
40
40
41
- lc . And ( new SimpleElememt ( MethodKindToString ( kind ) ) ) . And ( SimpleElememt . Spacer ) ;
41
+ lc . And ( new SimpleElement ( MethodKindToString ( kind ) ) ) . And ( SimpleElement . Spacer ) ;
42
42
43
43
if ( type != null ) {
44
- lc . And ( type ) . And ( SimpleElememt . Spacer ) ;
44
+ lc . And ( type ) . And ( SimpleElement . Spacer ) ;
45
45
}
46
46
47
- lc . And ( name ) . And ( GenericParameters ) . And ( new SimpleElememt ( "(" ) ) . And ( parms ) . And ( new SimpleElememt ( ")" ) ) . And ( GenericConstraints ) ;
47
+ lc . And ( name ) . And ( GenericParameters ) . And ( new SimpleElement ( "(" ) ) . And ( parms ) . And ( new SimpleElement ( ")" ) ) . And ( GenericConstraints ) ;
48
48
if ( body == null ) {
49
49
if ( ! ( kind == CSMethodKind . StaticExtern || kind == CSMethodKind . Interface ) )
50
- throw new ArgumentException ( "Method body is only optional when method kind kind is either StaticExtern or Interface" ,
51
- nameof ( body ) ) ;
52
- lc . Add ( new SimpleElememt ( ";" ) ) ;
50
+ throw new ArgumentException ( "Method body is only optional when method kind kind is either StaticExtern or Interface" ,
51
+ nameof ( body ) ) ;
52
+ lc . Add ( new SimpleElement ( ";" ) ) ;
53
53
}
54
54
Add ( lc ) ;
55
55
if ( BaseOrThisCallParameters != null ) {
@@ -65,7 +65,7 @@ public CSMethod (CSVisibility vis, CSMethodKind kind, CSType type, CSIdentifier
65
65
public CSIdentifier Name { get ; private set ; }
66
66
public CSParameterList Parameters { get ; private set ; }
67
67
public bool CallsBase { get ; private set ; }
68
- public CSBaseExpression [ ] BaseOrThisCallParameters { get ; private set ; }
68
+ public CSBaseExpression [ ] BaseOrThisCallParameters { get ; private set ; }
69
69
public CSCodeBlock Body { get ; private set ; }
70
70
public CSGenericTypeDeclarationCollection GenericParameters { get ; private set ; }
71
71
public CSGenericConstraintCollection GenericConstraints { get ; private set ; }
@@ -143,7 +143,7 @@ public static string MethodKindToString (CSMethodKind kind)
143
143
case CSMethodKind . Abstract :
144
144
return "abstract" ;
145
145
default :
146
- throw new ArgumentOutOfRangeException ( nameof ( kind ) ) ;
146
+ throw new ArgumentOutOfRangeException ( nameof ( kind ) ) ;
147
147
}
148
148
}
149
149
@@ -162,21 +162,21 @@ public static CSMethod PublicConstructor (string name, CSParameterList parms, CS
162
162
return new CSMethod ( CSVisibility . Public , CSMethodKind . None , null , new CSIdentifier ( name ) , parms , Exceptions . ThrowOnNull ( body , "body" ) ) ;
163
163
}
164
164
165
- public static CSMethod PublicConstructor ( string name , CSParameterList parms , CSCodeBlock body , params CSBaseExpression [ ] baseParams )
165
+ public static CSMethod PublicConstructor ( string name , CSParameterList parms , CSCodeBlock body , params CSBaseExpression [ ] baseParams )
166
166
{
167
167
return new CSMethod ( CSVisibility . Public , CSMethodKind . None , null , new CSIdentifier ( name ) , parms ,
168
- baseParams , true , Exceptions . ThrowOnNull ( body , "body" ) ) ;
168
+ baseParams , true , Exceptions . ThrowOnNull ( body , "body" ) ) ;
169
169
}
170
170
171
171
public static CSMethod PrivateConstructor ( string name , CSParameterList parms , CSCodeBlock body )
172
172
{
173
173
return new CSMethod ( CSVisibility . None , CSMethodKind . None , null , new CSIdentifier ( name ) , parms , Exceptions . ThrowOnNull ( body , "body" ) ) ;
174
174
}
175
175
176
- public static CSMethod PrivateConstructor ( string name , CSParameterList parms , CSCodeBlock body , params CSBaseExpression [ ] baseParams )
176
+ public static CSMethod PrivateConstructor ( string name , CSParameterList parms , CSCodeBlock body , params CSBaseExpression [ ] baseParams )
177
177
{
178
178
return new CSMethod ( CSVisibility . None , CSMethodKind . None , null , new CSIdentifier ( name ) , parms ,
179
- baseParams , true , Exceptions . ThrowOnNull ( body , "body" ) ) ;
179
+ baseParams , true , Exceptions . ThrowOnNull ( body , "body" ) ) ;
180
180
}
181
181
182
182
public static CSMethod PInvoke ( CSVisibility vis , CSType type , string name , string dllName , string externName , CSParameterList parms )
0 commit comments