using Microsoft.AspNetCore.Components; using MP.MONO.Core.DTO; using System.Diagnostics.Tracing; namespace MP.MONO.UI.Components { public partial class DisplayRecordComponent { #region Public Properties [Parameter] public DisplayDataDTO? currRecord { get; set; } = null; [Parameter] public List SelVal { get; set; } = new List(); #endregion Public Properties #region Protected Methods protected string percProgress(double num, double minVal, double maxVal) { string answ = "width: 0%;"; double den = (maxVal - minVal) != 0 ? (maxVal - minVal) : 1; double ratio = ((double)num) / den; answ = $"width: {ratio:P0};"; return answ; } protected string cssLast(string toolName) { string answ = SelVal.Contains(toolName) ? "bg-dark text-light" : ""; // se è ultima testo giallo... if (SelVal != null && SelVal.Count > 0) { var ultimo = SelVal.LastOrDefault(); if (ultimo != null && ultimo.Equals(toolName)) { answ = "bg-dark text-warning"; } } return answ; } #endregion Protected Methods } }