diff --git a/src/Generator/Generators/CLI/CLISourcesTemplate.cs b/src/Generator/Generators/CLI/CLISourcesTemplate.cs index ac983a80..5453db5c 100644 --- a/src/Generator/Generators/CLI/CLISourcesTemplate.cs +++ b/src/Generator/Generators/CLI/CLISourcesTemplate.cs @@ -42,6 +42,10 @@ namespace CppSharp.Generators.CLI PushBlock(CLIBlockKind.Usings); WriteLine("using namespace System;"); WriteLine("using namespace System::Runtime::InteropServices;"); + foreach (var customUsingStatement in Options.DependentNameSpaces) + { + WriteLine(string.Format("using namespace {0};", customUsingStatement)); ; + } NewLine(); PopBlock(); diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 81c766d9..ed531859 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -156,6 +156,10 @@ namespace CppSharp.Generators.CSharp WriteLine("using System;"); WriteLine("using System.Runtime.InteropServices;"); WriteLine("using System.Security;"); + foreach (var customUsingStatement in Options.DependentNameSpaces) + { + WriteLine(string.Format("using {0};", customUsingStatement));; + } PopBlock(NewLineKind.BeforeNextBlock); if (Options.GenerateLibraryNamespace) diff --git a/src/Generator/Options.cs b/src/Generator/Options.cs index 6a91d9fb..aa09a1ec 100644 --- a/src/Generator/Options.cs +++ b/src/Generator/Options.cs @@ -131,6 +131,7 @@ namespace CppSharp public bool Is32Bit { get { return true; } } public List CodeFiles { get; private set; } + public readonly List DependentNameSpaces = new List(); } public class InvalidOptionException : Exception