38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using ProxyInterfaceSourceGenerator.Models;
|
|
|
|
namespace ProxyInterfaceSourceGenerator.FileGenerators;
|
|
|
|
internal class ProxyAttributeGenerator : IFileGenerator
|
|
{
|
|
private const string ClassName = "ProxyAttribute";
|
|
|
|
public FileData GenerateFile()
|
|
{
|
|
return new FileData($"ProxyInterfaceGenerator.{ClassName}.g.cs", $@"//----------------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by https://github.com/StefH/ProxyInterfaceSourceGenerator.
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
using System;
|
|
|
|
namespace ProxyInterfaceGenerator
|
|
{{
|
|
[AttributeUsage(AttributeTargets.Interface)]
|
|
public class {ClassName} : Attribute
|
|
{{
|
|
public Type Type {{ get; }}
|
|
public bool ProxyBaseClasses {{ get; }}
|
|
|
|
public {ClassName}(Type type, bool proxyBaseClasses = false)
|
|
{{
|
|
Type = type;
|
|
ProxyBaseClasses = proxyBaseClasses;
|
|
}}
|
|
}}
|
|
}}");
|
|
}
|
|
} |