diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 384f18c..12d9235 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -5,6 +5,7 @@ "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -40,14 +41,17 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TURNONLY_LEFT", "bHasHandle": false, "dDimension": 50.0 }, { + "SashId": 2, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 50.0 @@ -75,8 +79,10 @@ "Hardware": "000559", "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -85,8 +91,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 5, "AreaList": [ { + "IdGroup": 6, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/AntaSingola.jwd b/Test.UI/Data/AntaSingola.jwd index 6928ce4..5748335 100644 --- a/Test.UI/Data/AntaSingola.jwd +++ b/Test.UI/Data/AntaSingola.jwd @@ -38,11 +38,13 @@ ], "BottomRail": false, "BottomRailQty": 0, + "IdGroup": 1, "AreaList": [ { "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TILTTURN_LEFT", "bHasHandle": true, "dDimension": 100.0 @@ -68,9 +70,11 @@ } ], "Hardware": "000558", + "IdGroup": 2, "AreaList": [ { "FillType": "GLASS", + "IdGroup": 3, "AreaList": [], "AreaType": "FILL" } diff --git a/Test.UI/Data/FinDueAnteBottomFisso.jwd b/Test.UI/Data/FinDueAnteBottomFisso.jwd index 35e9cfc..4363cbd 100644 --- a/Test.UI/Data/FinDueAnteBottomFisso.jwd +++ b/Test.UI/Data/FinDueAnteBottomFisso.jwd @@ -5,6 +5,7 @@ "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -40,6 +41,7 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "SplitShape": "HORIZONTAL", "SplitPositionList": [ { @@ -53,8 +55,10 @@ ], "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -63,16 +67,20 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 5, "AreaList": [ { + "IdGroup": 6, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TURNONLY_LEFT", "bHasHandle": false, "dDimension": 50.0 }, { + "SashId": 2, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 50.0 @@ -100,8 +108,10 @@ "Hardware": "000559", "AreaList": [ { + "IdGroup": 7, "AreaList": [ { + "IdGroup": 8, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -110,8 +120,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 9, "AreaList": [ { + "IdGroup": 10, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/FinestraDueAnteSeparate.jwd b/Test.UI/Data/FinestraDueAnteSeparate.jwd index d44b9f6..69db6ca 100644 --- a/Test.UI/Data/FinestraDueAnteSeparate.jwd +++ b/Test.UI/Data/FinestraDueAnteSeparate.jwd @@ -5,6 +5,7 @@ "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "DOUBLECHAMFER", "DimensionList": [ { @@ -45,6 +46,7 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "SplitShape": "VERTICAL", "SplitPositionList": [ { @@ -58,11 +60,14 @@ ], "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TILTTURN_LEFT", "bHasHandle": true, "dDimension": 100.0 @@ -92,6 +97,7 @@ "Hardware": "000000", "AreaList": [ { + "IdGroup": 5, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -103,11 +109,14 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 6, "AreaList": [ { + "IdGroup": 7, "bIsSashVertical": true, "SashList": [ { + "SashId": 1, "OpeningType": "TILTTURN_RIGHT", "bHasHandle": true, "dDimension": 100.0 @@ -137,6 +146,7 @@ "Hardware": "000000", "AreaList": [ { + "IdGroup": 8, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/FinestraSplitVert.jwd b/Test.UI/Data/FinestraSplitVert.jwd index 4e485af..74a4606 100644 --- a/Test.UI/Data/FinestraSplitVert.jwd +++ b/Test.UI/Data/FinestraSplitVert.jwd @@ -5,6 +5,7 @@ "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -40,6 +41,7 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "SplitShape": "VERTICAL", "SplitPositionList": [ { @@ -53,8 +55,10 @@ ], "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -63,8 +67,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 5, "AreaList": [ { + "IdGroup": 6, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/Test.UI/Data/FinestraSplitVertOriz.jwd b/Test.UI/Data/FinestraSplitVertOriz.jwd index 8298f50..f149bc8 100644 --- a/Test.UI/Data/FinestraSplitVertOriz.jwd +++ b/Test.UI/Data/FinestraSplitVertOriz.jwd @@ -5,6 +5,7 @@ "Glass": "4T/16/4T", "AreaList": [ { + "IdGroup": 1, "Shape": "RECTANGLE", "DimensionList": [ { @@ -40,6 +41,7 @@ "BottomRailQty": 0, "AreaList": [ { + "IdGroup": 2, "SplitShape": "VERTICAL", "SplitPositionList": [ { @@ -53,8 +55,10 @@ ], "AreaList": [ { + "IdGroup": 3, "AreaList": [ { + "IdGroup": 4, "SplitShape": "HORIZONTAL", "SplitPositionList": [ { @@ -68,8 +72,10 @@ ], "AreaList": [ { + "IdGroup": 5, "AreaList": [ { + "IdGroup": 6, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -78,8 +84,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 7, "AreaList": [ { + "IdGroup": 8, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -94,8 +102,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 9, "AreaList": [ { + "IdGroup": 10, "SplitShape": "HORIZONTAL", "SplitPositionList": [ { @@ -109,8 +119,10 @@ ], "AreaList": [ { + "IdGroup": 11, "AreaList": [ { + "IdGroup": 12, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" @@ -119,8 +131,10 @@ "AreaType": "SPLITTED" }, { + "IdGroup": 13, "AreaList": [ { + "IdGroup": 14, "FillType": "GLASS", "AreaList": [], "AreaType": "FILL" diff --git a/WebWindow.Base/WebWindow.Base.csproj b/WebWindow.Base/WebWindow.Base.csproj index 60c4fc2..567e902 100644 --- a/WebWindow.Base/WebWindow.Base.csproj +++ b/WebWindow.Base/WebWindow.Base.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.2214 + 2.7.9.2414 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -36,5 +36,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index f4c0b9a..778cc87 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.2214 + 2.7.9.2414 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -50,6 +50,10 @@ + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index f67d3f2..76369e4 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.9.2214 + 2.7.9.2414 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -60,6 +60,21 @@ + + + + + + + + + + + + + + + diff --git a/WebWindowTest/Json/JsonUtility.cs b/WebWindowTest/Json/JsonUtility.cs index 94eae65..c2de704 100644 --- a/WebWindowTest/Json/JsonUtility.cs +++ b/WebWindowTest/Json/JsonUtility.cs @@ -102,8 +102,21 @@ namespace WebWindowTest.Json public class JsonArea { - private List m_AreaList = new List(); + private int m_nIdGroup; + [JsonProperty] + public int IdGroup + { + get + { + return m_nIdGroup; + } + set + { + m_nIdGroup = value; + } + } + private List m_AreaList = new List(); [JsonProperty] public List AreaList { @@ -216,16 +229,18 @@ namespace WebWindowTest.Json { } - public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty) : base(AreaTypes.FRAME) + public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty, int nIdGroup) : base(AreaTypes.FRAME) { m_Shape = Shape; m_bBottomRail = BottomRail; m_nBottomRailQty = BottomRailQty; + IdGroup = nIdGroup; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Frame newFrame = new Frame(null, ParentWindow); + newFrame.SetIdGroup(IdGroup); newFrame.SetAreaType(AreaTypes.FRAME); newFrame.SetSelShape(m_Shape); newFrame.SetBottomRail(m_bBottomRail); @@ -248,7 +263,7 @@ namespace WebWindowTest.Json } public class JsonSash : JsonArea - { + { private bool m_bIsSashVertical; [JsonProperty] public bool bIsSashVertical @@ -352,18 +367,20 @@ namespace WebWindowTest.Json { } - public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware) : base(AreaTypes.SASH) + public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware, int nIdGroup) : base(AreaTypes.SASH) { m_bIsSashVertical = bIsSashVertical; m_SashType = SashType; m_bBottomRail = SashBottomRail; m_nBottomRailQty = SashBottomRailQty; m_Hardware = Hardware; + IdGroup = nIdGroup; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Sash newSash = new Sash(ParentArea, ParentWindow); + newSash.SetIdGroup(IdGroup); newSash.SetAreaType(AreaTypes.SASH); newSash.SetSashQty(m_SashList.Count); newSash.SetIsSashVertical(m_bIsSashVertical); @@ -426,14 +443,16 @@ namespace WebWindowTest.Json { } - public JsonSplit(SplitShapes SplitShape) : base(AreaTypes.SPLIT) + public JsonSplit(SplitShapes SplitShape, int nIdGroup) : base(AreaTypes.SPLIT) { + IdGroup = nIdGroup; m_SplitShape = SplitShape; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Split Split = new Split(ParentArea, ParentWindow); + Split.SetIdGroup(IdGroup); Split.SetAreaType(AreaTypes.SPLIT); Split.SetSplitShape(m_SplitShape, true); Split.SetSplitQty(m_SplitPositionList.Count - 1, true); @@ -460,22 +479,27 @@ namespace WebWindowTest.Json public JsonSplitted() : base(AreaTypes.SPLITTED) { } + public JsonSplitted(int nIdGroup) : base(AreaTypes.SPLITTED) + { + IdGroup = nIdGroup; + } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { - Splitted Split = new Splitted(ParentArea, ParentWindow); - Split.SetAreaType(AreaTypes.SPLITTED); + Splitted newSplitted = new Splitted(ParentArea, ParentWindow); + newSplitted.SetIdGroup(IdGroup); + newSplitted.SetAreaType(AreaTypes.SPLITTED); //Split.AppliedDone(); foreach (var Area in AreaList) { - var AreaDeserealized = Area.Deserialize(Split, ParentWindow); + var AreaDeserealized = Area.Deserialize(newSplitted, ParentWindow); if (AreaDeserealized != null) { - Split.AreaList.Add(AreaDeserealized); + newSplitted.AreaList.Add(AreaDeserealized); } } - return Split; + return newSplitted; } } @@ -500,14 +524,16 @@ namespace WebWindowTest.Json { } - public JsonFill(FillTypes FillType) : base(AreaTypes.FILL) + public JsonFill(FillTypes FillType, int nIdGroup) : base(AreaTypes.FILL) { m_FillType = FillType; + IdGroup = nIdGroup; } internal override Area Deserialize(Area ParentArea, Window ParentWindow) { Fill Fill = new Fill(ParentArea, ParentWindow); + Fill.SetIdGroup(IdGroup); Fill.SetAreaType(AreaTypes.FILL); Fill.SetFillType(m_FillType); //Fill.AppliedDone(); @@ -609,6 +635,16 @@ namespace WebWindowTest.Json public class JsonSashDimension { + private int m_nSashId; + [JsonProperty] + public int nSashId + { + get + { + return m_nSashId; + } + } + private Openings m_OpeningType; [JsonProperty] [JsonConverter(typeof(StringEnumConverter))] @@ -648,11 +684,12 @@ namespace WebWindowTest.Json } } - public JsonSashDimension(Openings OpeningType, bool bHasHandle, double dDimension) + public JsonSashDimension(Openings OpeningType, bool bHasHandle, double dDimension, int nSashId) { m_OpeningType = OpeningType; m_bHasHandle = bHasHandle; m_dDimension = dDimension; + m_nSashId = nSashId; } } diff --git a/WebWindowTest/Test.razor b/WebWindowTest/Test.razor index 14efe05..1616b69 100644 --- a/WebWindowTest/Test.razor +++ b/WebWindowTest/Test.razor @@ -179,7 +179,7 @@ @foreach (FrameDimension dimension in FrameWindow.DimensionList) { - @dimension.sName + @dimension.sName mm @@ -187,6 +187,20 @@ + + + + Threshold + + Tipology + + Soglia + Sgocciolatoio + + + + + @@ -207,8 +221,8 @@ @foreach (Joint joint in FrameWindow.JointList) { - @((PositionJoints)(FrameWindow.JointList.IndexOf(joint))) - + @((PositionJoints)(joint.nIndex-1)) + Angled Full H Full V @@ -513,8 +527,8 @@ @foreach (Joint joint in item.JointList) { - @((PositionJoints)(item.JointList.IndexOf(joint))) - + @((PositionJoints)(joint.nIndex-1)) + Angled Full H Full V diff --git a/WebWindowTest/Test.razor.cs b/WebWindowTest/Test.razor.cs index 533ee97..e845cdc 100644 --- a/WebWindowTest/Test.razor.cs +++ b/WebWindowTest/Test.razor.cs @@ -366,6 +366,7 @@ namespace WebWindowTest protected async Task DoReset() { // Aggiornati parametri di ingresso selezionati + Area.nCounterGroup = 0; UpdateSelParameter(); JsonWindow WindowFromJson; if (string.IsNullOrEmpty(CurrJwd)) @@ -734,8 +735,9 @@ namespace WebWindowTest /// private async Task CopySash(Splitted currSplitted, int numSash) { - //Rimuovo contenuto di Splitted + //Rimuovo contenuto di Splitted e rimuovo area da conteggio gruppi currSplitted.AreaList.RemoveAll(i => i != null); + //Area.DelCounterGroup(); // Copio sash Area a = SashList[numSash].Copy(currSplitted); a.SetParentArea(currSplitted); diff --git a/WebWindowTest/Window.cs b/WebWindowTest/Window.cs index 6cb84c9..21da3b0 100644 --- a/WebWindowTest/Window.cs +++ b/WebWindowTest/Window.cs @@ -121,6 +121,39 @@ namespace WebWindowTest public abstract class Area { + // Conteggio dei macro elementi + private static int m_CounterGroup = 0; + public static void AddCounterGroup() + { + m_CounterGroup++; + } + //public static void DelCounterGroup() + //{ + // m_CounterGroup--; + //} + public static int nCounterGroup + { + get => m_CounterGroup; + set => m_CounterGroup = value; + } + + private int m_IdGroup; + public int IdGroup + { + get + { + return m_IdGroup; + } + + set + { + m_IdGroup = value; + } + } + public void SetIdGroup(int nIdGroup) + { + m_IdGroup = nIdGroup; + } protected Window m_ParentWindow; public Window ParentWindow @@ -620,7 +653,10 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty); + Area.nCounterGroup = 0; + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, IdGroup); foreach (var Dimension in DimensionList) JsonFrame.DimensionList.Add(Dimension.Serialize()); foreach (var Joint in JointList) @@ -666,7 +702,7 @@ namespace WebWindowTest // aggiungo area Sash di default for (var SplitIndex = m_SashList.Count; SplitIndex <= value - 1; SplitIndex++) { - SashList.Add(new SashDimension(dNewDimension, true, this)); + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex+1)); } } else if (value < m_SashList.Count) @@ -758,8 +794,9 @@ namespace WebWindowTest } // Aggiungo all'ultimo Splitted l'area di vetro - Fill newFill = new Fill(AreaList[1], ParentWindow); - newFill.SetFillType(FillTypes.GLASS); + Fill newFill = Fill.CreateFill(AreaList[1], FillTypes.GLASS); + //Fill newFill = new Fill(AreaList[1], ParentWindow); + //newFill.SetFillType(FillTypes.GLASS); newFill.SetAreaType(AreaTypes.FILL); AreaList[AreaList.Count - 1].AreaList.Add(newFill); } @@ -772,37 +809,6 @@ namespace WebWindowTest break; } } - //if (AreaList[AreaList.Count - 1].AreaList.Count == 0) - //{ - // if (ContentArea.Count > 0) - // { - // if (ContentArea[0] is Fill) - // { - // for (int SplitIndex = 0; SplitIndex <= AreaList.Count() - 1; SplitIndex++) - // { - // if (SplitIndex == 0) - // { - // AreaList[0].AreaList.Add(ContentArea[0]); - // } - // else - // { - // Fill f1 = (Fill)ContentArea[0]; - // AreaList[SplitIndex].AreaList.Add(Fill.CreateFill(AreaList[SplitIndex], f1.FillType)); - // } - // } - // } - // else - // { - // AreaList[0].AreaList.Add(ContentArea[0]); - // AreaList[1].AreaList.Add(ContentArea[0]); - // } - // } - // else - // { - // Fill f1 = (Fill)AreaList[AreaList.Count - 2].AreaList[0]; - // AreaList[AreaList.Count - 1].AreaList.Add(Fill.CreateFill(AreaList[AreaList.Count - 1], f1.FillType)); - // } - //} } } RefreshHardwareList(); @@ -828,7 +834,7 @@ namespace WebWindowTest dNewDimension = dLastDimension / (Qty + 1 - nSashQty); // aggiungo area Sash di default for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++) - SashList.Add(new SashDimension(dNewDimension, true, this)); + SashList.Add(new SashDimension(dNewDimension, true, this, SplitIndex+1)); } else if (Qty < m_SashList.Count) { @@ -1183,6 +1189,8 @@ namespace WebWindowTest internal static Sash CreateSash(Area Area) { Sash newSash = new Sash(Area, Area.ParentWindow); + AddCounterGroup(); + newSash.SetIdGroup(nCounterGroup); newSash.SetAreaType(AreaTypes.SASH); newSash.SetSashQty(1); newSash.SetOrientationSashType(OrientationSash.VERTICAL); @@ -1357,6 +1365,8 @@ namespace WebWindowTest public override Sash Copy(Area newParentArea) { Sash newSash = new Sash(newParentArea, m_ParentWindow); + AddCounterGroup(); + newSash.SetIdGroup(nCounterGroup); newSash.SetAreaType(AreaType); // Imposta la quantità di ante e definisce SashDimension di ogni anta ai valori di default newSash.SetSashQty(nSashQty); @@ -1388,7 +1398,9 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId, IdGroup); foreach (var SashDimension in SashList) JsonSash.SashList.Add(SashDimension.Serialize()); foreach (var Joint in JointList) @@ -1448,8 +1460,7 @@ namespace WebWindowTest for (var SplitIndex = AreaList.Count; SplitIndex <= SplitPositionList.Count - 1; SplitIndex++) { AreaList.Add(Splitted.CreateSplitted(this)); - Fill newFill = new Fill(AreaList.Last(), ParentWindow); - newFill.SetFillType(FillTypes.GLASS); + Fill newFill = Fill.CreateFill(AreaList[1], FillTypes.GLASS); newFill.SetAreaType(AreaTypes.FILL); AreaList[AreaList.Count - 1].AreaList.Add(newFill); } @@ -1568,6 +1579,8 @@ namespace WebWindowTest internal static Split CreateSplit(Area Area, SplitShapes SplitShape) { Split Split = new Split(Area, Area.ParentWindow); + AddCounterGroup(); + Split.SetIdGroup(nCounterGroup); Split.SetAreaType(AreaTypes.SPLIT); Split.SetSplitShape(SplitShape, true); return Split; @@ -1576,6 +1589,8 @@ namespace WebWindowTest public override Split Copy(Area newParentArea) { Split newSplit = new Split(newParentArea, ParentWindow); + AddCounterGroup(); + newSplit.SetIdGroup(nCounterGroup); newSplit.SetSplitQty(nSplitQty); newSplit.SetSplitShape(SelSplitShape, true); newSplit.SetAreaType(AreaType); @@ -1589,7 +1604,9 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape, IdGroup); foreach (var SplitPosition in m_SplitPositionList) JsonSplit.SplitPositionList.Add(SplitPosition.Serialize()); foreach (var Area in AreaList) @@ -1600,7 +1617,6 @@ namespace WebWindowTest public class Splitted : Area { - public Splitted(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow) { } @@ -1608,6 +1624,8 @@ namespace WebWindowTest internal static Splitted CreateSplitted(Area ParentArea) { Splitted Splitted = new Splitted(ParentArea, ParentArea.ParentWindow); + AddCounterGroup(); + Splitted.SetIdGroup(nCounterGroup); Splitted.SetAreaType(AreaTypes.SPLITTED); return Splitted; } @@ -1615,6 +1633,8 @@ namespace WebWindowTest public override Splitted Copy(Area newParentArea) { Splitted newSplitted = new Splitted(newParentArea, ParentWindow); + AddCounterGroup(); + newSplitted.SetIdGroup(nCounterGroup); newSplitted.SetAreaType(AreaType); foreach (var item in AreaList) { @@ -1626,7 +1646,9 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonSplitted JsonSplitted = new JsonSplitted(); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonSplitted JsonSplitted = new JsonSplitted(IdGroup); foreach (var Area in AreaList) JsonSplitted.AreaList.Add(Area.Serialize()); return JsonSplitted; @@ -1691,6 +1713,8 @@ namespace WebWindowTest internal static Fill CreateFill(Area AreaParent, FillTypes FillType) { Fill Fill = new Fill(AreaParent, AreaParent.ParentWindow); + AddCounterGroup(); + Fill.SetIdGroup(nCounterGroup); Fill.SetAreaType(AreaTypes.FILL); Fill.SetFillType(FillType); return Fill; @@ -1699,6 +1723,8 @@ namespace WebWindowTest public override Fill Copy(Area newParentArea) { Fill newFill = new Fill(newParentArea, m_ParentWindow); + AddCounterGroup(); + newFill.SetIdGroup(nCounterGroup); newFill.SetFillType(SelFillType); newFill.SetAreaType(AreaType); return newFill; @@ -1706,7 +1732,9 @@ namespace WebWindowTest internal override JsonArea Serialize() { - JsonFill JsonFill = new JsonFill(FillType); + if (nCounterGroup < IdGroup) + Area.nCounterGroup = IdGroup; + JsonFill JsonFill = new JsonFill(FillType, IdGroup); foreach (var Area in AreaList) JsonFill.AreaList.Add(Area.Serialize()); return JsonFill; @@ -1723,6 +1751,7 @@ namespace WebWindowTest return m_ParentArea; } } + private int m_nIndex; public int nIndex { @@ -2085,6 +2114,15 @@ namespace WebWindowTest { // reference private Sash m_Parent; + + private int m_nSashId; + public int nSashId + { + get + { + return m_nSashId; + } + } private bool m_bIsRelative = false; public bool bIsRelative @@ -2263,17 +2301,18 @@ namespace WebWindowTest public SashDimension Copy() { - SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent); + SashDimension newSashDim = new SashDimension(dDimension, bIsRelative, m_Parent, m_nSashId); newSashDim.SetOpeningType(SelOpeningType); newSashDim.SetHasHandle(bHasHandle); return newSashDim; } - public SashDimension(double dDimension, bool bIsRelative, Sash Parent) + public SashDimension(double dDimension, bool bIsRelative, Sash Parent, int nSashId) { m_dDimension = dDimension; m_bIsRelative = bIsRelative; m_Parent = Parent; + m_nSashId = nSashId; // assengno maniglia if (Parent.SashList.Count == 0 || !Parent.SashList.Any(x => x.bHasHandle)) m_bHasHandle = true; @@ -2351,7 +2390,7 @@ namespace WebWindowTest internal JsonSashDimension Serialize() { - JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension); + JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, m_bHasHandle, m_dDimension, m_nSashId); return JsonSashDimension; } }