Skip to content

Commit

Permalink
Remove Fody since it's a bit overkill for a single property
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed Mar 18, 2024
1 parent 7360adb commit d57a387
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 80 deletions.
4 changes: 0 additions & 4 deletions Gress/FodyWeavers.xml

This file was deleted.

74 changes: 0 additions & 74 deletions Gress/FodyWeavers.xsd

This file was deleted.

1 change: 0 additions & 1 deletion Gress/Gress.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<PackageReference Include="CSharpier.MsBuild" Version="0.27.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="PolyShim" Version="1.10.0" PrivateAssets="all" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="all" />
</ItemGroup>

</Project>
14 changes: 13 additions & 1 deletion Gress/ProgressContainer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;

Expand Down Expand Up @@ -27,7 +28,18 @@ public ProgressContainer()
/// If this property is accessed before any progress has been reported,
/// it will evaluate to the initial value provided by the constructor.
/// </remarks>
public T Current { get; private set; } = initial;
public T Current
{
get => initial;
private set
{
if (EqualityComparer<T>.Default.Equals(value, initial))
return;

initial = value;
OnPropertyChanged();
}
}

/// <inheritdoc />
public void Report(T value) => Current = value;
Expand Down

0 comments on commit d57a387

Please sign in to comment.