|
|
@ -128,33 +128,39 @@ namespace CppSharp.Generators.CSharp |
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
public override void Process() |
|
|
|
public override void Process(Order order) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GenerateHeader(); |
|
|
|
GenerateHeader(); |
|
|
|
|
|
|
|
|
|
|
|
PushBlock(CSharpBlockKind.Usings); |
|
|
|
if (!Options.GenerateSingleCSharpFile || order.HasFlag(Order.First)) |
|
|
|
WriteLine("using System;"); |
|
|
|
|
|
|
|
WriteLine("using System.Runtime.InteropServices;"); |
|
|
|
|
|
|
|
WriteLine("using System.Security;"); |
|
|
|
|
|
|
|
foreach (var customUsingStatement in Options.DependentNameSpaces) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteLine(string.Format("using {0};", customUsingStatement));; |
|
|
|
PushBlock(CSharpBlockKind.Usings); |
|
|
|
} |
|
|
|
WriteLine("using System;"); |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
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) |
|
|
|
if (Options.GenerateLibraryNamespace) |
|
|
|
{ |
|
|
|
{ |
|
|
|
PushBlock(CSharpBlockKind.Namespace); |
|
|
|
PushBlock(CSharpBlockKind.Namespace); |
|
|
|
WriteLine("namespace {0}", Driver.Options.OutputNamespace); |
|
|
|
WriteLine("namespace {0}", Driver.Options.OutputNamespace); |
|
|
|
WriteStartBraceIndent(); |
|
|
|
WriteStartBraceIndent(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GenerateDeclContext(TranslationUnit); |
|
|
|
GenerateDeclContext(TranslationUnit); |
|
|
|
|
|
|
|
|
|
|
|
if (Options.GenerateLibraryNamespace) |
|
|
|
if (!Options.GenerateSingleCSharpFile || order.HasFlag(Order.Last)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WriteCloseBraceIndent(); |
|
|
|
if (Options.GenerateLibraryNamespace) |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
{ |
|
|
|
|
|
|
|
WriteCloseBraceIndent(); |
|
|
|
|
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|