Update catena aggiornamenti sath
This commit is contained in:
@@ -27,6 +27,12 @@ namespace WebWindowComplex
|
||||
[Parameter]
|
||||
public SelectPayload? CurrSelection { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta update da JWD (SVG, calcoli vari...)
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Dictionary<string, string>> EC_DoUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta chiusura JWD (+ refresh)
|
||||
/// se torna true --> richiesta salvataggio
|
||||
@@ -41,12 +47,6 @@ namespace WebWindowComplex
|
||||
[Parameter]
|
||||
public EventCallback<TemplateSelectDTO> EC_OnSelectedTemplate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Richiesta update da JWD (SVG, calcoli vari...)
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Dictionary<string, string>> EC_DoUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento errore validazione con una lista di errori rilevati
|
||||
/// </summary>
|
||||
@@ -78,6 +78,31 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca e aggiorna la sash
|
||||
/// </summary>
|
||||
/// <param name="currentArea"> area corrente che si sta valutando </param>
|
||||
/// <param name="idSearch"> id della sash che si sta cercando </param>
|
||||
/// <param name="newSash"> nuova sash </param>
|
||||
/// <returns></returns>
|
||||
public Area SearchSash(Area currentArea, int idSearch, Sash newSash)
|
||||
{
|
||||
if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(AreaTypes.SASH))
|
||||
{
|
||||
currentArea = newSash;
|
||||
return currentArea;
|
||||
}
|
||||
foreach (Area child in currentArea.AreaList)
|
||||
{
|
||||
Area found = SearchSash(child, idSearch, newSash);
|
||||
if (found != null)
|
||||
{
|
||||
return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
@@ -107,8 +132,6 @@ namespace WebWindowComplex
|
||||
get => m_ItemTableList;
|
||||
}
|
||||
|
||||
protected string m_SelSVG { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Componente SVG da mostrare
|
||||
/// </summary>
|
||||
@@ -130,10 +153,8 @@ namespace WebWindowComplex
|
||||
protected string SelColorMaterial { get; set; } = "";
|
||||
protected string SelFamilyHardware { get; set; } = "";
|
||||
protected string SelGlass { get; set; } = "";
|
||||
protected string SelProfile { get; set; } = "";
|
||||
|
||||
protected string SelMaterial { get; set; } = ""!;
|
||||
|
||||
protected string SelProfile { get; set; } = "";
|
||||
protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
|
||||
|
||||
protected List<Split> SplitList
|
||||
@@ -584,7 +605,7 @@ namespace WebWindowComplex
|
||||
DictShape = LiveData.DictShape,
|
||||
SvgPreview = LiveData.SvgPreview
|
||||
};
|
||||
m_SelSVG = LiveData.SvgPreview;
|
||||
|
||||
// Aggiornati parametri di ingresso selezionati
|
||||
UpdateSelParameter();
|
||||
JsonWindow WindowFromJson = new JsonWindow("", "", "", "");
|
||||
@@ -667,7 +688,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
updateSvg = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (SashList.Count > 0)
|
||||
{
|
||||
@@ -727,7 +748,7 @@ namespace WebWindowComplex
|
||||
if (LiveData.DictShape.Count > 0)
|
||||
{
|
||||
// Inserisco le forme ricevuto nei sash group
|
||||
foreach(var item in LiveData.DictShape)
|
||||
foreach (var item in LiveData.DictShape)
|
||||
{
|
||||
Sash sashNewShape = SashList.Where(x => x.GroupId == item.Key).ToList().First();
|
||||
sashNewShape.SashShape = item.Value;
|
||||
@@ -845,9 +866,26 @@ namespace WebWindowComplex
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiungere una Sash
|
||||
/// </summary>
|
||||
/// <param name="Args"></param>
|
||||
/// <returns></returns>
|
||||
private async Task AddSashIntoSplit(DataAreaSplitted Args)
|
||||
{
|
||||
Splitted currSplitted = Args.splitted;
|
||||
bError = currSplitted.AddFirstSash();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
private void AddSashToFrame(Frame f)
|
||||
{
|
||||
bError = f.AddFirstSash();
|
||||
// ricalcolo liste
|
||||
UpdateLists();
|
||||
// richiedo update shape
|
||||
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
|
||||
_ = DoReqShape(reqList);
|
||||
}
|
||||
|
||||
private void AddSplitToFrame(Frame f)
|
||||
@@ -1027,18 +1065,6 @@ namespace WebWindowComplex
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiungere una Sash
|
||||
/// </summary>
|
||||
/// <param name="Args"></param>
|
||||
/// <returns></returns>
|
||||
private async Task AddSashIntoSplit(DataAreaSplitted Args)
|
||||
{
|
||||
Splitted currSplitted = Args.splitted;
|
||||
bError = currSplitted.AddFirstSash();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per copiare una Sash intera
|
||||
/// </summary>
|
||||
@@ -1255,6 +1281,28 @@ namespace WebWindowComplex
|
||||
FrameWindow = newFrame;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento opzioni dato update sash
|
||||
/// </summary>
|
||||
/// <param name="newSash"> nuova sash </param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateHwOptions(Sash newSash)
|
||||
{
|
||||
await DoReqOptHardware();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento Sash e Frame
|
||||
/// </summary>
|
||||
/// <param name="newSash"> nuova sash </param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateSash(Sash newSash)
|
||||
{
|
||||
SearchSash(FrameWindow, newSash.GroupId, newSash);
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento Shape x ogni Group di Sash della finestra
|
||||
/// </summary>
|
||||
@@ -1270,7 +1318,7 @@ namespace WebWindowComplex
|
||||
foreach (var item in SashList)
|
||||
{
|
||||
await DoReqShape(item.GroupId);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1284,56 +1332,10 @@ namespace WebWindowComplex
|
||||
List<int> reqList = new List<int>() { groupId };
|
||||
await DoReqShape(reqList);
|
||||
#if false
|
||||
await DoReqShape(groupId);
|
||||
await DoReqShape(groupId);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento Sash e Frame
|
||||
/// </summary>
|
||||
/// <param name="newSash"> nuova sash </param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateSash(Sash newSash)
|
||||
{
|
||||
SearchSash(FrameWindow, newSash.GroupId, newSash);
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento opzioni dato update sash
|
||||
/// </summary>
|
||||
/// <param name="newSash"> nuova sash </param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateHwOptions(Sash newSash)
|
||||
{
|
||||
await DoReqOptHardware();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca e aggiorna la sash
|
||||
/// </summary>
|
||||
/// <param name="currentArea"> area corrente che si sta valutando </param>
|
||||
/// <param name="idSearch"> id della sash che si sta cercando </param>
|
||||
/// <param name="newSash"> nuova sash </param>
|
||||
/// <returns></returns>
|
||||
public Area SearchSash(Area currentArea, int idSearch, Sash newSash)
|
||||
{
|
||||
if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(AreaTypes.SASH))
|
||||
{
|
||||
currentArea = newSash;
|
||||
return currentArea;
|
||||
}
|
||||
foreach (Area child in currentArea.AreaList)
|
||||
{
|
||||
Area found = SearchSash(child, idSearch, newSash);
|
||||
if (found != null)
|
||||
{
|
||||
return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user