|
|
|
@ -160,18 +160,20 @@ namespace CppSharp.Generators.CSharp |
|
|
|
WriteLine("using System;"); |
|
|
|
WriteLine("using System;"); |
|
|
|
WriteLine("using System.Runtime.InteropServices;"); |
|
|
|
WriteLine("using System.Runtime.InteropServices;"); |
|
|
|
WriteLine("using System.Security;"); |
|
|
|
WriteLine("using System.Security;"); |
|
|
|
|
|
|
|
|
|
|
|
var internalsVisibleTo = (from m in Options.Modules |
|
|
|
var internalsVisibleTo = (from m in Options.Modules |
|
|
|
where m.Dependencies.Contains(module) |
|
|
|
where m.Dependencies.Contains(module) |
|
|
|
select m.LibraryName).ToList(); |
|
|
|
select m.LibraryName).ToList(); |
|
|
|
if (internalsVisibleTo.Any()) |
|
|
|
if (internalsVisibleTo.Any()) |
|
|
|
WriteLine("using System.Runtime.CompilerServices;"); |
|
|
|
WriteLine("using System.Runtime.CompilerServices;"); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var customUsingStatement in Options.DependentNameSpaces) |
|
|
|
foreach (var customUsingStatement in Options.DependentNameSpaces) |
|
|
|
{ |
|
|
|
WriteLine("using {0};", customUsingStatement); |
|
|
|
WriteLine(string.Format("using {0};", customUsingStatement)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
PopBlock(NewLineKind.BeforeNextBlock); |
|
|
|
|
|
|
|
|
|
|
|
foreach (var library in internalsVisibleTo) |
|
|
|
foreach (var library in internalsVisibleTo) |
|
|
|
WriteLine($"[assembly:InternalsVisibleTo(\"{library}\")]"); |
|
|
|
WriteLine($"[assembly:InternalsVisibleTo(\"{library}\")]"); |
|
|
|
|
|
|
|
|
|
|
|
if (internalsVisibleTo.Any()) |
|
|
|
if (internalsVisibleTo.Any()) |
|
|
|
NewLine(); |
|
|
|
NewLine(); |
|
|
|
|
|
|
|
|
|
|
|
@ -242,16 +244,19 @@ namespace CppSharp.Generators.CSharp |
|
|
|
GenerateInterface(@class); |
|
|
|
GenerateInterface(@class); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var specialization = @class as ClassTemplateSpecialization; |
|
|
|
var specialization = @class as ClassTemplateSpecialization; |
|
|
|
if (specialization != null && |
|
|
|
if (specialization != null && |
|
|
|
specialization.SpecializationKind == |
|
|
|
specialization.SpecializationKind == |
|
|
|
TemplateSpecializationKind.ExplicitInstantiationDeclaration) |
|
|
|
TemplateSpecializationKind.ExplicitInstantiationDeclaration) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
if (!@class.IsDependent) |
|
|
|
if (!@class.IsDependent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GenerateClass(@class); |
|
|
|
GenerateClass(@class); |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!(@class.Namespace is Class)) |
|
|
|
if (!(@class.Namespace is Class)) |
|
|
|
GenerateClassTemplateSpecializationInternal(@class); |
|
|
|
GenerateClassTemplateSpecializationInternal(@class); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -377,6 +382,7 @@ namespace CppSharp.Generators.CSharp |
|
|
|
GenerateComment(decl.Comment); |
|
|
|
GenerateComment(decl.Comment); |
|
|
|
GenerateDebug(decl); |
|
|
|
GenerateDebug(decl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
foreach (Attribute attribute in decl.Attributes) |
|
|
|
foreach (Attribute attribute in decl.Attributes) |
|
|
|
WriteLine("[{0}({1})]", attribute.Type.FullName, attribute.Value); |
|
|
|
WriteLine("[{0}({1})]", attribute.Type.FullName, attribute.Value); |
|
|
|
} |
|
|
|
} |
|
|
|
|