Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class AutomaticInterfaceGenerator : IIncrementalGenerator
public const string IgnoreAutomaticInterfaceAttributeName = "IgnoreAutomaticInterface";
public const string NamespaceParameterName = "namespaceName";
public const string InterfaceParameterName = "interfaceName";
public const string AsInternalParameterName = "asInternal";

public void Initialize(IncrementalGeneratorInitializationContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ namespace AutomaticInterface
/// <summary>
/// Use source generator to automatically create a Interface from this class
/// </summary>
/// <param name="namespaceName">Namespace name for the generated interface. Defaults to the same namespace as the class.</param>
/// <param name="interfaceName">Interface name for the generated interface. Defaults to an interface version of the class name.</param>
[AttributeUsage(AttributeTargets.Class)]
internal sealed class {{{AutomaticInterfaceGenerator.DefaultAttributeName}}}Attribute : Attribute
{
internal {{{AutomaticInterfaceGenerator.DefaultAttributeName}}}Attribute(string {{{AutomaticInterfaceGenerator.NamespaceParameterName}}} = "", string {{{AutomaticInterfaceGenerator.InterfaceParameterName}}} = "", bool asInternal = false) { }
/// <param name="{{{AutomaticInterfaceGenerator.NamespaceParameterName}}}">Namespace name for the generated interface. Defaults to the same namespace as the class.</param>
/// <param name="{{{AutomaticInterfaceGenerator.InterfaceParameterName}}}">Interface name for the generated interface. Defaults to an interface version of the class name.</param>
/// <param name="{{{AutomaticInterfaceGenerator.AsInternalParameterName}}}">If true, set the visibility of the interface to internal.</param>
internal {{{AutomaticInterfaceGenerator.DefaultAttributeName}}}Attribute(string {{{AutomaticInterfaceGenerator.NamespaceParameterName}}} = "", string {{{AutomaticInterfaceGenerator.InterfaceParameterName}}} = "", bool {{{AutomaticInterfaceGenerator.AsInternalParameterName}}} = false) { }
}
}
""",
Expand Down
Loading