diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 897a52b..3119572 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -93,8 +93,8 @@ namespace Test.UI.Components.Pages protected Dictionary> AvailThreshold { get; set; } = new Dictionary>() { - {"Profilo78", new List() { new Threshold(1, "Bottom"), new Threshold(3, "Threshold")}}, - {"ProfiloSaomad", new List(){ new Threshold(1, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(3, "Threshold")}} + {"Profilo78", new List() { new Threshold(3, "Bottom"), new Threshold(1, "Threshold")}}, + {"ProfiloSaomad", new List(){ new Threshold(3, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(1, "Threshold")}} }; [Inject] diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index a814cf0..663e8a9 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -14,7 +14,7 @@ namespace WebWindowComplex.Models #region Public Fields // Lista hardware completa passata dal chiamante del componente - public static Dictionary> m_AllThresholdList = new Dictionary>(); + public static Dictionary> m_AllThresholdList = new Dictionary>(); #endregion Public Fields @@ -84,7 +84,7 @@ namespace WebWindowComplex.Models } set { - m_SelThreshold = m_ThresholdList.Where(x=>x.Type.Equals(value)).First(); + m_SelThreshold = m_ThresholdList.Where(x => x.Type.Equals(value)).First(); } } @@ -155,7 +155,7 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1400, true)); foreach (var dim in DimensionList) - SearchAreaList(this, dim.dDimension,dim.sName); + SearchAreaList(this, dim.dDimension, dim.sName); break; } @@ -244,7 +244,7 @@ namespace WebWindowComplex.Models JointList.Add(new Joint(this, 1, oldJointType[0].SelJointType)); JointList.Add(new Joint(this, 2, oldJointType[1].SelJointType)); JointList.Add(new Joint(this, 3, oldJointType[2].SelJointType)); - if(oldJointType.Count > 3) + if (oldJointType.Count > 3) JointList.Add(new Joint(this, 4, oldJointType[3].SelJointType)); else JointList.Add(new Joint(this, 4, Joints.FULL_V)); @@ -268,9 +268,9 @@ namespace WebWindowComplex.Models JointList.Add(new Joint(this, 1, oldJointType[0].SelJointType)); JointList.Add(new Joint(this, 2, oldJointType[1].SelJointType)); JointList.Add(new Joint(this, 3, Joints.ANGLED)); - foreach(var s in sashList) + foreach (var s in sashList) { - foreach(var sashDim in s.SashList) + foreach (var sashDim in s.SashList) { sashDim.JointList.RemoveAt(sashDim.JointList.Count - 1); sashDim.JointList.Last().SelJointType = Joints.ANGLED; @@ -284,11 +284,11 @@ namespace WebWindowComplex.Models break; } } - if(JointList.Count > 3) + if (JointList.Count > 3) { foreach (var s in sashList) { - foreach(var sashDim in s.SashList) + foreach (var sashDim in s.SashList) { if (sashDim.JointList.Count == 3) sashDim.JointList.Add(new Joint(s, 4, Joints.FULL_V)); @@ -314,7 +314,7 @@ namespace WebWindowComplex.Models } } - protected List SearchSash(List sashList,Area node) + protected List SearchSash(List sashList, Area node) { if (node != null) { @@ -379,7 +379,10 @@ namespace WebWindowComplex.Models newFrame.SetBottomRail(false); newFrame.SetBottomRailQty(0); newFrame.RefreshThresholdList(); - newFrame.SetSelThresholdFromName(m_AllThresholdList.GetValueOrDefault(Window.sProfilePath).FirstOrDefault().Name); + if (m_AllThresholdList != null && m_AllThresholdList.Any()) + { + newFrame.SetSelThresholdFromName(m_AllThresholdList.GetValueOrDefault(Window.sProfilePath)?.FirstOrDefault()?.Name ?? ""); + } //newFrame.FrameArcElem = null; return newFrame; } @@ -528,9 +531,17 @@ namespace WebWindowComplex.Models m_Shape = Value; } - internal void SetSelThresholdFromName(string value) + internal void SetSelThresholdFromName(string? value) { - m_SelThreshold = m_ThresholdList.Where(x=>x.Name.Equals(value)).First(); + // verifica ci sia un valore... + if (!string.IsNullOrEmpty(value)) + { + m_SelThreshold = m_ThresholdList.Where(x => x.Name.Equals(value)).First(); + } + else + { + m_SelThreshold = m_ThresholdList.FirstOrDefault() ?? new Threshold(1, "Bottom"); + } } #endregion Internal Methods diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 4ae47d0..9ef7e71 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.12.2314 + 2.7.12.2316 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -432,6 +432,13 @@ + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 19322dd..1a4ce21 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.7.12.2314 + 2.7.12.2316 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -553,6 +553,16 @@ + + + + + + + + + +