Пример #1
0
        protected override void WriteAfterLiteralBody(SourceCodeWriter tw)
        {
            tw.UnShift();
            tw.WriteLine("End Module");

            if (!string.IsNullOrWhiteSpace(tw.Context.Namespace))
            {
                tw.UnShift();
                tw.WriteLine("End Namespace");
            }
        }
Пример #2
0
        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();
        }
Пример #3
0
 protected override void WriteAfterNestedLiteralBody(SourceCodeWriter tw)
 {
     tw.UnShift();
     tw.WriteLine("End Class");
 }