diff --git a/MP-TAB-SERV/Components/SelTempoMSMC.razor b/MP-TAB-SERV/Components/SelTempoMSMC.razor
index d9cf2a1a..3dc5f765 100644
--- a/MP-TAB-SERV/Components/SelTempoMSMC.razor
+++ b/MP-TAB-SERV/Components/SelTempoMSMC.razor
@@ -1,13 +1,13 @@
-
*@
- @if (modoControllo == timeControlMode.testo)
+ @if (tcMode == "mc")
{
Tempo
diff --git a/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs b/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs
index 0514eb86..c1efc09e 100644
--- a/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs
+++ b/MP-TAB-SERV/Components/SelTempoMSMC.razor.cs
@@ -85,10 +85,10 @@ namespace MP_TAB_SERV.Components
///
protected double _tempoMC { get; set; } = 0;
- protected timeMode modoTempo
- {
- get => ShowMS ? timeMode.MS : timeMode.MC;
- }
+ //protected timeMode modoTempo
+ //{
+ // get => ShowMS ? timeMode.MS : timeMode.MC;
+ //}
///
/// tempo selezionato in formato Minuti Secondi
@@ -107,6 +107,13 @@ namespace MP_TAB_SERV.Components
[Inject]
protected SharedMemService SMServ { get; set; } = null!;
+ [Inject]
+ protected MessageService MsgServ { get; set; } = null!;
+
+ protected string tcMode
+ {
+ get => MsgServ.UserPrefGet("TcMode");
+ }
///
/// tempo selezionato in formato Minuti Secondi
@@ -193,7 +200,7 @@ namespace MP_TAB_SERV.Components
get
{
string answ = "";
- if (modoTempo == timeMode.MC)
+ if (tcMode == "mc")
{
answ = "min.cent";
}
@@ -209,7 +216,7 @@ namespace MP_TAB_SERV.Components
{
get
{
- string answ = modoTempo == timeMode.MC ? $"--> {TempoMS.TotalMinutes:N0}:{TempoMS:ss} (min:sec)" : $"--> {TempoMC:0.000} (min.cent)";
+ string answ = tcMode == "ms" ? $"--> {TempoMS.TotalMinutes:N0}:{TempoMS:ss} (min:sec)" : $"--> {TempoMC:0.000} (min.cent)";
return answ;
}
}
@@ -218,12 +225,12 @@ namespace MP_TAB_SERV.Components
{
get
{
- string answ = modoTempo == timeMode.MC ? $"{TempoMC:0.000}" : $"{TempoMS.TotalMinutes:N0}:{TempoMS:ss}";
+ string answ = tcMode == "mc" ? $"{TempoMC:0.000}" : $"{TempoMS.TotalMinutes:N0}:{TempoMS:ss}";
return answ;
}
set
{
- if (modoTempo == timeMode.MC)
+ if (tcMode == "mc")
{
double tMC = 1;
double.TryParse(value, out tMC);
diff --git a/MP-TAB-SERV/Pages/User.razor b/MP-TAB-SERV/Pages/User.razor
index 69c0122d..9926fb98 100644
--- a/MP-TAB-SERV/Pages/User.razor
+++ b/MP-TAB-SERV/Pages/User.razor
@@ -43,6 +43,17 @@
+
@code {
+ [Inject]
+ private MessageService MsgServ { get; set; } = null!;
+
+ protected async Task setTcMode(string tcMode)
+ {
+ await Task.Delay(1);
+ tcModIns = tcMode;
+ }
+
+ protected string btnMsStyle
+ {
+ get
+ {
+ string answ = "";
+ if(tcModIns == "ms")
+ {
+ answ = "btn-primary";
+ }
+ else
+ {
+ answ = "btn-secondary";
+ }
+ return answ;
+ }
+ }
+ protected string btnMcStyle
+ {
+ get
+ {
+ string answ = "";
+ if(tcModIns == "mc")
+ {
+ answ = "btn-primary";
+ }
+ else
+ {
+ answ = "btn-secondary";
+ }
+ return answ;
+ }
+ }
+
+ protected string _tcModIns { get; set; } = "";
+
+ protected string tcModIns
+ {
+ get => _tcModIns;
+ set
+ {
+ if(_tcModIns != value)
+ {
+ _tcModIns = value;
+ MsgServ.UserPrefSave("TcMode", value);
+ }
+ }
+ }
+
public int Height { get; set; } = 0;
public int Width { get; set; } = 0;
public string currIpv4 { get; set; } = "";
@@ -82,6 +150,11 @@
}
protected async override Task OnInitializedAsync()
{
+ var tcPrefItem = MsgServ.UserPrefGet("TcMode");
+ if(tcPrefItem != null)
+ {
+ tcModIns = tcPrefItem;
+ }
await Task.Delay(1);
if (string.IsNullOrEmpty(currIpv4))
{
diff --git a/MP.Data/Services/MessageService.cs b/MP.Data/Services/MessageService.cs
index b1b6fb55..6d751191 100644
--- a/MP.Data/Services/MessageService.cs
+++ b/MP.Data/Services/MessageService.cs
@@ -372,8 +372,8 @@ namespace MP.Data.Services
else
{
currDict.Add(chiave, valore);
- UsersPrefDict = currDict;
}
+ UsersPrefDict = currDict;
return done;
}