From 77c2a5cdaa242fa96c4cef5abb32a4a8eb7518e1 Mon Sep 17 00:00:00 2001 From: lindexi Date: Sat, 21 Oct 2023 21:47:03 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E7=BC=96=E5=86=99=E4=B8=BA=E4=BA=86?= =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E5=B1=95=E7=A4=BA=E7=9A=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 01aeafe0278bc4a62a96ccfee5c414b88053e0c9. --- .../TelescopeSourceGeneratorDemo/Program.cs | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/TelescopeSourceGenerator/Demo/TelescopeSourceGeneratorDemo/Program.cs b/src/TelescopeSourceGenerator/Demo/TelescopeSourceGeneratorDemo/Program.cs index d854660..8821f3b 100644 --- a/src/TelescopeSourceGenerator/Demo/TelescopeSourceGeneratorDemo/Program.cs +++ b/src/TelescopeSourceGenerator/Demo/TelescopeSourceGeneratorDemo/Program.cs @@ -24,8 +24,8 @@ static void Main(string[] args) } } - [dotnetCampus.Telescope.TelescopeExportAttribute()] - private static partial IEnumerable<(Type type, FooAttribute attribute, Func creator)> ExportFooEnumerable(); + [dotnetCampus.Telescope.TelescopeExportAttribute(IncludeReferences = true)] + private static partial IEnumerable<(Type, F1Attribute xx, Func xxx)> ExportFooEnumerable(); [dotnetCampus.Telescope.TelescopeExportAttribute(IncludeReferences = true)] private partial IEnumerable<(Type, Func xxx)> ExportF1Enumerable(); @@ -36,13 +36,13 @@ public class CurrentFoo : DemoLib1.F1 { } -[FooAttribute] -class F1 : Base +[Foo(0, FooEnum.N1, typeof(Foo), null)] +abstract class F1 : Base { } -[FooAttribute] -class F2 : Base +[Foo(1ul, FooEnum.N2, typeof(Base), null, Number2 = 2L, Type2 = typeof(Foo), FooEnum2 = FooEnum.N1, Type3 = null)] +class Foo : Base { } @@ -52,7 +52,23 @@ class Base class FooAttribute : Attribute { - + public FooAttribute(ulong number1, FooEnum fooEnum, Type? type1, Type? type3) + { + Number1 = number1; + FooEnum1 = fooEnum; + Type1 = type1; + } + + public ulong Number1 { get; set; } + public long Number2 { get; set; } + + public FooEnum FooEnum1 { get; set; } + public FooEnum FooEnum2 { get; set; } + public FooEnum FooEnum3 { get; set; } + + public Type? Type1 { get; set; } + public Type? Type2 { get; set; } + public Type? Type3 { get; set; } } public enum FooEnum