160 lines
4.8 KiB
C#
160 lines
4.8 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using WebWindowComplex.Models;
|
|
|
|
namespace WebWindowComplex.Compo
|
|
{
|
|
public partial class EditElement
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// Joint corrente
|
|
/// </summary>
|
|
[Parameter]
|
|
public ElementDimension CurrRec { get; set; } = null!;
|
|
|
|
|
|
[Parameter]
|
|
public EventCallback<ElementDimension> EC_Update { get; set; }
|
|
|
|
[Parameter]
|
|
public bool IsBottomRail { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Livello di accesso (utente base)
|
|
/// </summary>
|
|
[CascadingParameter(Name = "User")]
|
|
public bool User { get; set; } = false!;
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Private Properties
|
|
/// <summary>
|
|
/// Metodo per aggiornare nome element corrente
|
|
/// </summary>
|
|
private string name()
|
|
{
|
|
if (IsBottomRail)
|
|
{
|
|
return CurrRec.nIndex.ToString();
|
|
}
|
|
else
|
|
{
|
|
int nElement = 0;
|
|
if (CurrRec.ParentArea is Frame frame)
|
|
nElement = frame.ElementDimensionList.Count;
|
|
else if(CurrRec.ParentArea is Sash sash)
|
|
nElement = sash.SashList.FirstOrDefault()!.ElementDimensionList.Count;
|
|
switch (nElement)
|
|
{
|
|
case 4:
|
|
{
|
|
switch (CurrRec.nIndex)
|
|
{
|
|
case 1:
|
|
{
|
|
return "B";
|
|
}
|
|
case 2:
|
|
{
|
|
return "R";
|
|
}
|
|
case 3:
|
|
{
|
|
return "T";
|
|
}
|
|
case 4:
|
|
{
|
|
return "L";
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case 5:
|
|
{
|
|
switch (CurrRec.nIndex)
|
|
{
|
|
case 1:
|
|
{
|
|
return "B";
|
|
}
|
|
case 2:
|
|
{
|
|
return "R";
|
|
}
|
|
case 3:
|
|
{
|
|
return "TR";
|
|
}
|
|
case 4:
|
|
{
|
|
return "TL";
|
|
}
|
|
case 5:
|
|
{
|
|
return "L";
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case 6:
|
|
{
|
|
switch (CurrRec.nIndex)
|
|
{
|
|
case 1:
|
|
{
|
|
return "B";
|
|
}
|
|
case 2:
|
|
{
|
|
return "R";
|
|
}
|
|
case 3:
|
|
{
|
|
return "TR";
|
|
}
|
|
case 4:
|
|
{
|
|
return "TT";
|
|
}
|
|
case 5:
|
|
{
|
|
return "TL";
|
|
}
|
|
case 6:
|
|
{
|
|
return "L";
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
return "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Metodo per aggiornare element corrente
|
|
/// </summary>
|
|
private double updateVal
|
|
{
|
|
get => CurrRec.dDimension;
|
|
set
|
|
{
|
|
if (CurrRec.dDimension != value)
|
|
{
|
|
CurrRec.dDimension = value;
|
|
_ = EC_Update.InvokeAsync(CurrRec);
|
|
}
|
|
}
|
|
}
|
|
|
|
private string Title()
|
|
{
|
|
return "Min: " + CurrRec.dMinDim + ", Max: " + CurrRec.dMaxDim;
|
|
}
|
|
|
|
#endregion Private Properties
|
|
}
|
|
} |