protected override TDeclarationNode AddNamespace <TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, CodeGenerationOptions options, IList <bool> availableIndices, CancellationToken cancellationToken) { CheckDeclarationNode <CompilationUnitSyntax, NamespaceDeclarationSyntax>(destination); if (destination is CompilationUnitSyntax) { return(Cast <TDeclarationNode>(NamespaceGenerator.AddNamespaceTo(this, Cast <CompilationUnitSyntax>(destination), @namespace, options, availableIndices, cancellationToken))); } else { return(Cast <TDeclarationNode>(NamespaceGenerator.AddNamespaceTo(this, Cast <NamespaceDeclarationSyntax>(destination), @namespace, options, availableIndices, cancellationToken))); } }
protected override TDeclarationNode AddNamespace <TDeclarationNode>(TDeclarationNode destination, INamespaceSymbol @namespace, CSharpCodeGenerationContextInfo info, IList <bool>?availableIndices, CancellationToken cancellationToken) { CheckDeclarationNode <CompilationUnitSyntax, BaseNamespaceDeclarationSyntax>(destination); if (destination is CompilationUnitSyntax compilationUnit) { return(Cast <TDeclarationNode>(NamespaceGenerator.AddNamespaceTo(this, compilationUnit, @namespace, info, availableIndices, cancellationToken))); } else { return(Cast <TDeclarationNode>(NamespaceGenerator.AddNamespaceTo(this, Cast <BaseNamespaceDeclarationSyntax>(destination), @namespace, info, availableIndices, cancellationToken))); } }