2022-08-30 15:42:25 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2024-04-09 12:53:23 +02:00
|
|
|
|
namespace SharedGui.ViewModel
|
2022-08-30 15:42:25 +02:00
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
|
public enum ChargingState
|
|
|
|
|
{
|
|
|
|
|
Loaded,
|
|
|
|
|
Empty
|
|
|
|
|
}
|
2022-08-30 15:42:25 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
public class Bar
|
|
|
|
|
{
|
|
|
|
|
public Bar(ChargingState? state = null)
|
|
|
|
|
{
|
|
|
|
|
State = state;
|
|
|
|
|
}
|
2022-08-30 15:42:25 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether bar is charged or not. Null if state is unknown.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public ChargingState? State { get; private set; } = null;
|
2022-08-30 15:42:25 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
public string Text
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (State == null)
|
|
|
|
|
return string.Empty;
|
2022-08-30 15:42:25 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
return State == ChargingState.Loaded ? " + " : " - ";
|
|
|
|
|
}
|
2022-08-30 15:42:25 +02:00
|
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-08-30 15:42:25 +02:00
|
|
|
|
}
|