From 994e55c4be38f1b89b1c5735e1c3e10621f6c826 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Fri, 24 Feb 2023 16:48:25 +0100 Subject: [PATCH] 0.0.32 --- Generate-ReleaseNotes.bat | 2 +- PackageReleaseNotes.txt | 6 +++--- README.md | 12 ++++++++++++ ReleaseNotes.md | 4 ++++ .../ProxyInterfaceSourceGenerator.csproj | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Generate-ReleaseNotes.bat b/Generate-ReleaseNotes.bat index e3881de..ef5f69b 100644 --- a/Generate-ReleaseNotes.bat +++ b/Generate-ReleaseNotes.bat @@ -1,6 +1,6 @@ rem https://github.com/StefH/GitHubReleaseNotes -SET version=0.0.31 +SET version=0.0.32 GitHubReleaseNotes --output "ReleaseNotes.md" --skip-empty-releases --exclude-labels question invalid doc --version %version% diff --git a/PackageReleaseNotes.txt b/PackageReleaseNotes.txt index c7ee710..0ec445b 100644 --- a/PackageReleaseNotes.txt +++ b/PackageReleaseNotes.txt @@ -1,5 +1,5 @@ -# 0.0.31 (21 February 2023) -- #55 Fixed multi-dimension argument / return type [bug] -- #54 2D arrays as inputs to a method generate interfaces with incorrect asterisks in their array definitions [bug] +# 0.0.32 (24 February 2023) +- #58 Add support for public and internal ProxyClass [enhancement] +- #56 Internal proxies/Proxy factory [enhancement] The full release notes can be found here: https://github.com/StefH/ProxyInterfaceSourceGenerator/blob/main/ReleaseNotes.md \ No newline at end of file diff --git a/README.md b/README.md index 4c0f1ba..9f901ae 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,15 @@ public partial interface IPerson } ``` +#### ProxyClassAccessibility +By default, the generated Proxy class is `public`. If you want to create the Proxy class as `internal`, use the following: + +``` c# +[ProxyInterfaceGenerator.Proxy(typeof(Person), ProxyClassAccessibility.Internal)] // 👈 Provide `ProxyClassAccessibility.Internal` as second parameter. +public partial interface IPerson +{ +} +``` ### When the code is compiled, this source generator creates the following @@ -71,6 +80,7 @@ public partial interface IPerson Which takes the external class in the constructor and wraps all public properties, events and methods. ``` c# +// ⭐ public class PersonProxy : IPerson { public Person _Instance { get; } @@ -91,6 +101,8 @@ public class PersonProxy : IPerson } ``` +:star: By default the accessibility from the generated Proxy class is `public`. + ### :three: Use it ``` c# IPerson p = new PersonProxy(new Person()); diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 6a41539..c8cd990 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,3 +1,7 @@ +# 0.0.32 (24 February 2023) +- [#58](https://github.com/StefH/ProxyInterfaceSourceGenerator/pull/58) - Add support for public and internal ProxyClass [enhancement] contributed by [StefH](https://github.com/StefH) +- [#56](https://github.com/StefH/ProxyInterfaceSourceGenerator/issues/56) - Internal proxies/Proxy factory [enhancement] + # 0.0.31 (21 February 2023) - [#55](https://github.com/StefH/ProxyInterfaceSourceGenerator/pull/55) - Fixed multi-dimension argument / return type [bug] contributed by [StefH](https://github.com/StefH) - [#54](https://github.com/StefH/ProxyInterfaceSourceGenerator/issues/54) - 2D arrays as inputs to a method generate interfaces with incorrect asterisks in their array definitions [bug] diff --git a/src/ProxyInterfaceSourceGenerator/ProxyInterfaceSourceGenerator.csproj b/src/ProxyInterfaceSourceGenerator/ProxyInterfaceSourceGenerator.csproj index e2b26d8..4746498 100644 --- a/src/ProxyInterfaceSourceGenerator/ProxyInterfaceSourceGenerator.csproj +++ b/src/ProxyInterfaceSourceGenerator/ProxyInterfaceSourceGenerator.csproj @@ -1,7 +1,7 @@ - 0.0.31 + 0.0.32 netstandard2.0 {12344228-91F4-4502-9595-39584E5ABB34} 10