9
9
namespace Dynamo . CSLang {
10
10
public class CSClass : ICodeElementSet , ICSTopLevelDeclaration {
11
11
public CSClass ( CSVisibility vis , CSIdentifier name , IEnumerable < CSMethod > methods = null ,
12
- bool isStatic = false , bool isSealed = false )
12
+ bool isStatic = false , bool isSealed = false , bool isUnsafe = false )
13
13
{
14
14
Visibility = vis ;
15
15
IsStatic = isStatic ;
@@ -32,8 +32,9 @@ public CSClass (CSVisibility vis, CSIdentifier name, IEnumerable<CSMethod> metho
32
32
}
33
33
34
34
public CSClass ( CSVisibility vis , string name ,
35
- IEnumerable < CSMethod > members = null , bool isStatic = false , bool isSealed = false )
36
- : this ( vis , new CSIdentifier ( name ) , members , isStatic , isSealed )
35
+ IEnumerable < CSMethod > members = null , bool isStatic = false , bool isSealed = false ,
36
+ bool isUnsafe = false )
37
+ : this ( vis , new CSIdentifier ( name ) , members , isStatic , isSealed , isUnsafe : false )
37
38
{
38
39
}
39
40
@@ -42,6 +43,7 @@ public CSClass (CSVisibility vis, string name,
42
43
public CSVisibility Visibility { get ; private set ; }
43
44
public bool IsStatic { get ; private set ; }
44
45
public bool IsSealed { get ; private set ; }
46
+ public bool IsUnsafe { get ; private set ; }
45
47
public CSIdentifier Name { get ; private set ; }
46
48
public CSInheritance Inheritance { get ; private set ; }
47
49
public List < CSDelegateTypeDecl > Delegates { get ; private set ; }
@@ -114,6 +116,8 @@ public IEnumerable<ICodeElement> Elements {
114
116
decl . Add ( new SimpleElement ( "static " , true ) ) ;
115
117
if ( IsSealed )
116
118
decl . Add ( new SimpleElement ( "sealed " , true ) ) ;
119
+ if ( IsUnsafe )
120
+ decl . Add ( new SimpleElement ( "unsafe " , true ) ) ;
117
121
decl . Add ( new CSIdentifier ( EntityLabel + " " ) ) ;
118
122
decl . Add ( Name ) ;
119
123
decl . Add ( GenericParams ) ;
@@ -169,14 +173,15 @@ public CSClasses And (CSClass use)
169
173
170
174
public class CSStruct : CSClass {
171
175
public CSStruct ( CSVisibility vis , CSIdentifier name , IEnumerable < CSMethod > methods = null ,
172
- bool isStatic = false , bool isSealed = false )
173
- : base ( vis , name , methods , isStatic , isSealed )
176
+ bool isStatic = false , bool isSealed = false , bool isUnsafe = false )
177
+ : base ( vis , name , methods , isStatic , isSealed , isUnsafe )
174
178
{
175
179
}
176
180
177
181
public CSStruct ( CSVisibility vis , string name ,
178
- IEnumerable < CSMethod > members = null , bool isStatic = false , bool isSealed = false )
179
- : this ( vis , new CSIdentifier ( name ) , members , isStatic , isSealed )
182
+ IEnumerable < CSMethod > members = null , bool isStatic = false , bool isSealed = false ,
183
+ bool isUnsafe = false )
184
+ : this ( vis , new CSIdentifier ( name ) , members , isStatic , isSealed , isUnsafe )
180
185
{
181
186
}
182
187
0 commit comments