From ecb2dabf4a742eeefe5c4ea7fffb0d0e377bc5b7 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 30 Sep 2025 09:59:55 +0200 Subject: [PATCH] WebWindowTest: - Aggiunto Nuget Egw.Window.Data per classe hardware - Aggiunti medoti rimuovi split e sash - Modificata interfaccia con bottoni per nuovi metodi --- .../Components/Pages/TestComponentJWD.razor | 5 +- .../Pages/TestComponentJWD.razor.cs | 1 + .../Pages/TestComponentTemplate.razor | 3 +- .../Pages/TestComponentTemplate.razor.cs | 1 + Test.UI/Hardware/Setup.json | 71 ++-- WebWindow.Base/WebWindow.Base.csproj | 20 +- WebWindowComplex/WebWindowComplex.csproj | 8 +- .../WebWindowConfigurator.csproj | 11 +- WebWindowTest/Test.razor | 147 ++++--- WebWindowTest/Test.razor.cs | 6 +- WebWindowTest/WebWindowTest.csproj | 1 + WebWindowTest/Window.cs | 392 ++++++++++-------- 12 files changed, 389 insertions(+), 277 deletions(-) diff --git a/Test.UI/Components/Pages/TestComponentJWD.razor b/Test.UI/Components/Pages/TestComponentJWD.razor index 20595ce..c572a2e 100644 --- a/Test.UI/Components/Pages/TestComponentJWD.razor +++ b/Test.UI/Components/Pages/TestComponentJWD.razor @@ -3,9 +3,7 @@ TestComponent - diff --git a/Test.UI/Components/Pages/TestComponentJWD.razor.cs b/Test.UI/Components/Pages/TestComponentJWD.razor.cs index 8585949..1ff01ba 100644 --- a/Test.UI/Components/Pages/TestComponentJWD.razor.cs +++ b/Test.UI/Components/Pages/TestComponentJWD.razor.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using NLog; using System.Diagnostics; using System.Security.AccessControl; +using Egw.Window.Data; using WebWindowTest; using WebWindowTest.DTO; diff --git a/Test.UI/Components/Pages/TestComponentTemplate.razor b/Test.UI/Components/Pages/TestComponentTemplate.razor index fc79f2a..7f870ee 100644 --- a/Test.UI/Components/Pages/TestComponentTemplate.razor +++ b/Test.UI/Components/Pages/TestComponentTemplate.razor @@ -16,8 +16,7 @@ IN_SelGlass="@SelGlass" EC_OnUpdate="SaveJWD" EC_OnSelectedTemplate="SetTemplate" - LiveSVG="@currSvg" - CurrJwd="@InitialJwd"> + LiveSVG="@currSvg">

