forked from Eauldane/SnowcloakClient
Initial
This commit is contained in:
22
MareSynchronos/Utils/ValueProgress.cs
Normal file
22
MareSynchronos/Utils/ValueProgress.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace MareSynchronos.Utils;
|
||||
|
||||
public class ValueProgress<T> : Progress<T>
|
||||
{
|
||||
public T? Value { get; set; }
|
||||
|
||||
protected override void OnReport(T value)
|
||||
{
|
||||
base.OnReport(value);
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public void Report(T value)
|
||||
{
|
||||
OnReport(value);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
Value = default;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user