Skip to content
Merged
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
1,685 changes: 839 additions & 846 deletions .editorconfig

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Auto-detect text files and normalise line endings to LF in the repository.
* text=auto
# Auto-detect text files and use LF in both the repository and working tree.
* text=auto eol=lf

# Source code
*.cs text diff=csharp
*.xaml text
*.slnx text
*.sln text eol=crlf
*.sln text eol=lf
*.csproj text
*.props text
*.targets text
Expand All @@ -17,8 +17,8 @@
*.txt text
*.sh text eol=lf
*.ps1 text
*.cmd text eol=crlf
*.bat text eol=crlf
*.cmd text eol=lf
*.bat text eol=lf
*.config text
*.editorconfig text

Expand Down
19 changes: 10 additions & 9 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
</PropertyGroup>

<PropertyGroup Label="Shared Version Variables">
<SplatVersion>20.0.0</SplatVersion>
<SplatVersion>20.2.0</SplatVersion>
<PrimitivesVersion>7.0.0</PrimitivesVersion>
<TUnitVersion>1.61.15</TUnitVersion>
<TUnitVersion>1.61.38</TUnitVersion>
<!-- StyleSharp.Analyzers, PerformanceSharp.Analyzers and SecuritySharp.Analyzers ship from the
same release pipeline and always share a version. -->
<RoslynCommonAnalyzersVersion>3.38.1</RoslynCommonAnalyzersVersion>
<XamarinAndroidXLifecycleLiveDataVersion>2.11.0.1</XamarinAndroidXLifecycleLiveDataVersion>
</PropertyGroup>

<PropertyGroup Label="Framework-Aligned Versions">
<MauiVersion Condition="$(TargetFramework.StartsWith('net10'))">10.0.80</MauiVersion>
<MauiVersion Condition="$(TargetFramework.StartsWith('net11'))">11.0.0-preview.5.26304.4</MauiVersion>
<MauiVersion Condition="$(TargetFramework.StartsWith('net10'))">10.0.90</MauiVersion>
<MauiVersion Condition="$(TargetFramework.StartsWith('net11'))">11.0.0-preview.6.26360.8</MauiVersion>

<AspNetVersion Condition="$(TargetFramework.StartsWith('netstandard'))">3.1.32</AspNetVersion>
<AspNetVersion Condition="$(TargetFramework.StartsWith('net8'))">8.0.29</AspNetVersion>
<AspNetVersion Condition="$(TargetFramework.StartsWith('net9'))">9.0.18</AspNetVersion>
<AspNetVersion Condition="$(TargetFramework.StartsWith('net10'))">10.0.10</AspNetVersion>
<AspNetVersion Condition="$(TargetFramework.StartsWith('net11'))">11.0.0-preview.5.26302.115</AspNetVersion>
<AspNetVersion Condition="$(TargetFramework.StartsWith('net11'))">11.0.0-preview.6.26359.118</AspNetVersion>

<SystemTextJsonVersion>10.0.10</SystemTextJsonVersion>
<SystemTextJsonVersion Condition="$(TargetFramework.StartsWith('net11'))">11.0.0-preview.5.26302.115</SystemTextJsonVersion>
<SystemTextJsonVersion Condition="$(TargetFramework.StartsWith('net11'))">11.0.0-preview.6.26359.118</SystemTextJsonVersion>

<!-- Microsoft.Extensions.* and the runtime data packages track the framework: stable 10.0.x for
net8/9/10, the net11 preview on net11 so the net11 ReactiveUI.Primitives assemblies resolve. -->
Expand Down Expand Up @@ -88,7 +88,7 @@
<PackageVersion Include="PerformanceSharp.Analyzers" Version="$(RoslynCommonAnalyzersVersion)"/>
<PackageVersion Include="SecuritySharp.Analyzers" Version="$(RoslynCommonAnalyzersVersion)"/>
<PackageVersion Include="Roslynator.Analyzers" Version="4.15.0"/>
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.29.0.143774"/>
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.30.0.144632"/>
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.6.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.6.0"/>
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.6.0"/>
Expand All @@ -100,6 +100,7 @@
</ItemGroup>

