- Aggiornato passaggio parametri tra componenti

- Aggiornata interfaccia sash
- Aggiornato jwd di base nel caso di sbagliata deserializzazione
- Aggiornato readme
This commit is contained in:
Annamaria Sassi
2025-11-24 14:50:32 +01:00
parent cf912c8f21
commit 1fed423ab0
22 changed files with 617 additions and 448 deletions
+32 -10
View File
@@ -1,13 +1,12 @@
using Egw.Window.Data;
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using System.Reflection.Metadata;
using WebWindowComplex.Compo;
using WebWindowComplex.DTO;
using WebWindowComplex.Json;
using WebWindowComplex.Models;
using static WebWindowComplex.LayoutConst;
using static WebWindowComplex.Json.WindowConst;
using static WebWindowComplex.LayoutConst;
namespace WebWindowComplex
{
@@ -736,13 +735,36 @@ namespace WebWindowComplex
{
listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}");
// uso un oggetto "basico" per non fermarmi
WindowFromJson = new JsonWindow("", "", "", "");
List<JsonArea> AreaList = new List<JsonArea>();
JsonFrame baseFrame = new JsonFrame();
baseFrame.DimensionList.Add(new JsonFrameDimension(0, "Width", 800));
baseFrame.DimensionList.Add(new JsonFrameDimension(0, "Height", 1200));
AreaList.Add(baseFrame);
WindowFromJson.AreaList = AreaList;
//string jwd = "{\r\n \"ProfilePath\": \"Profilo78\",\r\n \"Material\": \"Pino\",\r\n \"ColorMaterial\": \"Black\",\r\n \"Glass\": \"Vetro BE 2S 4T/16/4T\",\r\n \"AreaList\": [\r\n {\r\n \"Shape\": \"RECTANGLE\",\r\n \"DimensionList\": [\r\n {\r\n \"Index\": 1,\r\n \"Name\": \"Width\",\r\n \"Value\": 800.0\r\n },\r\n {\r\n \"Index\": 2,\r\n \"Name\": \"Height\",\r\n \"Value\": 1200.0\r\n }\r\n ],\r\n \"JointList\": [\r\n {\r\n \"Index\": 1,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 2,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 3,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 4,\r\n \"JointType\": \"FULL_H\"\r\n }\r\n ],\r\n \"BottomRail\": false,\r\n \"BottomRailQty\": 0,\r\n \"GroupId\": 1,\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"GroupId\": 7,\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"FRAME\"\r\n }\r\n ]\r\n}";
//WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
//setCurrWindow(WindowFromJson);
//await DoPreviewSvg(true);
Window window = new Window();
Frame frame = new Frame(null, window);
List<FrameDimension> DimensionList = new List<FrameDimension>
{
new FrameDimension(frame, 1, "Width", 800, false),
new FrameDimension(frame, 1, "Height", 1200, true)
};
List<Joint> JointList = new List<Joint>
{
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, false, 0, 1);
jsonWindow.AreaList.Add(jsonFrame);
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<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
setCurrWindow(WindowFromJson);
await DoPreviewSvg(true);
}
}
else
@@ -759,7 +781,7 @@ namespace WebWindowComplex
if (updRequested)
{
// se mancasse dizionario forme chiamo quello
if (LiveData.DictShape.Count == 0)
if (LiveData.DictShape.Count == 0 && listErrLink.Count == 0)
{
if (firstDisplay && isRendered)
{