From 1ec968611171b76b00d8a35f5ed501001db2bef8 Mon Sep 17 00:00:00 2001 From: gpetrou Date: Sat, 22 Feb 2014 19:38:45 +0000 Subject: [PATCH] Added default option to avoid generating ICppMarshal interface in the output files. --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 11 +++++++++-- src/Generator/Options.cs | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index f9fd38e4..d716eabd 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -366,7 +366,11 @@ namespace CppSharp.Generators.CSharp PopBlock(NewLineKind.BeforeNextBlock); } - GenerateClassMarshals(@class); + if (Options.GenerateClassMarshals) + { + GenerateClassMarshals(@class); + } + GenerateClassConstructors(@class); if (@class.IsUnion) @@ -772,7 +776,10 @@ namespace CppSharp.Generators.CSharp if (@class.IsRefType) bases.Add("IDisposable"); - bases.Add("CppSharp.Runtime.ICppMarshal"); + if (Options.GenerateClassMarshals) + { + bases.Add("CppSharp.Runtime.ICppMarshal"); + } if (bases.Count > 0) Write(" : {0}", string.Join(", ", bases)); diff --git a/src/Generator/Options.cs b/src/Generator/Options.cs index aa09a1ec..66006dae 100644 --- a/src/Generator/Options.cs +++ b/src/Generator/Options.cs @@ -37,6 +37,7 @@ namespace CppSharp GeneratorKind = GeneratorKind.CSharp; GenerateLibraryNamespace = true; GeneratePartialClasses = true; + GenerateClassMarshals = false; OutputInteropIncludes = true; MaxIndent = 80; CommentPrefix = "///"; @@ -89,6 +90,7 @@ namespace CppSharp public bool GenerateInterfacesForMultipleInheritance; public bool GenerateProperties; public bool GenerateInternalImports; + public bool GenerateClassMarshals; /// /// Enable this option to enable generation of finalizers.