@@ -67,9 +67,6 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta
67
67
TypeCommAccessibility = eCommAccessibility . ReadOnly ;
68
68
}
69
69
70
-
71
- AddToSource ( $ "namespace Pocos{{") ;
72
-
73
70
classDeclarationSyntax . UsingDirectives . ToList ( ) . ForEach ( p => p . Visit ( visitor , this ) ) ;
74
71
75
72
var classDeclarations = this . Compilation . GetSemanticTree ( ) . Classes
@@ -82,7 +79,7 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta
82
79
. Any ( p => p . FullyQualifiedName == classDeclaration . ExtendedTypeAccesses . FirstOrDefault ( ) ? . Type . FullyQualifiedName ) ;
83
80
84
81
if ( isExtended )
85
- AddToSource ( $ " : { classDeclaration . ExtendedTypeAccesses . FirstOrDefault ( ) ? . Type . GetFullyQualifiedPocoName ( ) } ") ;
82
+ AddToSource ( $ " : { classDeclaration . ExtendedTypeAccesses . FirstOrDefault ( ) ? . Type . FullyQualifiedName } ") ;
86
83
87
84
88
85
@@ -101,8 +98,6 @@ public void CreateClassDeclaration(IClassDeclarationSyntax classDeclarationSynta
101
98
classDeclarationSyntax . UsingDirectives . ToList ( ) . ForEach ( p => p . Visit ( visitor , this ) ) ;
102
99
classDeclaration . Fields . ToList ( ) . ForEach ( p => p . Accept ( visitor , this ) ) ;
103
100
AddToSource ( "}" ) ;
104
-
105
- AddToSource ( "}" ) ; // Close namespace
106
101
}
107
102
108
103
/// <inheritdoc />
@@ -200,9 +195,11 @@ public void CreateFile(IFileSyntax fileSyntax, IxNodeVisitor visitor)
200
195
fileSyntax . UsingDirectives
201
196
. Where ( p => this . Compilation . GetSemanticTree ( ) . Namespaces . Select ( p => p . FullyQualifiedName ) . Contains ( p . QualifiedIdentifierList . GetText ( ) ) ) )
202
197
{
203
- AddToSource ( $ "using { fileSyntaxUsingDirective . QualifiedIdentifierList . GetText ( ) } .Pocos ;") ;
198
+ AddToSource ( $ "using Pocos. { fileSyntaxUsingDirective . QualifiedIdentifierList . GetText ( ) } ;") ;
204
199
}
200
+ AddToSource ( "namespace Pocos {" ) ;
205
201
fileSyntax . Declarations . ToList ( ) . ForEach ( p => p . Visit ( visitor , this ) ) ;
202
+ AddToSource ( "}" ) ;
206
203
}
207
204
208
205
/// <inheritdoc />
@@ -212,19 +209,9 @@ public void CreateConfigDeclaration(IConfigDeclarationSyntax configDeclarationSy
212
209
{
213
210
TypeCommAccessibility = eCommAccessibility . None ;
214
211
215
- if ( configurationDeclaration . ContainingNamespace . FullyQualifiedName != "$GLOBAL" )
216
- {
217
- AddToSource ( $ "namespace { configurationDeclaration . ContainingNamespace . FullyQualifiedName } .Pocos{{") ;
218
- }
219
- else
220
- {
221
- AddToSource ( $ "namespace Pocos{{") ;
222
- }
223
-
224
212
AddToSource ( $ "public partial class { Project . TargetProject . ProjectRootNamespace } TwinController{{") ;
225
213
configurationDeclaration . Variables . ToList ( ) . ForEach ( p => p . Accept ( visitor , this ) ) ;
226
214
AddToSource ( "}" ) ;
227
- AddToSource ( "}" ) ; // closing namespace
228
215
}
229
216
230
217
/// <inheritdoc />
@@ -333,9 +320,7 @@ public void CreateStructuredType(IStructTypeDeclarationSyntax structTypeDeclarat
333
320
IxNodeVisitor visitor )
334
321
{
335
322
TypeCommAccessibility = structuredTypeDeclaration . GetCommAccessibility ( this ) ;
336
-
337
- AddToSource ( $ "namespace Pocos{{") ;
338
-
323
+
339
324
AddToSource (
340
325
$ "{ structuredTypeDeclaration . AccessModifier . Transform ( ) } partial class { structTypeDeclarationSyntax . Name . Text } : AXSharp.Connector.IPlain") ;
341
326
AddToSource ( "{" ) ;
@@ -344,8 +329,6 @@ public void CreateStructuredType(IStructTypeDeclarationSyntax structTypeDeclarat
344
329
345
330
structuredTypeDeclaration . Fields . ToList ( ) . ForEach ( p => p . Accept ( visitor , this ) ) ;
346
331
AddToSource ( "}" ) ;
347
-
348
- AddToSource ( "}" ) ; // namespace closing
349
332
}
350
333
351
334
/// <inheritdoc />
@@ -369,13 +352,13 @@ public void CreateScalarTypeDeclaration(IScalarTypeDeclaration scalarTypeDeclara
369
352
/// <inheritdoc />
370
353
public void CreateClassDeclaration ( IClassDeclaration classDeclaration , IxNodeVisitor data )
371
354
{
372
- AddToSource ( classDeclaration . GetFullyQualifiedPocoName ( ) ) ;
355
+ AddToSource ( classDeclaration . GetQualifiedName ( ) ) ;
373
356
}
374
357
375
358
/// <inheritdoc />
376
359
public void CreateInterfaceDeclaration ( IInterfaceDeclaration interfaceDeclaration , IxNodeVisitor visitor )
377
360
{
378
- AddToSource ( interfaceDeclaration . GetFullyQualifiedPocoName ( ) ) ;
361
+ AddToSource ( interfaceDeclaration . GetQualifiedName ( ) ) ;
379
362
}
380
363
381
364
/// <inheritdoc />
@@ -404,7 +387,7 @@ public void CreateStringTypeDeclaration(IStringTypeDeclaration stringTypeDeclara
404
387
public void CreateStructuredType ( IStructuredTypeDeclaration structuredTypeDeclaration , IxNodeVisitor visitor )
405
388
{
406
389
structuredTypeDeclaration . Pragmas . ToList ( ) . ForEach ( p => p . Accept ( visitor , this ) ) ;
407
- AddToSource ( $ "{ structuredTypeDeclaration . GetFullyQualifiedPocoName ( ) } ") ;
390
+ AddToSource ( $ "{ structuredTypeDeclaration . GetQualifiedName ( ) } ") ;
408
391
}
409
392
410
393
/// <inheritdoc />
0 commit comments