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); }