Skip to content

Commit

Permalink
Fix For ReactiveCommand With Nested Classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed Jan 5, 2025
1 parent 725bb73 commit 0dc417a
Show file tree
Hide file tree
Showing 43 changed files with 482 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ObservableAsPropertyAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace TestNs
{
/// <summary>
/// <summary>
/// Partial class for the TestVM which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestVM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace TestNs
{
/// <summary>
/// <summary>
/// Partial class for the TestVM which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestVM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace TestNs
{
/// <summary>
/// <summary>
/// Partial class for the TestVM which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestVM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace TestNs
{
/// <summary>
/// <summary>
/// Partial class for the TestVM which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestVM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs
// Copyright (c) 2024 .NET Foundation and Contributors. All rights reserved.
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace TestNs1
{
/// <summary>
/// <summary>
/// Partial class for the TestVM which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestVM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace TestNs2
{
/// <summary>
/// <summary>
/// Partial class for the TestVM which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestVM
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//HintName: ReactiveUI.SourceGenerators.AccessModifier.g.cs
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

// <auto-generated/>
#pragma warning disable
#nullable enable
namespace ReactiveUI.SourceGenerators;

/// <summary>
/// AccessModifier.
/// </summary>
internal enum AccessModifier
{
Public,
Protected,
Internal,
Private,
InternalProtected,
PrivateProtected,
}

/// <summary>
/// InheritanceModifier.
/// </summary>
internal enum InheritanceModifier
{
None,
Virtual,
Override,
New,
}
#nullable restore
#pragma warning restore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//HintName: ReactiveUI.SourceGenerators.ReactiveAttribute.g.cs
// Copyright (c) 2025 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// 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;

// <auto-generated/>
#pragma warning disable
#nullable enable
namespace ReactiveUI.SourceGenerators;

/// <summary>
/// ReactiveAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveAttribute : Attribute
{
/// <summary>
/// Gets the AccessModifier of the set property.
/// </summary>
/// <value>
/// The AccessModifier of the set property.
/// </value>
public AccessModifier SetModifier { get; init; }

/// <summary>
/// Gets the InheritanceModifier of the property.
/// </sumary>
public InheritanceModifier Inheritance { get; init; }
}
#nullable restore
#pragma warning restore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//HintName: TestNs1.TestViewModel3+TestInnerClass1.Properties.g.cs
// <auto-generated/>
using ReactiveUI;

#pragma warning disable
#nullable enable

namespace TestNs1
{
public partial class TestViewModel3
{
/// <summary>
/// Partial class for the TestInnerClass1 which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestInnerClass1
{
/// <inheritdoc cref="_testInner1"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int TestInner1
{
get => _testInner1;
[global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner1")]
set => this.RaiseAndSetIfChanged(ref _testInner1, value);
}

/// <inheritdoc cref="_testInner11"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int TestInner11
{
get => _testInner11;
[global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner11")]
set => this.RaiseAndSetIfChanged(ref _testInner11, value);
}
}
}

}
#nullable restore
#pragma warning restore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//HintName: TestNs1.TestViewModel3+TestInnerClass2+TestInnerClass3.Properties.g.cs
// <auto-generated/>
using ReactiveUI;

#pragma warning disable
#nullable enable

namespace TestNs1
{
public partial class TestViewModel3
{
public partial class TestInnerClass2
{
/// <summary>
/// Partial class for the TestInnerClass3 which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestInnerClass3
{
/// <inheritdoc cref="_testInner3"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int TestInner3
{
get => _testInner3;
[global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner3")]
set => this.RaiseAndSetIfChanged(ref _testInner3, value);
}

/// <inheritdoc cref="_testInner33"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int TestInner33
{
get => _testInner33;
[global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner33")]
set => this.RaiseAndSetIfChanged(ref _testInner33, value);
}
}
}
}

}
#nullable restore
#pragma warning restore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//HintName: TestNs1.TestViewModel3+TestInnerClass2.Properties.g.cs
// <auto-generated/>
using ReactiveUI;

#pragma warning disable
#nullable enable

namespace TestNs1
{
public partial class TestViewModel3
{
/// <summary>
/// Partial class for the TestInnerClass2 which contains ReactiveUI Reactive property initialization.
/// </summary>
public partial class TestInnerClass2
{
/// <inheritdoc cref="_testInner2"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int TestInner2
{
get => _testInner2;
[global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner2")]
set => this.RaiseAndSetIfChanged(ref _testInner2, value);
}

/// <inheritdoc cref="_testInner22"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int TestInner22
{
get => _testInner22;
[global::System.Diagnostics.CodeAnalysis.MemberNotNull("_testInner22")]
set => this.RaiseAndSetIfChanged(ref _testInner22, value);
}
}
}

}
#nullable restore
#pragma warning restore
Loading

0 comments on commit 0dc417a

Please sign in to comment.