diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index ab8a272..e5fae04 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -632,7 +632,7 @@ namespace WebWindowComplex.Models internal void SetSelThresholdFromName(string? value) { // verifica ci sia un valore... - if (!string.IsNullOrEmpty(value)) + if (!string.IsNullOrEmpty(value) && m_ThresholdList != null && m_ThresholdList.Count > 0) { m_SelThreshold = m_ThresholdList.Where(x => x.Name.Equals(value)).First(); } diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index d97a5d8..57c2eb2 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -606,34 +606,7 @@ namespace WebWindowComplex //WindowFromJson = JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); //setCurrWindow(WindowFromJson); //await DoPreviewSvg(true); - Window window = new Window(); - Frame frame = new Frame(null, window); - List DimensionList = new List - { - new FrameDimension(frame, 1, "Width", 800, false), - new FrameDimension(frame, 1, "Height", 1200, true) - }; - List JointList = new List - { - new Joint(frame, 1, Joints.FULL_H), - new Joint(frame, 2, Joints.FULL_H), - new Joint(frame, 3, Joints.FULL_H), - new Joint(frame, 4, Joints.FULL_H) - }; - //FrameArcElement ae = new FrameArcElement(frame, window, 10, true, true); - JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T"); - JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, "Bottom", false, 0, 1); - jsonWindow.AreaList.Add(jsonFrame); - //jsonFrame.ArcElement = ae.Serialize(); - foreach (var Dimension in DimensionList) - jsonFrame.DimensionList.Add(Dimension.Serialize()); - foreach (var Joint in JointList) - jsonFrame.JointList.Add(Joint.Serialize()); - jsonFrame.AreaList.Add(Fill.CreateFill(frame, FillTypes.GLASS).Serialize(true)); - string jwd = JsonConvert.SerializeObject(jsonWindow); - WindowFromJson = JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); - setCurrWindow(WindowFromJson); - await DoPreviewSvg(true); + BuildFrameDefault(); } } else @@ -679,6 +652,10 @@ namespace WebWindowComplex } } } + else + { + BuildFrameDefault(); + } } else { @@ -688,6 +665,37 @@ namespace WebWindowComplex } } + private async Task BuildFrameDefault() + { + Window window = new Window(); + Frame frame = new Frame(null, window); + List DimensionList = new List + { + new FrameDimension(frame, 1, "Width", 800, false), + new FrameDimension(frame, 1, "Height", 1200, true) + }; + List JointList = new List + { + new Joint(frame, 1, Joints.FULL_H), + new Joint(frame, 2, Joints.FULL_H), + new Joint(frame, 3, Joints.FULL_H), + new Joint(frame, 4, Joints.FULL_H) + }; + JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T"); + JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, "Bottom", false, 0, 1); + jsonWindow.AreaList.Add(jsonFrame); + //jsonFrame.ArcElement = ae.Serialize(); + foreach (var Dimension in DimensionList) + jsonFrame.DimensionList.Add(Dimension.Serialize()); + foreach (var Joint in JointList) + jsonFrame.JointList.Add(Joint.Serialize()); + jsonFrame.AreaList.Add(Fill.CreateFill(frame, FillTypes.GLASS).Serialize(true)); + string jwd = JsonConvert.SerializeObject(jsonWindow); + JsonWindow WindowFromJson = JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); + setCurrWindow(WindowFromJson); + await DoPreviewSvg(true); + } + /// /// Metodo per costruire oggetti della Window /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index c07d4eb..a0e5fe8 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.316 + 3.1.2.317 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -41,4 +41,12 @@ + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 7f99aef..98a57ec 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.316 + 3.1.2.317 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -48,3 +48,11 @@ + + + + + + + +