Skip to content

Commit

Permalink
Merge pull request #32 from wieslawsoltes/FixUseBackingFields
Browse files Browse the repository at this point in the history
Fix UseBackingFields
  • Loading branch information
wieslawsoltes authored Dec 25, 2024
2 parents 0d92d69 + 473d717 commit b592c4b
Show file tree
Hide file tree
Showing 17 changed files with 1,728 additions and 16 deletions.
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
}
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
}
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
}
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
}
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
}
Loading

0 comments on commit b592c4b

Please sign in to comment.