48 lines
976 B
C#
48 lines
976 B
C#
using System.ComponentModel;
|
|
|
|
namespace ModpackUpdater.Apps.Manager.Ui.Models;
|
|
|
|
public class ProgressInfos : INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
public bool IsVisible { get; set; }
|
|
public bool IsGeneric { get; set; }
|
|
public bool ShowText { get; set; }
|
|
public double MaxValue { get; set; }
|
|
public double Value { get; set; }
|
|
|
|
public void Start(int maxValue)
|
|
{
|
|
IsGeneric = false;
|
|
Value = 0;
|
|
MaxValue = maxValue;
|
|
ShowText = true;
|
|
IsVisible = true;
|
|
}
|
|
|
|
public void Start()
|
|
{
|
|
ShowText = false;
|
|
IsGeneric = true;
|
|
IsVisible = true;
|
|
}
|
|
|
|
public void Set(int value)
|
|
{
|
|
if (!IsGeneric)
|
|
Value = value;
|
|
}
|
|
|
|
public void Increment()
|
|
{
|
|
if (!IsGeneric)
|
|
Value += 1;
|
|
}
|
|
|
|
public void End()
|
|
{
|
|
IsVisible = false;
|
|
IsGeneric = false;
|
|
}
|
|
} |