122 lines
3.4 KiB
C#
122 lines
3.4 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using WebWindowComplex.Models;
|
|
|
|
namespace WebWindowComplex.Compo
|
|
{
|
|
public partial class CardFrame
|
|
{
|
|
/// <summary>
|
|
/// Frame corrente
|
|
/// </summary>
|
|
[Parameter]
|
|
public Frame FrameWindow { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Lista di sash
|
|
/// </summary>
|
|
[Parameter]
|
|
public List<Sash> SashList { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Lista di split
|
|
/// </summary>
|
|
[Parameter]
|
|
public List<Split> SplitList { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Evento per cambiare tutti i Joints
|
|
/// </summary>
|
|
[Parameter]
|
|
public EventCallback<DataChangeJoints> EC_ChangeAllJoints { get; set; }
|
|
|
|
/// <summary>
|
|
/// Evento per aggiungere sash
|
|
/// </summary>
|
|
[Parameter]
|
|
public EventCallback<bool> EC_AddSash { get; set; }
|
|
|
|
/// <summary>
|
|
/// Evento per aggiungere split
|
|
/// </summary>
|
|
[Parameter]
|
|
public EventCallback<bool> EC_AddSplit { get; set; }
|
|
|
|
/// <summary>
|
|
/// Evento per tornare nella pagine Tree
|
|
/// </summary>
|
|
[Parameter]
|
|
public EventCallback<bool> EC_ReqClose { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
/// Evento per cambiare tutti i Joints
|
|
/// </summary>
|
|
[Parameter]
|
|
public EventCallback<List<FrameDimension>> EC_UpdateFrameDim{ get; set; }
|
|
|
|
/// <summary>
|
|
/// Sollevo evento richiesta copia sash
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private async Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a)
|
|
{
|
|
var Args = new DataChangeJoints
|
|
{
|
|
currJointType = JointType,
|
|
currArea = a,
|
|
};
|
|
await EC_ChangeAllJoints.InvokeAsync(Args);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sollevo evento richiesta aggiunta sash
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private async Task AddSash()
|
|
{
|
|
await EC_AddSash.InvokeAsync(true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sollevo evento richiesta aggiunta window
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private async Task AddSplit()
|
|
{
|
|
await EC_AddSplit.InvokeAsync(true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sollevo evento per tornare alla pagina Tree
|
|
/// </summary>
|
|
private void ReqClose()
|
|
{
|
|
_ = EC_ReqClose.InvokeAsync(true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Aggiornamento dimensione editata
|
|
/// </summary>
|
|
/// <param name="updRec"></param>
|
|
private void UpdateDim(FrameDimension updRec)
|
|
{
|
|
// cerco il record
|
|
var currRec = FrameWindow.DimensionList.FirstOrDefault(x => x.ParentFrame == updRec.ParentFrame && x.nIndex == updRec.nIndex);
|
|
// lo aggiorno
|
|
if (updRec != null)
|
|
{
|
|
currRec = updRec;
|
|
_ = EC_UpdateFrameDim.InvokeAsync(FrameWindow.DimensionList);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Classe per raggruppare oggetti che servono per copiare Sash
|
|
/// </summary>
|
|
public class DataChangeJoints
|
|
{
|
|
public Json.WindowConst.Joints currJointType { get; set; }
|
|
public Area currArea { get; set; }
|
|
}
|
|
} |