wabbajack/Wabbajack/View Models/CPUDisplayVM.cs

49 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2020-01-10 04:27:59 +00:00
using ReactiveUI.Fody.Helpers;
using Wabbajack.Common;
2020-01-10 04:27:59 +00:00
using Wabbajack.Lib;
namespace Wabbajack
{
2020-01-10 04:27:59 +00:00
public class CPUDisplayVM : ViewModel
{
2020-01-10 04:27:59 +00:00
[Reactive]
public int ID { get; set; }
[Reactive]
public DateTime StartTime { get; set; }
2020-01-10 04:27:59 +00:00
[Reactive]
public bool IsWorking { get; set; }
[Reactive]
public string Msg { get; set; }
[Reactive]
public float ProgressPercent { get; set; }
public CPUDisplayVM()
{
}
public CPUDisplayVM(CPUStatus cpu)
{
AbsorbStatus(cpu);
}
public void AbsorbStatus(CPUStatus cpu)
{
2020-01-10 04:27:59 +00:00
bool starting = cpu.IsWorking && !IsWorking;
if (starting)
{
StartTime = DateTime.Now;
}
2020-01-10 04:27:59 +00:00
ID = cpu.ID;
Msg = cpu.Msg;
ProgressPercent = cpu.ProgressPercent;
IsWorking = cpu.IsWorking;
}
}
}