Add support for public and internal ProxyClass (#58)

* x

* fx

* .
This commit is contained in:
Stef Heyenrath
2023-02-24 16:22:26 +01:00
committed by GitHub
parent 4c7f7cde4d
commit eadcf8585f
15 changed files with 296 additions and 36 deletions
@@ -5,6 +5,7 @@ using ProxyInterfaceSourceGenerator.Builders;
using ProxyInterfaceSourceGenerator.Enums;
using ProxyInterfaceSourceGenerator.Extensions;
using ProxyInterfaceSourceGenerator.Models;
using ProxyInterfaceSourceGenerator.Types;
using ProxyInterfaceSourceGenerator.Utils;
namespace ProxyInterfaceSourceGenerator.FileGenerators;
@@ -88,6 +89,8 @@ internal partial class ProxyClassesGenerator : BaseGenerator, IFilesGenerator
var (namespaceStart, namespaceEnd) = NamespaceBuilder.Build(pd.Namespace);
var accessibility = pd.Accessibility == ProxyClassAccessibility.Internal ? "internal" : "public";
return $@"//----------------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by https://github.com/StefH/ProxyInterfaceSourceGenerator.
@@ -101,7 +104,7 @@ internal partial class ProxyClassesGenerator : BaseGenerator, IFilesGenerator
using System;
{namespaceStart}
public {@abstract}partial class {className} : {extends}{interfaceName}
{accessibility} {@abstract}partial class {className} : {extends}{interfaceName}
{{
public {@new}{targetClassSymbol.Symbol} _Instance {{ get; }}
{instanceBaseDefinition}