From 6b711dc205f3255c7874174ccf15eb8b7051d0ca Mon Sep 17 00:00:00 2001 From: triton Date: Tue, 19 Mar 2013 13:50:27 +0000 Subject: [PATCH] Added support for the GenerateLibraryNamespace option in the C# generator. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 67767ed1..7936e005 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -52,12 +52,16 @@ namespace Cxxi.Generators.CSharp WriteLine("using System.Runtime.InteropServices;"); NewLine(); - WriteLine("namespace {0}", SafeIdentifier(Driver.Options.LibraryName)); - WriteStartBraceIndent(); + if (Options.GenerateLibraryNamespace) + { + WriteLine("namespace {0}", SafeIdentifier(Driver.Options.LibraryName)); + WriteStartBraceIndent(); + } GenerateDeclarations(); - WriteCloseBraceIndent(); + if (Options.GenerateLibraryNamespace) + WriteCloseBraceIndent(); } public void GenerateStart()