-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from wieslawsoltes/FixUseBackingFields
Fix UseBackingFields
- Loading branch information
Showing
17 changed files
with
1,728 additions
and
16 deletions.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
...ots/UseBackingFieldsConfigurationTests.UseBackingFields_BothFormats_BothTrue.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
Sources: [ | ||
{ | ||
FileName: IgnoreReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
sealed class IgnoreReactiveAttribute : Attribute | ||
{ | ||
public IgnoreReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: ReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = true, AllowMultiple = false)] | ||
sealed class ReactiveAttribute : Attribute | ||
{ | ||
public ReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: TestClass.INPC.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
public partial class TestClass : INotifyPropertyChanged | ||
{ | ||
public event PropertyChangedEventHandler? PropertyChanged; | ||
|
||
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args) | ||
{ | ||
PropertyChanged?.Invoke(this, args); | ||
} | ||
} | ||
|
||
}, | ||
{ | ||
FileName: TestClass.ReactiveProperties.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// A partial class implementation for TestClass. | ||
/// </summary> | ||
public partial class TestClass | ||
{ | ||
private string _name; | ||
|
||
private static readonly PropertyChangedEventArgs _nameChangedEventArgs = new PropertyChangedEventArgs(nameof(Name)); | ||
|
||
public partial string Name | ||
{ | ||
get => _name; | ||
set | ||
{ | ||
if (!Equals(_name, value)) | ||
{ | ||
_name = value; | ||
OnPropertyChanged(_nameChangedEventArgs); | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
], | ||
Diagnostics: null | ||
} |
85 changes: 85 additions & 0 deletions
85
...kingFieldsConfigurationTests.UseBackingFields_BothFormats_NewTakesPrecedence.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
Sources: [ | ||
{ | ||
FileName: IgnoreReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
sealed class IgnoreReactiveAttribute : Attribute | ||
{ | ||
public IgnoreReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: ReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = true, AllowMultiple = false)] | ||
sealed class ReactiveAttribute : Attribute | ||
{ | ||
public ReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: TestClass.INPC.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
public partial class TestClass : INotifyPropertyChanged | ||
{ | ||
public event PropertyChangedEventHandler? PropertyChanged; | ||
|
||
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args) | ||
{ | ||
PropertyChanged?.Invoke(this, args); | ||
} | ||
} | ||
|
||
}, | ||
{ | ||
FileName: TestClass.ReactiveProperties.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// A partial class implementation for TestClass. | ||
/// </summary> | ||
public partial class TestClass | ||
{ | ||
private string _name; | ||
|
||
private static readonly PropertyChangedEventArgs _nameChangedEventArgs = new PropertyChangedEventArgs(nameof(Name)); | ||
|
||
public partial string Name | ||
{ | ||
get => _name; | ||
set | ||
{ | ||
if (!Equals(_name, value)) | ||
{ | ||
_name = value; | ||
OnPropertyChanged(_nameChangedEventArgs); | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
], | ||
Diagnostics: null | ||
} |
60 changes: 60 additions & 0 deletions
60
...eBackingFieldsConfigurationTests.UseBackingFields_CrossAssembly_LegacyFormat.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
Sources: [ | ||
{ | ||
FileName: DerivedClass.ReactiveProperties.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// A partial class implementation for DerivedClass. | ||
/// </summary> | ||
public partial class DerivedClass | ||
{ | ||
private string _localProp; | ||
|
||
private static readonly PropertyChangedEventArgs _localPropChangedEventArgs = new PropertyChangedEventArgs(nameof(LocalProp)); | ||
|
||
public partial string LocalProp | ||
{ | ||
get => _localProp; | ||
set | ||
{ | ||
if (!Equals(_localProp, value)) | ||
{ | ||
_localProp = value; | ||
OnPropertyChanged(_localPropChangedEventArgs); | ||
} | ||
} | ||
} | ||
} | ||
|
||
}, | ||
{ | ||
FileName: IgnoreReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
sealed class IgnoreReactiveAttribute : Attribute | ||
{ | ||
public IgnoreReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: ReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = true, AllowMultiple = false)] | ||
sealed class ReactiveAttribute : Attribute | ||
{ | ||
public ReactiveAttribute() { } | ||
} | ||
} | ||
], | ||
Diagnostics: null | ||
} |
60 changes: 60 additions & 0 deletions
60
.../UseBackingFieldsConfigurationTests.UseBackingFields_CrossAssembly_NewFormat.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
Sources: [ | ||
{ | ||
FileName: DerivedClass.ReactiveProperties.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// A partial class implementation for DerivedClass. | ||
/// </summary> | ||
public partial class DerivedClass | ||
{ | ||
private string _localProp; | ||
|
||
private static readonly PropertyChangedEventArgs _localPropChangedEventArgs = new PropertyChangedEventArgs(nameof(LocalProp)); | ||
|
||
public partial string LocalProp | ||
{ | ||
get => _localProp; | ||
set | ||
{ | ||
if (!Equals(_localProp, value)) | ||
{ | ||
_localProp = value; | ||
OnPropertyChanged(_localPropChangedEventArgs); | ||
} | ||
} | ||
} | ||
} | ||
|
||
}, | ||
{ | ||
FileName: IgnoreReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
sealed class IgnoreReactiveAttribute : Attribute | ||
{ | ||
public IgnoreReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: ReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = true, AllowMultiple = false)] | ||
sealed class ReactiveAttribute : Attribute | ||
{ | ||
public ReactiveAttribute() { } | ||
} | ||
} | ||
], | ||
Diagnostics: null | ||
} |
83 changes: 83 additions & 0 deletions
83
...eBackingFieldsConfigurationTests.UseBackingFields_EmptyValue_DefaultsToFalse.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ | ||
Sources: [ | ||
{ | ||
FileName: IgnoreReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | ||
sealed class IgnoreReactiveAttribute : Attribute | ||
{ | ||
public IgnoreReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: ReactiveAttribute.g.cs, | ||
Source: | ||
using System; | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = true, AllowMultiple = false)] | ||
sealed class ReactiveAttribute : Attribute | ||
{ | ||
public ReactiveAttribute() { } | ||
} | ||
}, | ||
{ | ||
FileName: TestClass.INPC.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
public partial class TestClass : INotifyPropertyChanged | ||
{ | ||
public event PropertyChangedEventHandler? PropertyChanged; | ||
|
||
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
|
||
protected virtual void OnPropertyChanged(PropertyChangedEventArgs args) | ||
{ | ||
PropertyChanged?.Invoke(this, args); | ||
} | ||
} | ||
|
||
}, | ||
{ | ||
FileName: TestClass.ReactiveProperties.g.cs, | ||
Source: | ||
// <auto-generated/> | ||
#nullable enable | ||
|
||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
|
||
/// <summary> | ||
/// A partial class implementation for TestClass. | ||
/// </summary> | ||
public partial class TestClass | ||
{ | ||
private static readonly PropertyChangedEventArgs _nameChangedEventArgs = new PropertyChangedEventArgs(nameof(Name)); | ||
|
||
public partial string Name | ||
{ | ||
get => field; | ||
set | ||
{ | ||
if (!Equals(field, value)) | ||
{ | ||
field = value; | ||
OnPropertyChanged(_nameChangedEventArgs); | ||
} | ||
} | ||
} | ||
} | ||
|
||
} | ||
], | ||
Diagnostics: null | ||
} |
Oops, something went wrong.