Skip to content

Commit dd0c8e6

Browse files
committed
Add Attribute Property
1 parent d3c2057 commit dd0c8e6

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/ReactiveUI.SourceGenerators.Roslyn/AttributeDefinitions.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ internal enum InheritanceModifier
5252
Override,
5353
New,
5454
}
55+
56+
internal enum SplatRegistrationType
57+
{
58+
None,
59+
LazySingleton,
60+
Constant,
61+
PerRequest,
62+
}
5563
#nullable restore
5664
#pragma warning restore
5765
""";
@@ -344,7 +352,14 @@ namespace ReactiveUI.SourceGenerators;
344352
/// <param name="viewModelType">Type of the view model.</param>
345353
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "1.1.0.0")]
346354
[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
347-
internal sealed class IViewForAttribute<T> : global::System.Attribute;
355+
internal sealed class IViewForAttribute<T> : global::System.Attribute
356+
{
357+
/// <summary>
358+
/// Gets the Splat registration type for Splat registration.
359+
/// Registers IViewFor<T> in the Splat service locator.
360+
/// </summary>
361+
public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None;
362+
}
348363
349364
/// <summary>
350365
/// IViewForAttribute.
@@ -356,7 +371,14 @@ internal sealed class IViewForAttribute<T> : global::System.Attribute;
356371
/// <param name="viewModelType">Type of the view model.</param>
357372
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.IViewForGenerator", "1.1.0.0")]
358373
[global::System.AttributeUsage(global::System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
359-
internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute;
374+
internal sealed class IViewForAttribute(string? viewModelType) : global::System.Attribute
375+
{
376+
/// <summary>
377+
/// Gets the Splat registration type for Splat registration.
378+
/// Registers IViewFor<T> in the Splat service locator.
379+
/// </summary>
380+
public SplatRegistrationType RegistrationType { get; init; } = SplatRegistrationType.None;
381+
}
360382
#nullable restore
361383
#pragma warning restore
362384
""";

0 commit comments

Comments
 (0)