From 7dcc4e15065fbf87a5ee9dad76ad823775837768 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 12 Nov 2013 12:34:45 +0200 Subject: [PATCH] Checked for type maps of tag types. Signed-off-by: Dimitar Dobrev --- .../Generators/CSharp/CSharpTypePrinter.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs index 1e2929d2..d1f3d301 100644 --- a/src/Generator/Generators/CSharp/CSharpTypePrinter.cs +++ b/src/Generator/Generators/CSharp/CSharpTypePrinter.cs @@ -87,8 +87,22 @@ namespace CppSharp.Generators.CSharp public CSharpTypePrinterResult VisitTagType(TagType tag, TypeQualifiers quals) { - if (tag.Declaration == null) - return string.Empty; + if (tag.Declaration == null) + return string.Empty; + + TypeMap typeMap; + if (TypeMapDatabase.FindTypeMap(tag.Declaration, out typeMap)) + { + typeMap.Type = tag; + Context.CSharpKind = ContextKind; + Context.Type = tag; + + return new CSharpTypePrinterResult() + { + Type = typeMap.CSharpSignature(Context), + TypeMap = typeMap + }; + } return tag.Declaration.Visit(this); }