Skip to content

Commit

Permalink
Merge pull request #30 from wieslawsoltes/CrossAssembly
Browse files Browse the repository at this point in the history
Cross assembly support
  • Loading branch information
wieslawsoltes authored Dec 25, 2024
2 parents e3baf32 + 701ef03 commit 1a5c2de
Show file tree
Hide file tree
Showing 82 changed files with 1,563 additions and 175 deletions.
491 changes: 491 additions & 0 deletions ReactiveGenerator.Tests/CrossAssemblyTests.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
Sources: [
{
FileName: IgnoreReactiveAttribute.g.cs,
Source:
using System;

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
sealed class IgnoreReactiveAttribute : Attribute
{
public IgnoreReactiveAttribute() { }
}
},
{
FileName: MainLib.DerivedClass.INPC.g.cs,
Source:
// <auto-generated/>
#nullable enable

using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace MainLib
{
public partial class DerivedClass : 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: MainLib.DerivedClass.ReactiveProperties.g.cs,
Source:
// <auto-generated/>
#nullable enable

using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace MainLib
{
/// <summary>
/// A partial class implementation for MainLib.DerivedClass.
/// </summary>
public partial class DerivedClass
{
private static readonly PropertyChangedEventArgs _reactivePropChangedEventArgs = new PropertyChangedEventArgs(nameof(ReactiveProp));

public partial string ReactiveProp
{
get => field;
set
{
if (!Equals(field, value))
{
field = value;
OnPropertyChanged(_reactivePropChangedEventArgs);
}
}
}
}
}

},
{
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,89 @@
{
Sources: [
{
FileName: IgnoreReactiveAttribute.g.cs,
Source:
using System;

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
sealed class IgnoreReactiveAttribute : Attribute
{
public IgnoreReactiveAttribute() { }
}
},
{
FileName: MainLib.DerivedClass.INPC.g.cs,
Source:
// <auto-generated/>
#nullable enable

using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace MainLib
{
public partial class DerivedClass : 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: MainLib.DerivedClass.ReactiveProperties.g.cs,
Source:
// <auto-generated/>
#nullable enable

using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace MainLib
{
/// <summary>
/// A partial class implementation for MainLib.DerivedClass.
/// </summary>
public partial class DerivedClass
{
private static readonly PropertyChangedEventArgs _derivedPropChangedEventArgs = new PropertyChangedEventArgs(nameof(DerivedProp));

public partial string DerivedProp
{
get => field;
set
{
if (!Equals(field, value))
{
field = value;
OnPropertyChanged(_derivedPropChangedEventArgs);
}
}
}
}
}

},
{
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,75 @@
{
Sources: [
{
FileName: IgnoreReactiveAttribute.g.cs,
Source:
using System;

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
sealed class IgnoreReactiveAttribute : Attribute
{
public IgnoreReactiveAttribute() { }
}
},
{
FileName: MainLib.DerivedClass.ReactiveProperties.g.cs,
Source:
// <auto-generated/>
#nullable enable

using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace MainLib
{
/// <summary>
/// A partial class implementation for MainLib.DerivedClass.
/// </summary>
public partial class DerivedClass
{
private static readonly PropertyChangedEventArgs _virtualPropChangedEventArgs = new PropertyChangedEventArgs(nameof(VirtualProp));
private static readonly PropertyChangedEventArgs _derivedPropChangedEventArgs = new PropertyChangedEventArgs(nameof(DerivedProp));

public partial string VirtualProp
{
get => field;
set
{
if (!Equals(field, value))
{
field = value;
OnPropertyChanged(_virtualPropChangedEventArgs);
}
}
}

public partial string DerivedProp
{
get => field;
set
{
if (!Equals(field, value))
{
field = value;
OnPropertyChanged(_derivedPropChangedEventArgs);
}
}
}
}
}

},
{
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,27 @@
{
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() { }
}
}
],
Diagnostics: null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
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() { }
}
}
],
Diagnostics: null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
Sources: [
{
FileName: IgnoreReactiveAttribute.g.cs,
Source:
using System;

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
sealed class IgnoreReactiveAttribute : Attribute
{
public IgnoreReactiveAttribute() { }
}
},
{
FileName: MainLib.DerivedClass.ReactiveProperties.g.cs,
Source:
// <auto-generated/>
#nullable enable

using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace MainLib
{
/// <summary>
/// A partial class implementation for MainLib.DerivedClass.
/// </summary>
public partial class DerivedClass
{
private static readonly PropertyChangedEventArgs _inheritedReactivePropChangedEventArgs = new PropertyChangedEventArgs(nameof(InheritedReactiveProp));
private static readonly PropertyChangedEventArgs _explicitReactivePropChangedEventArgs = new PropertyChangedEventArgs(nameof(ExplicitReactiveProp));

public partial string InheritedReactiveProp
{
get => field;
set
{
if (!Equals(field, value))
{
field = value;
OnPropertyChanged(_inheritedReactivePropChangedEventArgs);
}
}
}

public partial string ExplicitReactiveProp
{
get => field;
set
{
if (!Equals(field, value))
{
field = value;
OnPropertyChanged(_explicitReactivePropChangedEventArgs);
}
}
}
}
}

},
{
FileName: ReactiveAttribute.g.cs,
Source:
using System;

[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
sealed class ReactiveAttribute : Attribute
{
public ReactiveAttribute() { }
}
}
],
Diagnostics: null
}
Loading

0 comments on commit 1a5c2de

Please sign in to comment.