diff --git a/Test.UI/Components/Pages/TestComponentTemplate.razor.cs b/Test.UI/Components/Pages/TestComponentTemplate.razor.cs index b4db428..faeb0d8 100644 --- a/Test.UI/Components/Pages/TestComponentTemplate.razor.cs +++ b/Test.UI/Components/Pages/TestComponentTemplate.razor.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using NLog; using System.Diagnostics; using System.Security.AccessControl; +using Egw.Window.Data; using WebWindowTest; using WebWindowTest.DTO; diff --git a/Test.UI/Hardware/Setup.json b/Test.UI/Hardware/Setup.json index c937c0f..7e2550b 100644 --- a/Test.UI/Hardware/Setup.json +++ b/Test.UI/Hardware/Setup.json @@ -1,48 +1,47 @@ [ { - "sId": "000558", - "sFamily": "Natura", - "sName": "Profilo78_Rect_Sash", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "RECTANGLE", - "nSashQty": "1", - "nSashPosition": "1" + "Id": "000558", + "FamilyName": "Natura", + "Description": "Profilo78_Rect_Sash", + "OpeningType": "ANTA_RIBALTA", + "Shape": "RECTANGLE", + "SashQty": "1", + "SashPosition": "1" }, { - "sId": "000562", - "sFamily": "Natura", - "sName": "Profilo78_Rect_Sash", - "sOpeningType": "ANTA_BANDIERA", - "sShape": "RECTANGLE", - "nSashQty": "1", - "nSashPosition": "1" + "Id": "000562", + "FamilyName": "Natura", + "Description": "Profilo78_Rect_Sash", + "OpeningType": "ANTA_BANDIERA", + "Shape": "RECTANGLE", + "SashQty": "1", + "SashPosition": "1" }, { - "sId": "000559", - "sFamily": "Natura", - "sName": "Profilo78_Rect_DoubleSash", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "RECTANGLE", - "nSashQty": "2", - "nSashPosition": "1" + "Id": "000559", + "FamilyName": "Natura", + "Description": "Profilo78_Rect_DoubleSash", + "OpeningType": "ANTA_RIBALTA", + "Shape": "RECTANGLE", + "SashQty": "2", + "SashPosition": "1" }, { - "sId": "000563", - "sFamily": "Natura", - "sName": "Profilo78_TurnOnly_Rect_DoubleSash", - "sOpeningType": "ANTA_BANDIERA", - "sShape": "RECTANGLE", - "nSashQty": "2", - "nSashPosition": "1" + "Id": "000563", + "FamilyName": "Natura", + "Description": "Profilo78_TurnOnly_Rect_DoubleSash", + "OpeningType": "ANTA_BANDIERA", + "Shape": "RECTANGLE", + "SashQty": "2", + "SashPosition": "1" }, { - "sId": "000560", - "sFamily": "Natura", - "sName": "Profilo78_Rect_TripleSash", - "sOpeningType": "ANTA_RIBALTA", - "sShape": "RECTANGLE", - "nSashQty": "3", - "nSashPosition": "1" + "Id": "000560", + "FamilyName": "Natura", + "Description": "Profilo78_Rect_TripleSash", + "OpeningType": "ANTA_RIBALTA", + "Shape": "RECTANGLE", + "SashQty": "3", + "SashPosition": "1" } - ] \ No newline at end of file diff --git a/WebWindow.Base/WebWindow.Base.csproj b/WebWindow.Base/WebWindow.Base.csproj index ceaacca..2ebf2a1 100644 --- a/WebWindow.Base/WebWindow.Base.csproj +++ b/WebWindow.Base/WebWindow.Base.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.2909 + 2.7.9.3009 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -64,6 +64,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index f91cbce..ff41b73 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.2909 + 2.7.9.3009 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -66,6 +66,12 @@ + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 3228850..4594b76 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.2909 + 2.7.9.3009 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -105,6 +105,15 @@ + + + + + + + + + diff --git a/WebWindowTest/Test.razor b/WebWindowTest/Test.razor index 8829cac..e4ca63f 100644 --- a/WebWindowTest/Test.razor +++ b/WebWindowTest/Test.razor @@ -38,7 +38,7 @@ { int Index = i;

} } @@ -207,16 +207,22 @@
-
Frame joints
+
Frame joints
-
- +
+
+ +
-
- +
+
+ +
-
- +
+
+ +
@foreach (Joint joint in FrameWindow.JointList) @@ -233,14 +239,29 @@
- @if (!(FrameWindow.AreaList[0] is Split)) + @if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0)) {
-
Frame
-
- +
Area frame
+
+
+ @if (!(FrameWindow.AreaList[0] is Split)) + { +
+ +
+ } +
+ @if(SashList.Count == 0 && SplitList.Count == 0) + { +
+
+ +
+
+ }
@@ -283,15 +304,27 @@
-
Split
- @if ((currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 1) || - (currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 0) || - (currSplit.nSplitQtyVert == 0 && currSplit.nSplitQtyHoriz == 1)) - { -
- +
+
+
Split
- } +
+
+ +
+
+
+
+
+
+ @if ((currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 0) || (currSplit.nSplitQtyVert == 0 && currSplit.nSplitQtyHoriz == 1)) + { +
+ +
+ } +
+
@@ -423,10 +456,18 @@
+
+
+
+
+ +
+
+
- Number + Qty sash
@@ -464,6 +505,7 @@ for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++) { SashDimension sash = item.SashList[i * 2 + j]; + Area anta = item.AreaList[i * 2 + j];
@@ -505,6 +547,18 @@
+
+
+
+ +
+
+
+
+ +
+
+
@for (int k = 1; k <= i * 2 + j; k++) { @@ -529,14 +583,20 @@
Sash joints
-
- +
+
+ +
-
- +
+
+ +
-
- +
+
+ +
@foreach (Joint joint in item.JointList) @@ -553,33 +613,6 @@
-
- @for (int i = 0; i < item.AreaList.Count; i++) - { - Area anta; - @if (item.AreaList[i] is Splitted) - { - anta = item.AreaList[i]; - } - else - { - anta = item; - } - @if (!(anta.AreaList[0] is Split)) - { -
-
-
-
Anta @(i + 1)
-
- -
-
-
-
- } - } -
@@ -603,7 +636,7 @@
@@ -628,12 +661,12 @@
Area Fill
-
+
-
+
diff --git a/WebWindowTest/Test.razor.cs b/WebWindowTest/Test.razor.cs index de384d0..1507bce 100644 --- a/WebWindowTest/Test.razor.cs +++ b/WebWindowTest/Test.razor.cs @@ -6,7 +6,7 @@ using Newtonsoft.Json.Linq; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; using System.Runtime.InteropServices; -using WebWindow.Base; +using Egw.Window.Data; using WebWindowTest.DTO; using WebWindowTest.Json; using static WebWindowTest.Json.WindowConst; @@ -313,7 +313,7 @@ namespace WebWindowTest { var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); Dictionary Args = new Dictionary(); - Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}"); + Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); Args.Add("Jwd", CurrJwd); await EC_OnUpdate.InvokeAsync(Args); } @@ -851,7 +851,7 @@ namespace WebWindowTest private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e) { Dictionary Args = new Dictionary(); - Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}"); + Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); Args.Add("Jwd", e.sJwd); EC_OnUpdate.InvokeAsync(Args); } diff --git a/WebWindowTest/WebWindowTest.csproj b/WebWindowTest/WebWindowTest.csproj index b72783d..057d4c0 100644 --- a/WebWindowTest/WebWindowTest.csproj +++ b/WebWindowTest/WebWindowTest.csproj @@ -12,6 +12,7 @@ + diff --git a/WebWindowTest/Window.cs b/WebWindowTest/Window.cs index cf19a29..62d708b 100644 --- a/WebWindowTest/Window.cs +++ b/WebWindowTest/Window.cs @@ -8,6 +8,7 @@ using System.Runtime.Intrinsics.Arm; using System.Xml.Linq; using System.Xml.Serialization; using WebWindowTest.Json; +using Egw.Window.Data; using static WebWindowTest.Json.WindowConst; using static WebWindowTest.ParametriOpzioni; @@ -1148,7 +1149,7 @@ namespace WebWindowTest internal void SetSelHardwareFromId(string sId) { - m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId)?? new Hardware("","","","","",0,0); + m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id == sId)?? new Hardware("","","","","",0,0); if (m_SelHardware == null) m_SelHardware = m_HardwareList[0]; } @@ -1332,7 +1333,7 @@ namespace WebWindowTest string sSashShape = FindSashShape(); string sOpeningType = ConvertOpeningType(); m_HardwareList = new ObservableCollection(from Hardware in m_HardwareCompleteList - where Hardware.sId == "000000" || (Hardware.sFamily == s_SelFamilyHW && Hardware.nSashQty == nSashQty && Hardware.sShape == sSashShape && Hardware.sOpeningType == sOpeningType) + where Hardware.Id == "000000" || (Hardware.FamilyName == s_SelFamilyHW && Hardware.SashQty == nSashQty && Hardware.Shape == sSashShape && Hardware.OpeningType == sOpeningType) select Hardware); } @@ -1404,11 +1405,20 @@ namespace WebWindowTest return newSash; } + public void Remove() + { + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + internal override JsonArea Serialize() { if (nCounterGroup < IdGroup) Area.nCounterGroup = IdGroup; - JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId, IdGroup); + JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.Id, IdGroup); foreach (var SashDimension in SashList) JsonSash.SashList.Add(SashDimension.Serialize()); foreach (var Joint in JointList) @@ -1446,67 +1456,84 @@ namespace WebWindowTest } set { - // Ricalcolo dimensioni aggiungendo split - if (value > m_SplitVertList.Count - 1) + if (value == 0) { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SplitVertList.Count > 0) + for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value; SplitIndex += -1) + m_SplitVertList.RemoveAt(SplitIndex); + if (nSplitQtyHoriz == 0) { - dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); - m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension); + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); } else - dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); - // aggiungo area Split di default - for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++) - m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); + SetSplitShape(SplitShapes.HORIZONTAL); } - else if (value == 0) - { - m_SplitVertList.RemoveAt(1); - m_SplitVertList.RemoveAt(0); - } - // Ricalcolo dimensioni rimuovendo split else { - double dLastDimension = 0; - for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + // Ricalcolo dimensioni aggiungendo split + if (value > m_SplitVertList.Count - 1) { - dLastDimension += m_SplitVertList[SplitIndex].dDimension; - m_SplitVertList.RemoveAt(SplitIndex); + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitVertList.Count > 0) + { + dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); + m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension); + } + else + dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); + // aggiungo area Split di default + for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++) + m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true)); } - dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension; - m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension); - } - // Controllo quanti split orizzontali ci sono - int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; - // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta - for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++) - { - AreaList.Add(Splitted.CreateSplitted(this)); - Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - AreaList[AreaList.Count - 1].AreaList.Add(newFill); - } - // Se ho più di uno split, elimino l'ultimo - if (AreaList.Count > 2) - { - int nAreaList = AreaList.Count - 1; - for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++) + else if (value == 0) { - AreaList.Remove(AreaList[AreaList.Count - 1]); + m_SplitVertList.RemoveAt(1); + m_SplitVertList.RemoveAt(0); + } + // Ricalcolo dimensioni rimuovendo split + else + { + double dLastDimension = 0; + for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + { + dLastDimension += m_SplitVertList[SplitIndex].dDimension; + m_SplitVertList.RemoveAt(SplitIndex); + } + dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension; + m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension); + } + // Controllo quanti split orizzontali ci sono + int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1; + // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta + for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[AreaList.Count - 1].AreaList.Add(newFill); + } + // Se ho più di uno split, elimino l'ultimo + if (AreaList.Count > 2) + { + int nAreaList = AreaList.Count - 1; + for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++) + { + AreaList.Remove(AreaList[AreaList.Count - 1]); + } + } + // Se elimino l'unico split presente + else + { + Splitted s = (Splitted)AreaList[0]; + s.SetParentArea(ParentArea); + ParentArea.AreaList.Add(s); + ParentArea.AreaList.Remove(this); } - } - // Se elimino l'unico split presente - else - { - Splitted s = (Splitted)AreaList[0]; - s.SetParentArea(ParentArea); - ParentArea.AreaList.Add(s); - ParentArea.AreaList.Remove(this); } m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } @@ -1545,67 +1572,79 @@ namespace WebWindowTest } set { - // Ricalcolo dimensioni aggiungendo split - if (value > m_SplitHorizList.Count - 1) + if (value == 0) { - // recupero larghezza ultimo - double dLastDimension = 100; - double dNewDimension = 100; - if (m_SplitHorizList.Count > 0) + for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value; SplitIndex += -1) + m_SplitHorizList.RemoveAt(SplitIndex); + if (nSplitQtyVert == 0) { - dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); - m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension); + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); } else - dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); - // aggiungo area Split di default - for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++) - m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); + SetSplitShape(SplitShapes.VERTICAL); } - else if (value == 0) - { - m_SplitHorizList.RemoveAt(1); - m_SplitHorizList.RemoveAt(0); - } - // Ricalcolo dimensioni rimuovendo split else { - double dLastDimension = 0; - for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + // Ricalcolo dimensioni aggiungendo split + if (value > m_SplitHorizList.Count - 1) { - dLastDimension += m_SplitHorizList[SplitIndex].dDimension; - m_SplitHorizList.RemoveAt(SplitIndex); + // recupero larghezza ultimo + double dLastDimension = 100; + double dNewDimension = 100; + if (m_SplitHorizList.Count > 0) + { + dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); + m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension); + } + else + dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); + // aggiungo area Split di default + for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++) + m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false)); } - dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; - m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension); - } - // Controllo quanti split verticali ci sono - int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; - // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta - for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++) - { - AreaList.Add(Splitted.CreateSplitted(this)); - Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); - newFill.SetAreaType(AreaTypes.FILL); - AreaList[AreaList.Count - 1].AreaList.Add(newFill); - } - // Se ho più di uno split, elimino l'ultimo - if (AreaList.Count > 2) - { - int nAreaList = AreaList.Count - 1; - for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++) + // Ricalcolo dimensioni rimuovendo split + else { - AreaList.Remove(AreaList[AreaList.Count - 1]); + double dLastDimension = 0; + for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) + { + dLastDimension += m_SplitHorizList[SplitIndex].dDimension; + m_SplitHorizList.RemoveAt(SplitIndex); + } + dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; + m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension); + } + // Controllo quanti split verticali ci sono + int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1; + // Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta + for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++) + { + AreaList.Add(Splitted.CreateSplitted(this)); + Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + AreaList[AreaList.Count - 1].AreaList.Add(newFill); + } + // Se ho più di uno split, elimino l'ultimo + if (AreaList.Count > 2) + { + int nAreaList = AreaList.Count - 1; + for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++) + { + AreaList.Remove(AreaList[AreaList.Count - 1]); + } + } + // Se elimino l'unico split presente + else + { + Splitted s = (Splitted)AreaList[0]; + s.SetParentArea(ParentArea); + ParentArea.AreaList.Add(s); + ParentArea.AreaList.Remove(this); } - } - // Se elimino l'unico split presente - else - { - Splitted s = (Splitted)AreaList[0]; - s.SetParentArea(ParentArea); - ParentArea.AreaList.Add(s); - ParentArea.AreaList.Remove(this); } m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } @@ -1789,6 +1828,15 @@ namespace WebWindowTest return newSplit; } + public void Remove() + { + ParentArea.AreaList.Remove(this); + Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); + newFill.SetAreaType(AreaTypes.FILL); + ParentArea.AreaList.Add(newFill); + m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); + } + internal override JsonArea Serialize() { if (nCounterGroup < IdGroup) @@ -2017,82 +2065,82 @@ namespace WebWindowTest } } - public class Hardware - { - private string m_sId; - public string sId - { - get - { - return m_sId; - } - } + //public class Hardware + //{ + // private string m_sId; + // public string sId + // { + // get + // { + // return m_sId; + // } + // } - private string m_sFamily; - public string sFamily - { - get - { - return m_sFamily; - } - } + // private string m_sFamily; + // public string sFamily + // { + // get + // { + // return m_sFamily; + // } + // } - private string m_sName; - public string sName - { - get - { - return m_sName; - } - } + // private string m_sName; + // public string sName + // { + // get + // { + // return m_sName; + // } + // } - private string m_sOpeningType; - public string sOpeningType - { - get - { - return m_sOpeningType; - } - } + // private string m_sOpeningType; + // public string sOpeningType + // { + // get + // { + // return m_sOpeningType; + // } + // } - private string m_sShape; - public string sShape - { - get - { - return m_sShape; - } - } + // private string m_sShape; + // public string sShape + // { + // get + // { + // return m_sShape; + // } + // } - private int m_nSashQty; - public int nSashQty - { - get - { - return m_nSashQty; - } - } + // private int m_nSashQty; + // public int nSashQty + // { + // get + // { + // return m_nSashQty; + // } + // } - private int m_nSashPosition; - public int nSashPosition - { - get - { - return m_nSashPosition; - } - } + // private int m_nSashPosition; + // public int nSashPosition + // { + // get + // { + // return m_nSashPosition; + // } + // } - public Hardware(string sId, string sFamily, string sName, string sOpeningType, string sShape, int nSashQty, int nSashPosition) - { - m_sId = sId; - m_sFamily = sFamily; - m_sName = sName; - m_sOpeningType = sOpeningType; - m_sShape = sShape; - m_nSashQty = nSashQty; - m_nSashPosition = nSashPosition; - } - } + // public Hardware(string sId, string sFamily, string sName, string sOpeningType, string sShape, int nSashQty, int nSashPosition) + // { + // m_sId = sId; + // m_sFamily = sFamily; + // m_sName = sName; + // m_sOpeningType = sOpeningType; + // m_sShape = sShape; + // m_nSashQty = nSashQty; + // m_nSashPosition = nSashPosition; + // } + //} public partial class ParametriOpzioni {