protected override void WriteBeforeLiteralBody(SourceCodeWriter tw) { if (!string.IsNullOrWhiteSpace(tw.Context.Namespace)) { tw.WriteLine("Namespace global.[{0}]", tw.Context.Namespace); tw.Shift(); } tw.WriteLine("Module ThisAssembly"); tw.Shift(); }
protected override void WriteAfterBody(SourceCodeWriter tw) { var required = IsRequiredSelfHostingMetadataAttribute(tw.Context); if (!required) { tw.WriteLine("#if NET10 || NET11 || NET20 || NET30 || NET35 || NET40"); tw.WriteLine(); } tw.WriteLine("Namespace global.System.Reflection"); tw.Shift(); tw.WriteLine("<AttributeUsage(AttributeTargets.Assembly, AllowMultiple := True, Inherited := False)>"); tw.WriteLine("Friend NotInheritable Class AssemblyMetadataAttribute"); tw.Shift(); tw.WriteLine("Inherits Attribute"); tw.WriteLine("Public Sub New(key As String, value As String)"); tw.Shift(); tw.WriteLine("Me.Key = key"); tw.WriteLine("Me.Value = value"); tw.UnShift(); tw.WriteLine("End Sub"); tw.WriteLine("Public ReadOnly Property Key As String"); tw.WriteLine("Public ReadOnly Property Value As String"); tw.UnShift(); tw.WriteLine("End Class"); tw.UnShift(); tw.WriteLine("End Namespace"); if (!required) { tw.WriteLine(); tw.WriteLine("#endif"); } tw.WriteLine(); }
protected override void WriteBeforeNestedLiteralBody(SourceCodeWriter tw, string name) { tw.WriteLine("Public NotInheritable Class {0}", name); tw.Shift(); }