Skip to content

Commit

Permalink
Minor improvements to base source generator
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Oct 26, 2024
1 parent 26282e4 commit a2397ef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions samples/Sample/Contracts/MyPrismNavRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ namespace Sample.Contracts;

public record MyPrismNavRequest(string Arg) : IPrismNavigationRequest
{
public string? PrependedNavigationUri { get; }
public string PageUri => "AnotherPage";
public string? NavigationParameterName => null;
public bool? IsAnimated { get; }
public bool IsModal { get; }
public INavigationService? Navigator { get; set; }
};
18 changes: 9 additions & 9 deletions src/Shiny.Mediator.SourceGenerators/MediatorSourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ public void Initialize(GeneratorInitializationContext context)
// </auto-generated>
#nullable disable
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class SingletonHandlerAttribute : System.Attribute
[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class SingletonHandlerAttribute : global::System.Attribute
{
}
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class ScopedHandlerAttribute : System.Attribute
[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class ScopedHandlerAttribute : global::System.Attribute
{
}
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class SingletonMiddlewareAttribute : System.Attribute
[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class SingletonMiddlewareAttribute : global::System.Attribute
{
}
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class ScopedMiddlewareAttribute : System.Attribute
[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false)]
internal sealed class ScopedMiddlewareAttribute : global::System.Attribute
{
}
""",
Expand All @@ -54,7 +54,7 @@ internal sealed class ScopedMiddlewareAttribute : System.Attribute

public void Execute(GeneratorExecutionContext context)
{
if (!(context.SyntaxContextReceiver is SyntaxReceiver))
if (context.SyntaxContextReceiver is not RegisterHandlerAttributeSyntaxReceiver)
return;

// TODO: detect double registration of request handlers?
Expand Down

0 comments on commit a2397ef

Please sign in to comment.