Files
webwindowconfigurator/WebWindowComplex/Compo/CardFill.razor.cs
T
Annamaria Sassi fad95d22b6 Correzioni
2025-10-22 16:48:04 +02:00

140 lines
3.9 KiB
C#

using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
using static WebWindowComplex.Json.WindowConst;
namespace WebWindowComplex.Compo
{
public partial class CardFill
{
#region Public Properties
/// <summary>
/// Indice del fill corrente rispetto alla lista fill
/// </summary>
[Parameter]
public int CurrIndex { get; set; } = 0;
/// <summary>
/// Fill corrente rispetto alla lista fill
/// </summary>
[Parameter]
public Fill CurrItem { get; set; } = null!;
/// <summary>
/// Evento per cambiare tutti i fill
/// </summary>
[Parameter]
public EventCallback<FillTypes> EC_ChangeAllType { get; set; }
/// <summary>
/// Evento per cambiare solo il fill corrente
/// </summary>
[Parameter]
public EventCallback<FillTypes> EC_ChangeType { get; set; }
/// <summary>
/// Evento per copiare sash
/// </summary>
[Parameter]
public EventCallback<DataAreaSplit> EC_CopySash { get; set; }
/// <summary>
/// Evento per aggiungere sash
/// </summary>
[Parameter]
public EventCallback<DataAreaSplitted> EC_AddSash { get; set; }
/// <summary>
/// Evento per tornare nella pagine Tree
/// </summary>
[Parameter]
public EventCallback<bool> EC_ReqClose { get; set; }
/// <summary>
/// Lista dei Fill
/// </summary>
[Parameter]
public List<Fill> FillList { get; set; } = null!;
/// <summary>
/// Lista delle sash
/// </summary>
[Parameter]
public List<Sash> SashList { get; set; } = null!;
/// <summary>
/// Lista degli Splitted
/// </summary>
[Parameter]
public List<Splitted> SplittedList { get; set; } = null!;
#endregion Public Properties
#region Protected Methods
/// <summary>
/// Sollevo evento per cambiare tutti i Fill
/// </summary>
/// <param name="reqFillType"> tipo di fill richiesto </param>
/// <returns></returns>
protected async Task ChangeAllFill(FillTypes reqFillType)
{
await EC_ChangeAllType.InvokeAsync(reqFillType);
}
/// <summary>
/// Sollevo evento per cambiare solo il Fill corrente
/// </summary>
/// <param name="reqFillType"> tipo di fill richiesto </param>
/// <returns></returns>
protected async Task ChangeOneFill(FillTypes reqFillType)
{
await EC_ChangeType.InvokeAsync(reqFillType);
}
/// <summary>
/// Sollevo evento per copiare sash
/// </summary>
/// <param name="Args"></param>
/// <returns></returns>
protected async Task CopySash(DataAreaSplit Args)
{
await EC_CopySash.InvokeAsync(Args);
}
/// <summary>
/// Sollevo evento per aggiungere sash
/// </summary>
/// <param name="Args"></param>
/// <returns></returns>
protected async Task AddSash(DataAreaSplitted Args)
{
await EC_AddSash.InvokeAsync(Args);
}
#endregion Protected Methods
#region Private Methods
/// <summary>
/// Sollevo evento per tornare alla pagina Tree
/// </summary>
private void ReqClose()
{
_ = EC_ReqClose.InvokeAsync(true);
}
/// <summary>
/// Calcola bottone selezionato per il Fill
/// </summary>
/// <returns></returns>
private string buttonFillCss(FillTypes reqFillTypes)
{
return (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm";
}
#endregion Private Methods
}
}