From e0bb0ddb200b47c797b5414db53e0a1e14253aeb Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Thu, 19 Feb 2026 17:15:28 +0100 Subject: [PATCH] Correzioni --- WebWindowComplex/Compo/BottomRail.razor.cs | 8 +++--- WebWindowComplex/Compo/EditElement.razor.cs | 8 +++--- .../Compo/EditSplitDimensions.razor.cs | 5 ++-- WebWindowComplex/Models/Area.cs | 21 +++++--------- WebWindowComplex/Models/AreaDimension.cs | 6 ++-- WebWindowComplex/Models/ElementDimension.cs | 28 +++++++++---------- WebWindowComplex/Models/Frame.cs | 5 ++-- WebWindowComplex/Models/Sash.cs | 14 ++++------ WebWindowComplex/Models/SplitDimension.cs | 19 +++++-------- WebWindowComplex/TableComp.razor | 11 +------- WebWindowComplex/WebWindowComplex.csproj | 6 +++- .../WebWindowConfigurator.csproj | 6 +++- 12 files changed, 57 insertions(+), 80 deletions(-) diff --git a/WebWindowComplex/Compo/BottomRail.razor.cs b/WebWindowComplex/Compo/BottomRail.razor.cs index 6369763..447c033 100644 --- a/WebWindowComplex/Compo/BottomRail.razor.cs +++ b/WebWindowComplex/Compo/BottomRail.razor.cs @@ -53,16 +53,16 @@ namespace WebWindowComplex.Compo private Frame? CurrFrame() { - if(CurrArea is Frame) - return (Frame)CurrArea; + if(CurrArea is Frame frame) + return frame; else return null; } private Sash? CurrSash() { - if (CurrArea is Sash) - return (Sash)CurrArea; + if (CurrArea is Sash sash) + return sash; else return null; } diff --git a/WebWindowComplex/Compo/EditElement.razor.cs b/WebWindowComplex/Compo/EditElement.razor.cs index ba82bbd..971665d 100644 --- a/WebWindowComplex/Compo/EditElement.razor.cs +++ b/WebWindowComplex/Compo/EditElement.razor.cs @@ -41,10 +41,10 @@ namespace WebWindowComplex.Compo else { int nElement = 0; - if (CurrRec.ParentArea is Frame) - nElement = ((Frame)CurrRec.ParentArea).ElementDimensionList.Count; - else if(CurrRec.ParentArea is Sash) - nElement = ((Sash)CurrRec.ParentArea).SashList.FirstOrDefault()!.ElementDimensionList.Count; + if (CurrRec.ParentArea is Frame frame) + nElement = frame.ElementDimensionList.Count; + else if(CurrRec.ParentArea is Sash sash) + nElement = sash.SashList.FirstOrDefault()!.ElementDimensionList.Count; switch (nElement) { case 4: diff --git a/WebWindowComplex/Compo/EditSplitDimensions.razor.cs b/WebWindowComplex/Compo/EditSplitDimensions.razor.cs index 9948f6a..0e249be 100644 --- a/WebWindowComplex/Compo/EditSplitDimensions.razor.cs +++ b/WebWindowComplex/Compo/EditSplitDimensions.razor.cs @@ -77,10 +77,9 @@ namespace WebWindowComplex.Compo private string SplitDimCss() { - if(CurrRec.Parent is Split) + if(CurrRec.Parent is Split split) { - Split s = (Split)CurrRec.Parent; - if (s.SelSplitShape.Equals(Json.WindowConst.SplitShapes.GRID)) + if (split.SelSplitShape.Equals(Json.WindowConst.SplitShapes.GRID)) return ""; else return "col-md-12 col-lg-6"; diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index f220150..005e4e6 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -158,9 +158,8 @@ namespace WebWindowComplex.Models // Inserisco nelle aree Splitted Fill e la struttura precedente (e setto ParentArea del fill) ContentArea[0].SetParentArea(newSplittedList[1]); newSplittedList[0].AreaList.Add(ContentArea[0]); - if (ContentArea[0] is Fill) + if (ContentArea[0] is Fill fill1) { - Fill fill1 = (Fill)ContentArea[0]; Fill fill2 = Fill.CreateFill(newSplittedList[0], fill1.FillType); newSplittedList[1].AreaList.Add(fill2); } @@ -310,9 +309,8 @@ namespace WebWindowComplex.Models public void UpdateDimSubArea(Area area, double dim, string nameDim) { - if (area is Sash && nameDim.Equals("Width")) + if (area is Sash sash && nameDim.Equals("Width")) { - Sash sash = (Sash)area; int countAbsolute = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Count(); int countProportional = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).Count(); int countPercentage = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PERCENTAGE)).Count(); @@ -384,9 +382,8 @@ namespace WebWindowComplex.Models } } } - else if (area is Split) + else if (area is Split split) { - Split split = (Split)area; List splitList = new List(); double sum = 0; if (nameDim.Equals("Width")) @@ -526,9 +523,8 @@ namespace WebWindowComplex.Models if (area.Equals(this)) return width; Area item = area.AreaList[i]; - if (area is Split) + if (area is Split split) { - Split split = (Split)area; if (split.SplitVertList.Count > 0) { switch (split.SplitVertList.ElementAt(i).SelMeasureType) @@ -557,9 +553,8 @@ namespace WebWindowComplex.Models if (risultato != -1) return risultato; } - else if (area is Sash) + else if (area is Sash sash) { - Sash sash = (Sash)area; switch (sash.SashList.ElementAt(i).SelMeasureType) { case MeasureTypes.ABSOLUTE: @@ -606,9 +601,8 @@ namespace WebWindowComplex.Models if (area.Equals(this)) return height; Area item = area.AreaList[i]; - if (area is Split) + if (area is Split split) { - Split split = (Split)area; if (split.SplitHorizList.Count > 0) { switch (split.SplitHorizList.ElementAt(i).SelMeasureType) @@ -637,9 +631,8 @@ namespace WebWindowComplex.Models if (risultato != -1) return risultato; } - else if (area is Sash) + else if (area is Sash sash) { - Sash sash = (Sash)area; switch (sash.SashList.ElementAt(i).SelMeasureType) { case MeasureTypes.ABSOLUTE: diff --git a/WebWindowComplex/Models/AreaDimension.cs b/WebWindowComplex/Models/AreaDimension.cs index 4d97fb7..7a1e9e4 100644 --- a/WebWindowComplex/Models/AreaDimension.cs +++ b/WebWindowComplex/Models/AreaDimension.cs @@ -251,14 +251,12 @@ namespace WebWindowComplex.Models { //return Double.Round(dDimension, 2); double overlapElem = 0; - if (m_Parent is Sash) + if (m_Parent is Sash s) { // Calcolo overlap - Sash s = (Sash)m_Parent; int indexSash = -1; - if (this is SashDimension) + if (this is SashDimension sashDimCurr) { - SashDimension sashDimCurr = (SashDimension)this; indexSash = s.SashList.IndexOf(sashDimCurr); } else diff --git a/WebWindowComplex/Models/ElementDimension.cs b/WebWindowComplex/Models/ElementDimension.cs index 378f8b9..1717a5a 100644 --- a/WebWindowComplex/Models/ElementDimension.cs +++ b/WebWindowComplex/Models/ElementDimension.cs @@ -34,21 +34,20 @@ namespace WebWindowComplex.Models { if(dDimension != value) { - if (m_ParentArea is Split) + if (m_ParentArea is Split split) { if (value > m_dMax) value = m_dMax; else if (value < m_dMin) value = m_dMin; - Split s = (Split)m_ParentArea; SplitElementDimension splitElem = (SplitElementDimension)this; List elemList = new List(); - Frame? frame = s.ParentWindow.AreaList.First(); + Frame? frame = split.ParentWindow.AreaList.First(); double dimTot = 0; - if (s.ElemDimVertList.Contains(splitElem)) - elemList = s.SplitVertList; - else if (s.ElemDimHorizList.Contains(splitElem)) - elemList = s.SplitHorizList; + if (split.ElemDimVertList.Contains(splitElem)) + elemList = split.SplitVertList; + else if (split.ElemDimHorizList.Contains(splitElem)) + elemList = split.SplitHorizList; if(elemList.ElementAt(m_nIndex).MeasureType is MeasureTypes.ABSOLUTE || elemList.ElementAt(m_nIndex - 1).MeasureType is MeasureTypes.ABSOLUTE) { @@ -67,35 +66,34 @@ namespace WebWindowComplex.Models elemList.ElementAt(m_nIndex).SetDimension(elemList.ElementAt(m_nIndex).dDimension + diff); } } - else if(m_ParentArea is Sash && (m_nIndex == 2 || m_nIndex == 4)) + else if(m_ParentArea is Sash sash && (m_nIndex == 2 || m_nIndex == 4)) { if (value > m_dMax) value = m_dMax; else if (value < m_dMin) value = m_dMin; - Sash s = (Sash)m_ParentArea; - if (s.bIsDimensionLight) + if (sash.bIsDimensionLight) { int indSash = -1; - for(int i = 0; i < s.SashList.Count; i++) + for(int i = 0; i < sash.SashList.Count; i++) { - if (s.SashList.ElementAt(i).ElementDimensionList.Contains(this)) + if (sash.SashList.ElementAt(i).ElementDimensionList.Contains(this)) { indSash = i; break; } } - if(s.SashList.ElementAt(indSash).MeasureType is MeasureTypes.ABSOLUTE) + if(sash.SashList.ElementAt(indSash).MeasureType is MeasureTypes.ABSOLUTE) { if (value > m_dDimension) { double diff = (value - m_dDimension); - s.SashList.ElementAt(indSash).SetDimension(s.SashList.ElementAt(indSash).dDimension - diff); + sash.SashList.ElementAt(indSash).SetDimension(sash.SashList.ElementAt(indSash).dDimension - diff); } else { double diff = m_dDimension - value; - s.SashList.ElementAt(indSash).SetDimension(s.SashList.ElementAt(indSash).dDimension + diff); + sash.SashList.ElementAt(indSash).SetDimension(sash.SashList.ElementAt(indSash).dDimension + diff); } } } diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 92c3454..4f6f73b 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -456,10 +456,9 @@ namespace WebWindowComplex.Models if(AreaList.First() is Sash) overlap = ElementDimensionList.ElementAt(1).dOverlap + ElementDimensionList.Last().dOverlap; - if (AreaList.First() is Split) + if (AreaList.First() is Split split) { - Split s = (Split)AreaList.First(); - if(s.SplitHorizList.Count > 0) + if(split.SplitHorizList.Count > 0) overlap = ElementDimensionList.ElementAt(1).dOverlap + ElementDimensionList.Last().dOverlap; } diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index 3c656a0..b7f99e0 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -1097,9 +1097,8 @@ namespace WebWindowComplex.Models return res; } Area item = area.AreaList[i]; - if (area is Split) + if (area is Split split) { - Split split = (Split)area; if (split.SplitVertList.Count > 0) { double dim = width; @@ -1136,9 +1135,8 @@ namespace WebWindowComplex.Models break; } } - if (split.ParentArea is Frame && split.AreaList.ElementAt(i).AreaList.First() is Sash) + if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash) { - Frame frame = (Frame)split.ParentArea; string overlapName = string.Join("_", split.ElemDimVertList.First().sName.Split('_').Skip(1)) + "_Top_Overlap"; if (i == 0) { @@ -1167,9 +1165,8 @@ namespace WebWindowComplex.Models return res; } } - else if (area is Sash) + else if (area is Sash sash) { - Sash sash = (Sash)area; switch (sash.SashList.ElementAt(i).SelMeasureType) { case MeasureTypes.ABSOLUTE: @@ -1198,10 +1195,9 @@ namespace WebWindowComplex.Models if (res.m_Dimension != -1 && res.m_Found) return res; } - else if (area is Frame) + else if (area is Frame frame) { - Frame f = (Frame)area; - res = CalculateWidthSashGroup(item, f.AvailWidthArea(), res); + res = CalculateWidthSashGroup(item, frame.AvailWidthArea(), res); if (res.m_Dimension != -1 && res.m_Found) return res; } diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs index ccf9056..95652b5 100644 --- a/WebWindowComplex/Models/SplitDimension.cs +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -321,9 +321,8 @@ namespace WebWindowComplex.Models return res; } Area item = area.AreaList[i]; - if (area is Split) + if (area is Split split) { - Split split = (Split)area; if(split.SplitVertList.Count > 0) { int index = i; @@ -363,9 +362,8 @@ namespace WebWindowComplex.Models return res; } } - else if (area is Sash) + else if (area is Sash sash) { - Sash sash = (Sash)area; switch (sash.SashList.ElementAt(i).SelMeasureType) { case MeasureTypes.ABSOLUTE: @@ -458,9 +456,8 @@ namespace WebWindowComplex.Models return res; } Area item = area.AreaList[i]; - if (area is Split) + if (area is Split split) { - Split split = (Split)area; if (split.SplitHorizList.Count > 0) { double dim = height; @@ -501,9 +498,8 @@ namespace WebWindowComplex.Models break; } } - if (split.ParentArea is Frame && split.AreaList.ElementAt(i).AreaList.First() is Sash) + if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash) { - Frame frame = (Frame)split.ParentArea; string pos = i == 0 ? "_Top_Overlap" : "_Bottom_Overlap"; string overlapName = string.Join("_", split.ElemDimHorizList.First().sName.Split('_').Skip(1)); if (i == 0) @@ -533,11 +529,10 @@ namespace WebWindowComplex.Models return res; } } - else if (area is Sash) + else if (area is Sash sash) { - Sash s = (Sash)area; - double dim = height - s.SashList.First().ElementDimensionList.First().dDimension - - s.SashList.First().ElementDimensionList.ElementAt(s.SashList.First().ElementDimensionList.Count - 2).dDimension; + double dim = height - sash.SashList.First().ElementDimensionList.First().dDimension + - sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dDimension; res = CalculateHeightSplitGroup(item, dim, res); if (res.m_Dimension != -1 && res.m_Found) return res; diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index c6c4546..a4c4175 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -61,15 +61,6 @@
- @*
- -
-
- -
-
- -
*@ @@ -78,7 +69,7 @@
-
+
@if (currStep == CompileStep.Tree) { net8.0 enable enable - 3.1.2.1818 + 3.1.2.1915 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -217,6 +217,10 @@ + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index ad62553..54f71d8 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1818 + 3.1.2.1915 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -189,6 +189,10 @@ + + + +