<ItemGroup Label="Microsoft Extensions / Runtime / Data">
<PackageVersion Include="Microsoft.Bcl.TimeProvider" Version="10.0.10"/>
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftExtensionsVersion)"/>
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsVersion)"/>
<PackageVersion Include="System.Collections.Immutable" Version="$(MicrosoftExtensionsVersion)"/>
Expand All @@ -109,14 +110,14 @@
</ItemGroup>

<ItemGroup Label="Platform - Windows / WinUI / WPF">
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.28000.2270"/>
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.28000.2526"/>
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.3.1"/>
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="$(XamlBehaviorsWpfVersion)"/>
</ItemGroup>

<ItemGroup Label="Platform - MAUI">
<PackageVersion Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)"/>
<PackageVersion Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" Condition="$(TargetFramework.StartsWith('net10'))"/>
</ItemGroup>

<ItemGroup Label="Platform - Blazor / ASP.NET">
Expand Down
4 changes: 0 additions & 4 deletions src/Polyfills/DynamicallyAccessedMemberTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ internal enum DynamicallyAccessedMemberTypes
PublicParameterlessConstructor = 0x0001,

/// <summary>Specifies all public constructors.</summary>
[SuppressMessage(
"Roslynator",
"RCS1157:Composite enum value contains undefined flag",
Justification = "Faithful BCL polyfill.")]
PublicConstructors = 0x0002 | PublicParameterlessConstructor,

