-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix ProxyAttribute<T> * .
- Loading branch information
Showing
6 changed files
with
139 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
tests/ProxyInterfaceSourceGeneratorTests/Destination/ProxyInterfaceGenerator.Extra.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
//---------------------------------------------------------------------------------------- | ||
// <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> | ||
//---------------------------------------------------------------------------------------- | ||
|
||
#nullable enable | ||
using System; | ||
|
||
namespace ProxyInterfaceGenerator | ||
{ | ||
|
||
[AttributeUsage(AttributeTargets.Interface)] | ||
internal sealed class ProxyAttribute : Attribute | ||
{ | ||
public Type Type { get; } | ||
public bool ProxyBaseClasses { get; } | ||
public ProxyClassAccessibility Accessibility { get; } | ||
public string[]? MembersToIgnore { get; } | ||
|
||
public ProxyAttribute(Type type) : this(type, false, ProxyClassAccessibility.Public) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(Type type, bool proxyBaseClasses) : this(type, proxyBaseClasses, ProxyClassAccessibility.Public) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(Type type, ProxyClassAccessibility accessibility) : this(type, false, accessibility) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(Type type, ProxyClassAccessibility accessibility, string[]? membersToIgnore) : this(type, false, accessibility, membersToIgnore) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(Type type, bool proxyBaseClasses, ProxyClassAccessibility accessibility) : this(type, proxyBaseClasses, accessibility, null) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(Type type, string[]? membersToIgnore) : this(type, false, ProxyClassAccessibility.Public, null) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(Type type, bool proxyBaseClasses, ProxyClassAccessibility accessibility, string[]? membersToIgnore) | ||
{ | ||
Type = type; | ||
ProxyBaseClasses = proxyBaseClasses; | ||
Accessibility = accessibility; | ||
MembersToIgnore = membersToIgnore; | ||
} | ||
} | ||
|
||
|
||
[AttributeUsage(AttributeTargets.Interface)] | ||
internal sealed class ProxyAttribute<T> : Attribute where T : class | ||
{ | ||
public Type Type { get; } | ||
public bool ProxyBaseClasses { get; } | ||
public ProxyClassAccessibility Accessibility { get; } | ||
public string[]? MembersToIgnore { get; } | ||
|
||
public ProxyAttribute() : this(false, ProxyClassAccessibility.Public) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(bool proxyBaseClasses) : this(proxyBaseClasses, ProxyClassAccessibility.Public) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(ProxyClassAccessibility accessibility) : this(false, accessibility) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(ProxyClassAccessibility accessibility, string[]? membersToIgnore) : this(false, accessibility, membersToIgnore) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(bool proxyBaseClasses, ProxyClassAccessibility accessibility) : this(proxyBaseClasses, accessibility, null) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(string[]? membersToIgnore) : this(false, ProxyClassAccessibility.Public, null) | ||
{ | ||
} | ||
|
||
public ProxyAttribute(bool proxyBaseClasses, ProxyClassAccessibility accessibility, string[]? membersToIgnore) | ||
{ | ||
Type = typeof(T); | ||
ProxyBaseClasses = proxyBaseClasses; | ||
Accessibility = accessibility; | ||
MembersToIgnore = membersToIgnore; | ||
} | ||
} | ||
|
||
[Flags] | ||
internal enum ProxyClassAccessibility | ||
{ | ||
Public = 0, | ||
|
||
Internal = 1 | ||
} | ||
} | ||
#nullable restore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters