- Eliminazioni commenti

- Eliminazione funzioni non più usate
- Eliminazione pagine razor sostituite
This commit is contained in:
Annamaria Sassi
2026-03-16 17:02:49 +01:00
parent 171cc8cb90
commit 83161fd2c4
30 changed files with 781 additions and 919 deletions
+57 -63
View File
@@ -161,7 +161,7 @@ namespace WebWindowComplex
}
}
protected List<Sash> SashList
protected List<Sash> SashGroupList
{
get => m_SashList;
}
@@ -218,11 +218,11 @@ namespace WebWindowComplex
if ((node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1) ||
(node.ParentArea != null && node.ParentArea.AreaList.Count > 1))
{
for (int i = 0; i < SashList.Count; i++)
for (int i = 0; i < SashGroupList.Count; i++)
{
if (SashList[i].Equals(node))
if (SashGroupList[i].Equals(node))
{
nWIndow = SashList.Count == 1 ? "" : $"{i + 1}";
nWIndow = SashGroupList.Count == 1 ? "" : $"{i + 1}";
// Se il nodo ha figli, salvo il numero nell'oggetto
if (node.AreaList.Count >= 1)
ItemTableList.Add(new ItemTable(AreaTypes.SASH, "SG" + nWIndow, maxRow, col, i, node.AreaList.Count));
@@ -527,7 +527,7 @@ namespace WebWindowComplex
// verifico variazione JWD
if (!prevJwd.Equals(CurrJwd) || prevReq != (int)DataReq.ReqElement)
{
Log.Info("Richiesta Profili Elementi");
Log.Info("Richiesta profili elementi");
prevJwd = CurrJwd;
prevReq = (int)DataReq.ReqElement;
Dictionary<string, string> Args = new Dictionary<string, string>();
@@ -637,7 +637,7 @@ namespace WebWindowComplex
WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(LiveData.CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
if (WindowFromJson == null || WindowFromJson.AreaList == null || WindowFromJson.AreaList.Count == 0)
{
WindowFromJson = BuildFrameDefault();
WindowFromJson = BuildWindowDefault();
Log.Info("Ricostruito jwd");
}
UpdateInputList(WindowFromJson);
@@ -654,7 +654,7 @@ namespace WebWindowComplex
listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}");
Log.Error($"Errore nel deserializzare jwd: {ex.Message}");
// costruisco una finestra base
WindowFromJson = BuildFrameDefault();
WindowFromJson = BuildWindowDefault();
await DoPreviewSvg(true);
}
}
@@ -667,7 +667,7 @@ namespace WebWindowComplex
if (m_CurrWindow != null && m_CurrWindow.AreaList != null && m_CurrWindow.AreaList.Count > 0)
{
checkWarnings();
if (SashList.Count > 0)
if (SashGroupList.Count > 0)
currAntaIndex = 0;
if (updRequested)
{
@@ -682,7 +682,7 @@ namespace WebWindowComplex
if (LiveData.ProfElementList.Count == 0)
await UpdateElement(FrameWindow);
}
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
List<int> reqList = SashGroupList.Select(x => x.GroupId).ToList();
if (reqList.Count > 0)
{
await DoReqShape(reqList);
@@ -704,7 +704,7 @@ namespace WebWindowComplex
else
{
JsonWindow WindowFromJson = new JsonWindow("", "", "", "");
WindowFromJson = BuildFrameDefault();
WindowFromJson = BuildWindowDefault();
await DoPreviewSvg(true);
}
}
@@ -716,7 +716,11 @@ namespace WebWindowComplex
isLoading = false;
}
private JsonWindow BuildFrameDefault()
/// <summary>
/// Metodo per costruire una finestra con vetro fisso
/// </summary>
/// <returns></returns>
private JsonWindow BuildWindowDefault()
{
// Costruisco window e setto i parametri
Window window = new Window();
@@ -766,15 +770,12 @@ namespace WebWindowComplex
protected bool CheckGroupId(Window window)
{
List<int> groupIdList = new List<int>();
SearchInWindow(window.AreaList.First(), groupIdList);
AllGroupIdList(window.AreaList.First(), groupIdList);
var duplicati = groupIdList.GroupBy(x => x)
.Where(g => g.Count() > 1)
.Select(g => g.Key)
.ToList();
if (duplicati.Count > 0)
return false;
else
return true;
.Where(g => g.Count() > 1)
.Select(g => g.Key)
.ToList();
return duplicati.Count > 0 ? false : true;
}
/// <summary>
@@ -812,7 +813,7 @@ namespace WebWindowComplex
// Aggiornamento liste sash, split, splitted, fill e itemTable
UpdateLists();
}
if (SashList.Count > 0)
if (SashGroupList.Count > 0)
currAntaIndex = 0;
// Aggiorno window con dati shape e hw option
UpdateDict();
@@ -830,8 +831,7 @@ namespace WebWindowComplex
// Inserisco le forme ricevuto nei sash group
foreach (var item in LiveData.DictShape)
{
//Sash sashFromGroupId = SashList.First(x => x.GroupId == item.Key);
var sashFromGroupId = SashList.FirstOrDefault(x => x.GroupId == item.Key);
Sash? sashFromGroupId = SashGroupList.FirstOrDefault(x => x.GroupId == item.Key);
if (sashFromGroupId != null)
{
sashFromGroupId.SashShape = item.Value;
@@ -842,7 +842,7 @@ namespace WebWindowComplex
{
if (reqHwOpt > 0)
{
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
List<int> reqList = SashGroupList.Select(x => x.GroupId).ToList();
if (reqList.Count > 0)
{
_ = DoReqOptHardware(reqList);
@@ -854,7 +854,7 @@ namespace WebWindowComplex
if (LiveData.DictOptionsXml.Count > 0)
{
loadListRem("LoadHwOpt");
foreach (var item in SashList)
foreach (var item in SashGroupList)
{
if (LiveData.DictOptionsXml.ContainsKey(item.GroupId))
{
@@ -864,7 +864,6 @@ namespace WebWindowComplex
}
if (LiveData.ProfElementList.Count > 0)
{
//List <AreaProfiles> OrderedListProf = LiveData.ProfElementList.OrderBy(x => x.GroupId).ToList();
// Inserisco i profili ricevuti nei rispettivi Element
foreach (var item in LiveData.ProfElementList)
{
@@ -992,7 +991,6 @@ namespace WebWindowComplex
#region Private Properties
private Window? m_CurrWindow { get; set; } = null;
private Window? m_PreviousWindow { get; set; } = null;
/// <summary>
@@ -1098,7 +1096,7 @@ namespace WebWindowComplex
}
/// <summary>
/// Helper aggiunta elemento a lista caricamento
/// Helper aggiunta elemento a lista caricamento (per caricamento opzioni hw)
/// </summary>
/// <param name="loadCode"></param>
private void loadListAdd(string loadCode)
@@ -1216,9 +1214,7 @@ namespace WebWindowComplex
{
Area? found = SearchAreaFromGroupId(child, idSearch);
if (found != null)
{
return found;
}
}
return null;
}
@@ -1719,7 +1715,7 @@ namespace WebWindowComplex
if (prevReq == (int)DataReq.ReqShape)
{
// richiesta calcolo opzioni hardware per la singola sash group
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
List<int> reqList = SashGroupList.Select(x => x.GroupId).ToList();
// chiamo con gruppo della nuova sash
await DoReqOptHardware(reqList);
}
@@ -1792,19 +1788,24 @@ namespace WebWindowComplex
m_SplitList = new List<Split>();
m_SplittedList = new List<Splitted>();
CreateWindowsList((m_CurrWindow!).AreaList.First(), false);
ReqListGroupId(FrameWindow, reqList);
ReqGroupIdList(FrameWindow, reqList);
await DoReqElement(reqList);
}
}
private void ReqListGroupId(Area node, List<int> groupId)
/// <summary>
/// Lista completa dei group id per le richieste
/// </summary>
/// <param name="node"> nodo da controllare </param>
/// <param name="groupId"> Lista groupId </param>
private void ReqGroupIdList(Area node, List<int> groupId)
{
if (node.AreaList == null)
return;
if (node is Sash || node is Split)
groupId.Add(node.GroupId);
foreach (var child in node.AreaList)
ReqListGroupId(child, groupId);
ReqGroupIdList(child, groupId);
}
/// <summary>
@@ -1820,13 +1821,11 @@ namespace WebWindowComplex
var currRec = SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
// lo aggiorno
currRec = newSash;
// resetto hw lst
// resetto hw list
await EC_ActionReq.InvokeAsync(DataAction.ResetHwOpt);
// richiesta calcolo opzioni hardware per la singola sash group
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
// chiamo con gruppo della nuova sash
List<int> reqList = SashGroupList.Select(x => x.GroupId).ToList();
await DoReqOptHardware(reqList);
//}
}
}
@@ -1843,10 +1842,10 @@ namespace WebWindowComplex
var currRec = SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
// lo aggiorno
currRec = newSash;
// resetto hw lst
// resetto hw list
await EC_ActionReq.InvokeAsync(DataAction.ResetHwOpt);
// richiesta calcolo opzioni hardware per la singola sash group
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
List<int> reqList = SashGroupList.Select(x => x.GroupId).ToList();
// chiamo con gruppo della nuova sash
await DoReqOptHardware(reqList);
}
@@ -1855,7 +1854,7 @@ namespace WebWindowComplex
/// <summary>
/// Aggiornamento Frame
/// </summary>
/// <param name="newFrame"> nuovo frame</param>
/// <param name="newFrame"> nuovo frame </param>
/// <returns></returns>
private async Task UpdatePreviewSplit(DataUpdateSplit args)
{
@@ -1881,7 +1880,7 @@ namespace WebWindowComplex
/// <summary>
/// Metodo per aggiornare Splitted
/// </summary>
/// <param name="currSplitted"> Splitted da aggiornare</param>
/// <param name="currSplitted"> Splitted da aggiornare </param>
/// <returns></returns>
private async Task UpdatePreviewSplitted(Splitted currSplitted)
{
@@ -1892,7 +1891,7 @@ namespace WebWindowComplex
// ricalcolo liste
UpdateLists();
// richiedo update shape
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
List<int> reqList = SashGroupList.Select(x => x.GroupId).ToList();
await DoPreviewSvg();
await UpdateElement(FrameWindow);
await DoReqShape(reqList);
@@ -1910,39 +1909,34 @@ namespace WebWindowComplex
Sash newSash = args.currSash;
bool svgNoHw = args.svgNoHw;
bool noSvg = args.noSvg;
if (svgNoHw)
Sash? item = (Sash?)SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
if (!noSvg && newSash != null && item != null)
{
Sash? item = (Sash?)SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
if (newSash != null && item != null)
{
item = newSash;
item = newSash;
if (svgNoHw)
await DoPreviewSvg(true, true);
}
}
else
{
Sash? item = (Sash?)SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
if (newSash != null && item != null)
{
item = newSash;
if (!noSvg)
await DoPreviewSvg();
}
else
await DoPreviewSvg();
}
}
/// <summary>
/// Rimozione area da frame corrente
/// </summary>
/// <param name="remove"> oggetto da rimuovere </param>
/// <returns></returns>
private async Task RemoveArea(DataNextStep remove)
{
if (remove.currCompileStep is CompileStep.Sash)
{
SashList.ElementAt(remove.index).Remove();
SashGroupList.ElementAt(remove.index).Remove();
if (FrameWindow.SelThreshold.Name.Contains("Threshold") && remove.index == 0)
{
Threshold? updThreshold = FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold");
if (updThreshold != null)
FrameWindow.SelThresholdFromName = updThreshold.Name;
}
SashList.RemoveAt(remove.index);
SashGroupList.RemoveAt(remove.index);
}
else if(remove.currCompileStep is CompileStep.Split)
{
@@ -1968,18 +1962,18 @@ namespace WebWindowComplex
}
/// <summary>
/// Metodo per ottenere lista groupId
/// Metodo per ottenere lista di tutti i groupId appartenenti alla window
/// </summary>
/// <param name="node"> Area da aggiungere alla lista groupId </param>
/// <param name="groupIdList"> Lista group id </param>
protected void SearchInWindow(Area node, List<int> groupIdList)
protected void AllGroupIdList(Area node, List<int> groupIdList)
{
if (node != null)
{
groupIdList.Add(node.GroupId);
foreach (var item in node.AreaList)
{
SearchInWindow(item, groupIdList);
AllGroupIdList(item, groupIdList);
}
}
}