/// <summary>Specifies all non-public constructors.</summary>
Expand Down
18 changes: 9 additions & 9 deletions src/Polyfills/DynamicallyAccessedMembersAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ namespace System.Diagnostics.CodeAnalysis;
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(
validOn: Targets.Class |
Targets.Field |
Targets.GenericParameter |
Targets.Interface |
Targets.Method |
Targets.Parameter |
Targets.Property |
Targets.ReturnValue |
Targets.Struct,
validOn: Targets.Class
| Targets.Field
| Targets.GenericParameter
| Targets.Interface
| Targets.Method
| Targets.Parameter
| Targets.Property
| Targets.ReturnValue
| Targets.Struct,
Inherited = false)]
[SuppressMessage(
"Design",
Expand Down
8 changes: 2 additions & 6 deletions src/Polyfills/MemberNotNullAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(
validOn: Targets.Method |
Targets.Property,
validOn: Targets.Method
| Targets.Property,
Inherited = false,
AllowMultiple = true)]
[SuppressMessage(
"Design",
"CA1019:Define accessors for attribute arguments",
Justification = "Faithful BCL polyfill.")]
[SuppressMessage(
"Design",
"SST2312:Types should be declared in a named namespace",
Expand Down
8 changes: 4 additions & 4 deletions src/Polyfills/NotNullAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ namespace System.Diagnostics.CodeAnalysis;
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(
validOn: AttributeTargets.Field |
AttributeTargets.Parameter |
AttributeTargets.Property |
AttributeTargets.ReturnValue)]
validOn: AttributeTargets.Field
| AttributeTargets.Parameter
| AttributeTargets.Property
| AttributeTargets.ReturnValue)]
internal sealed class NotNullAttribute : Attribute;
#endif
6 changes: 3 additions & 3 deletions src/Polyfills/RequiresDynamicCodeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ namespace System.Diagnostics.CodeAnalysis;
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(
validOn: Targets.Method |
Targets.Constructor |
Targets.Class,
validOn: Targets.Method
| Targets.Constructor
| Targets.Class,
Inherited = false)]
[SuppressMessage(
"Design",
Expand Down
6 changes: 3 additions & 3 deletions src/Polyfills/RequiresUnreferencedCodeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ namespace System.Diagnostics.CodeAnalysis;
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
[AttributeUsage(
AttributeTargets.Method |
AttributeTargets.Constructor |
AttributeTargets.Class,
AttributeTargets.Method
| AttributeTargets.Constructor
| AttributeTargets.Class,
Inherited = false)]
[SuppressMessage(
"Design",
Expand Down
3 changes: 1 addition & 2 deletions src/ReactiveUI.AndroidX/ActivityResultAwaiter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ namespace ReactiveUI.AndroidX;
/// allocation-light replacement for <c>Where(...).Select(...).FirstAsync().ToTask()</c>: it is its own observer,
/// settles exactly once, and unsubscribes on completion. Shared by the AppCompat and Fragment reactive activities.
/// </summary>
internal sealed class ActivityResultAwaiter
: IObserver<(int requestCode, Result result, Intent? intent)>, IDisposable
internal sealed class ActivityResultAwaiter : IObserver<(int requestCode, Result result, Intent? intent)>, IDisposable
{
/// <summary>The request code this awaiter is waiting for.</summary>
private readonly int _requestCode;
Expand Down
10 changes: 0 additions & 10 deletions src/ReactiveUI.Blazor/Internal/ReactiveComponentState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System.Diagnostics.CodeAnalysis;

#if REACTIVE_SHIM
namespace ReactiveUI.Reactive.Blazor.Internal;
#else
Expand Down Expand Up @@ -68,10 +66,6 @@ internal sealed class ReactiveComponentState : IDisposable
/// Use this to register subscriptions that should live for the entire component lifetime.
/// All subscriptions added here will be disposed when the component is disposed.
/// </remarks>
[SuppressMessage(
"Style",
"RCS1085:Use auto-implemented property",
Justification = "Explicit field backing provides clarity and follows established pattern in this class.")]
internal MultipleDisposable LifetimeDisposables => _lifetimeDisposables;

/// <summary>Gets or sets the disposable for first-render-only subscriptions.</summary>
Expand All @@ -85,10 +79,6 @@ internal sealed class ReactiveComponentState : IDisposable
/// auto-property so it can dispose the previous subscription on assignment.
/// </para>
/// </remarks>
[SuppressMessage(
"Style",
"RCS1085:Use auto-implemented property",
Justification = "Intentional wrapper for SerialDisposable.Disposable property to ensure proper disposal semantics.")]
internal IDisposable? FirstRenderSubscriptions
{
get => _firstRenderSubscriptions;
Expand Down
3 changes: 1 addition & 2 deletions src/ReactiveUI.Blazor/ReactiveInjectableComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ namespace ReactiveUI.Blazor;
/// The <see cref="ViewModel"/> is provided via DI using <see cref="InjectAttribute"/>.
/// </para>
/// </remarks>
public class ReactiveInjectableComponentBase<T>
: ComponentBase, IViewFor<T>, INotifyPropertyChanged, IDisposable, ICanActivate
public class ReactiveInjectableComponentBase<T> : ComponentBase, IViewFor<T>, INotifyPropertyChanged, IDisposable, ICanActivate
where T : class, INotifyPropertyChanged
{
/// <summary>Encapsulates reactive state and lifecycle management for this component.</summary>
Expand Down
3 changes: 1 addition & 2 deletions src/ReactiveUI.Blazor/ReactiveLayoutComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ namespace ReactiveUI.Blazor;
/// </para>
/// </remarks>
[SuppressMessage("Usage", "BL0007:Component parameters should be auto properties", Justification = "Needed for design of the properties")]
public class ReactiveLayoutComponentBase<T>
: LayoutComponentBase, IViewFor<T>, INotifyPropertyChanged, IDisposable, ICanActivate
public class ReactiveLayoutComponentBase<T> : LayoutComponentBase, IViewFor<T>, INotifyPropertyChanged, IDisposable, ICanActivate
where T : class, INotifyPropertyChanged
{
/// <summary>Encapsulates reactive state and lifecycle management for this component.</summary>
Expand Down
3 changes: 1 addition & 2 deletions src/ReactiveUI.Blazor/ReactiveOwningComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ namespace ReactiveUI.Blazor;
/// </para>
/// </remarks>
[SuppressMessage("Usage", "BL0007:Component parameters should be auto properties", Justification = "Needed for design of the properties")]
public class ReactiveOwningComponentBase<T>
: OwningComponentBase<T>, IViewFor<T>, INotifyPropertyChanged, ICanActivate
public class ReactiveOwningComponentBase<T> : OwningComponentBase<T>, IViewFor<T>, INotifyPropertyChanged, ICanActivate
where T : class, INotifyPropertyChanged
{
/// <summary>Encapsulates reactive state and lifecycle management for this component.</summary>
Expand Down
4 changes: 2 additions & 2 deletions src/ReactiveUI.Core/Bindings/BindingTypeConverterDispatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ internal static bool TryConvert(
var runtimeType = from.GetType();
var converterFromType = converter.FromType;

if (converterFromType != runtimeType &&
Nullable.GetUnderlyingType(converterFromType) != runtimeType)
if (converterFromType != runtimeType
&& Nullable.GetUnderlyingType(converterFromType) != runtimeType)
{
result = null;
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ internal IReactiveBinding<TView, TProp> BindCommand<
TView,
TViewModel,
TProp,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.NonPublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.NonPublicEvents
| DynamicallyAccessedMemberTypes.PublicProperties)]
TControl>(
TViewModel? viewModel,
TView view,
Expand Down
18 changes: 9 additions & 9 deletions src/ReactiveUI.Core/Bindings/Command/CreatesCommandBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public static class CreatesCommandBinding
/// <exception cref="Exception">Thrown if a suitable command binder cannot be found for the specified target type.</exception>
[RequiresUnreferencedCode("String/reflection-based event binding may require members removed by trimming.")]
public static IDisposable BindCommandToObject<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.NonPublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.NonPublicEvents
| DynamicallyAccessedMemberTypes.PublicProperties)]
TControl>(ICommand? command, TControl? target, IObservable<object?> commandParameter)
where TControl : class
{
Expand Down Expand Up @@ -61,9 +61,9 @@ public static IDisposable BindCommandToObject<
"SST2307:A generic method's type parameter appears in no parameter, so no caller can infer it",
Justification = "Generic type parameter is supplied explicitly by the caller by design; it identifies the target type and cannot be inferred from the method's parameters.")]
public static IDisposable BindCommandToObject<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.NonPublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.NonPublicEvents
| DynamicallyAccessedMemberTypes.PublicProperties)]
TControl, TEventArgs>(
ICommand? command,
TControl? target,
Expand All @@ -83,9 +83,9 @@ public static IDisposable BindCommandToObject<
/// <returns>An instance of ICreatesCommandBinding that is best suited for the specified target type.</returns>
/// <exception cref="Exception">Thrown if no suitable command binding provider can be found for the specified target type.</exception>
private static ICreatesCommandBinding GetBinder<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.NonPublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.NonPublicEvents
| DynamicallyAccessedMemberTypes.PublicProperties)]
T>(bool hasEventTarget)
{
var bestScore = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public sealed class CreatesCommandBindingViaCommandParameter : ICreatesCommandBi
/// Otherwise, it returns 5 if the target type exposes the required public instance properties; otherwise it returns 0.
/// </remarks>
public int GetAffinityForObject<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.PublicProperties)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.PublicProperties)]
T>(bool hasEventTarget)
{
if (hasEventTarget)
Expand Down Expand Up @@ -66,9 +66,9 @@ public int GetAffinityForObject<
/// </remarks>
[RequiresUnreferencedCode("String/reflection-based event binding may require members removed by trimming.")]
public IDisposable? BindCommandToObject<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties |
DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.NonPublicEvents)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties
| DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.NonPublicEvents)]
T>(
ICommand? command,
T? target,
Expand Down Expand Up @@ -120,9 +120,9 @@ public IDisposable? BindCommandToObject<
/// should be used. This method therefore returns <see cref="EmptyDisposable"/>.
/// </remarks>
public IDisposable? BindCommandToObject<
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties |
DynamicallyAccessedMemberTypes.PublicEvents |
DynamicallyAccessedMemberTypes.NonPublicEvents)]
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties
| DynamicallyAccessedMemberTypes.PublicEvents
| DynamicallyAccessedMemberTypes.NonPublicEvents)]
T, TEventArgs>(
ICommand? command,
T? target,
Expand Down Expand Up @@ -196,15 +196,15 @@ private static void ResolveProperties(
var p = properties[i];
var name = p.Name;

if (command is null &&
string.Equals(name, CommandPropertyName, StringComparison.Ordinal))
if (command is null
&& string.Equals(name, CommandPropertyName, StringComparison.Ordinal))
{
command = p;
continue;
}

if (commandParameter is null &&
string.Equals(name, CommandParameterPropertyName, StringComparison.Ordinal))
if (commandParameter is null
&& string.Equals(name, CommandParameterPropertyName, StringComparison.Ordinal))
{
commandParameter = p;
}
Expand Down
Loading
Loading