WebWindowTest:

- Aggiunto Nuget Egw.Window.Data per classe hardware
- Aggiunti medoti rimuovi split e sash
- Modificata interfaccia con bottoni per nuovi metodi
This commit is contained in:
Annamaria Sassi
2025-09-30 09:59:55 +02:00
parent dae213a691
commit ecb2dabf4a
12 changed files with 389 additions and 277 deletions
+90 -57
View File
@@ -38,7 +38,7 @@
{
int Index = i;
<li class="nav-item">
<a data-target="#Sash" class="@tabNavCss(CompileStep.Sash, Index)" aria-current="true" @onclick="() => NextStepAndPreview(CompileStep.Sash, Index)">Sash @(SashList.Count == 1 ? "" : Index + 1)</a>
<a data-target="#Sash" class="@tabNavCss(CompileStep.Sash, Index)" aria-current="true" @onclick="() => NextStepAndPreview(CompileStep.Sash, Index)">Window @(SashList.Count == 1 ? "" : Index + 1)</a>
</li>
}
}
@@ -207,16 +207,22 @@
<div class="col-sm-6">
<div class="border mb-2">
<div class="card-body py-2">
<h5 class="card-title m-0">Frame joints</h5>
<h5 class="card-title">Frame joints</h5>
<div class="row text-center">
<div class="col">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.ANGLED, FrameWindow)">Angled</button>
<div class="col-sm-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.ANGLED, FrameWindow)">Angled</button>
</div>
</div>
<div class="col">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_H, FrameWindow)">Horizontal</button>
<div class="col-sm-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_H, FrameWindow)">Horizontal</button>
</div>
</div>
<div class="col">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_V, FrameWindow)">Vertical</button>
<div class="col-sm-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_V, FrameWindow)">Vertical</button>
</div>
</div>
</div>
@foreach (Joint joint in FrameWindow.JointList)
@@ -233,14 +239,29 @@
</div>
</div>
</div>
@if (!(FrameWindow.AreaList[0] is Split))
@if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0))
{
<div class="col-sm-6">
<div class="border mb-2">
<div class="card-body py-2">
<h5 class="card-title">Frame</h5>
<div class="input-group mb-2">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => FrameWindow.AddSplit(FrameWindow)">Aggiungi split</button>
<h5 class="card-title">Area frame</h5>
<div class="row">
<div class="col-sm-6">
@if (!(FrameWindow.AreaList[0] is Split))
{
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => FrameWindow.AddSplit(FrameWindow)">Aggiungi split</button>
</div>
}
</div>
@if(SashList.Count == 0 && SplitList.Count == 0)
{
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => FrameWindow.AddSash()">Aggiungi window</button>
</div>
</div>
}
</div>
</div>
</div>
@@ -283,15 +304,27 @@
<div class="col">
<div class="border mb-2">
<div class="card-body py-2">
<h5>Split</h5>
@if ((currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 1) ||
(currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 0) ||
(currSplit.nSplitQtyVert == 0 && currSplit.nSplitQtyHoriz == 1))
{
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => SwapTwoAree(currSplit)">Swap Aree</button>
<div class="row">
<div class="col-sm-6">
<h5>Split</h5>
</div>
}
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => currSplit.Remove()">Remove split</button>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6"></div>
<div class="col-sm-6">
@if ((currSplit.nSplitQtyVert == 1 && currSplit.nSplitQtyHoriz == 0) || (currSplit.nSplitQtyVert == 0 && currSplit.nSplitQtyHoriz == 1))
{
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => SwapTwoAree(currSplit)">Swap Aree</button>
</div>
}
</div>
</div>
<div class ="row">
<div class="@splitContentCss(currSplit)">
<div class="input-group mb-2">
@@ -423,10 +456,18 @@
<div class="container">
<div class="row">
<div class="text-start p-1 display-4">
<div class="row">
<div class="col-sm-6"></div>
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => item.Remove()">Remove window</button>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="input-group mb-2">
<span class="input-group-text" id="NumberSash@(SashList.IndexOf(item) + 1)">Number</span>
<span class="input-group-text" id="NumberSash@(SashList.IndexOf(item) + 1)">Qty sash</span>
<input type="number" class="form-control" aria-label="NumberSash@(SashList.IndexOf(item) + 1)" @bind="@item.nSashQty">
</div>
</div>
@@ -464,6 +505,7 @@
for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++)
{
SashDimension sash = item.SashList[i * 2 + j];
Area anta = item.AreaList[i * 2 + j];
<div class="col-sm-6">
<div class="border mb-2">
<div class="card-body py-2">
@@ -505,6 +547,18 @@
<label class="form-check-label fs-6 text-dark" for="HandleSashLabel@(i * 2 + j + 1)">Handle</label>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => anta.AddSplit(anta)">Aggiungi split</button>
</div>
</div>
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" >Aggiungi inglesina</button>
</div>
</div>
</div>
<div class="row d-grid d-md-flex justify-content-center">
@for (int k = 1; k <= i * 2 + j; k++)
{
@@ -529,14 +583,20 @@
<div class="card-body py-2">
<h5 class="card-title">Sash joints</h5>
<div class="row p-0 m-0 text-center">
<div class="col">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.ANGLED, item)">Angled</button>
<div class="col-sm-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.ANGLED, item)">Angled</button>
</div>
</div>
<div class="col">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_H, item)">Horizontal</button>
<div class="col-sm-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_H, item)">Horizontal</button>
</div>
</div>
<div class="col">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_V, item)">Vertical</button>
<div class="col-sm-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.Json.WindowConst.Joints.FULL_V, item)">Vertical</button>
</div>
</div>
</div>
@foreach (Joint joint in item.JointList)
@@ -553,33 +613,6 @@
</div>
</div>
</div>
<div class="col-sm-6">
@for (int i = 0; i < item.AreaList.Count; i++)
{
Area anta;
@if (item.AreaList[i] is Splitted)
{
anta = item.AreaList[i];
}
else
{
anta = item;
}
@if (!(anta.AreaList[0] is Split))
{
<div class="col">
<div class="border mb-2">
<div class="card-body py-2">
<h5 class="card-title">Anta @(i + 1)</h5>
<div class="input-group mb-2">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => anta.AddSplit(anta)">Aggiungi split</button>
</div>
</div>
</div>
</div>
}
}
</div>
</div>
<div class="row">
<div class="col-sm-12">
@@ -603,7 +636,7 @@
<select class="form-select" id="Hardware" @bind="@item.SelHardwareTypeIndex">
@for (int i = 0; i < item.HardwareList.Count; i++)
{
<option value="@i">@item.HardwareList[i].sName</option>
<option value="@i">@item.HardwareList[i].Description</option>
}
</select>
</div>
@@ -628,12 +661,12 @@
<div class="card-body py-2">
<h5>Area Fill</h5>
<div class="row">
<div class="col-6 ">
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllFill(WebWindowTest.Json.WindowConst.FillTypes.GLASS)">All glass</button>
</div>
</div>
<div class="col-6">
<div class="col-sm-6">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllFill(WebWindowTest.Json.WindowConst.FillTypes.WOOD)">All wood</button>
</div>
+3 -3
View File
@@ -6,7 +6,7 @@ using Newtonsoft.Json.Linq;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.InteropServices;
using WebWindow.Base;
using Egw.Window.Data;
using WebWindowTest.DTO;
using WebWindowTest.Json;
using static WebWindowTest.Json.WindowConst;
@@ -313,7 +313,7 @@ namespace WebWindowTest
{
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
Dictionary<string, string> Args = new Dictionary<string, string>();
Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}");
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
Args.Add("Jwd", CurrJwd);
await EC_OnUpdate.InvokeAsync(Args);
}
@@ -851,7 +851,7 @@ namespace WebWindowTest
private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e)
{
Dictionary<string, string> Args = new Dictionary<string, string>();
Args.Add("Mode", $"{(int)Enums.EngineQueryType.Preview}");
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
Args.Add("Jwd", e.sJwd);
EC_OnUpdate.InvokeAsync(Args);
}
+1
View File
@@ -12,6 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Window.Data" Version="2.7.9.2909" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2507.1815" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2507.1815" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.19" />
+220 -172
View File
@@ -8,6 +8,7 @@ using System.Runtime.Intrinsics.Arm;
using System.Xml.Linq;
using System.Xml.Serialization;
using WebWindowTest.Json;
using Egw.Window.Data;
using static WebWindowTest.Json.WindowConst;
using static WebWindowTest.ParametriOpzioni;
@@ -1148,7 +1149,7 @@ namespace WebWindowTest
internal void SetSelHardwareFromId(string sId)
{
m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId)?? new Hardware("","","","","",0,0);
m_SelHardware = m_HardwareList.FirstOrDefault(x => x.Id == sId)?? new Hardware("","","","","",0,0);
if (m_SelHardware == null)
m_SelHardware = m_HardwareList[0];
}
@@ -1332,7 +1333,7 @@ namespace WebWindowTest
string sSashShape = FindSashShape();
string sOpeningType = ConvertOpeningType();
m_HardwareList = new ObservableCollection<Hardware>(from Hardware in m_HardwareCompleteList
where Hardware.sId == "000000" || (Hardware.sFamily == s_SelFamilyHW && Hardware.nSashQty == nSashQty && Hardware.sShape == sSashShape && Hardware.sOpeningType == sOpeningType)
where Hardware.Id == "000000" || (Hardware.FamilyName == s_SelFamilyHW && Hardware.SashQty == nSashQty && Hardware.Shape == sSashShape && Hardware.OpeningType == sOpeningType)
select Hardware);
}
@@ -1404,11 +1405,20 @@ namespace WebWindowTest
return newSash;
}
public void Remove()
{
ParentArea.AreaList.Remove(this);
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
ParentArea.AreaList.Add(newFill);
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
internal override JsonArea Serialize()
{
if (nCounterGroup < IdGroup)
Area.nCounterGroup = IdGroup;
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId, IdGroup);
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.Id, IdGroup);
foreach (var SashDimension in SashList)
JsonSash.SashList.Add(SashDimension.Serialize());
foreach (var Joint in JointList)
@@ -1446,67 +1456,84 @@ namespace WebWindowTest
}
set
{
// Ricalcolo dimensioni aggiungendo split
if (value > m_SplitVertList.Count - 1)
if (value == 0)
{
// recupero larghezza ultimo
double dLastDimension = 100;
double dNewDimension = 100;
if (m_SplitVertList.Count > 0)
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value; SplitIndex += -1)
m_SplitVertList.RemoveAt(SplitIndex);
if (nSplitQtyHoriz == 0)
{
dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert);
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension);
ParentArea.AreaList.Remove(this);
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
ParentArea.AreaList.Add(newFill);
}
else
dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert);
// aggiungo area Split di default
for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++)
m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true));
SetSplitShape(SplitShapes.HORIZONTAL);
}
else if (value == 0)
{
m_SplitVertList.RemoveAt(1);
m_SplitVertList.RemoveAt(0);
}
// Ricalcolo dimensioni rimuovendo split
else
{
double dLastDimension = 0;
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
// Ricalcolo dimensioni aggiungendo split
if (value > m_SplitVertList.Count - 1)
{
dLastDimension += m_SplitVertList[SplitIndex].dDimension;
m_SplitVertList.RemoveAt(SplitIndex);
// recupero larghezza ultimo
double dLastDimension = 100;
double dNewDimension = 100;
if (m_SplitVertList.Count > 0)
{
dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert);
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension);
}
else
dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert);
// aggiungo area Split di default
for (var SplitIndex = m_SplitVertList.Count; SplitIndex <= value; SplitIndex++)
m_SplitVertList.Add(new SplitDimension(dNewDimension, true, this, true));
}
dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension);
}
// Controllo quanti split orizzontali ci sono
int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1;
// Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta
for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++)
{
AreaList.Add(Splitted.CreateSplitted(this));
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
}
// Se ho più di uno split, elimino l'ultimo
if (AreaList.Count > 2)
{
int nAreaList = AreaList.Count - 1;
for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++)
else if (value == 0)
{
AreaList.Remove(AreaList[AreaList.Count - 1]);
m_SplitVertList.RemoveAt(1);
m_SplitVertList.RemoveAt(0);
}
// Ricalcolo dimensioni rimuovendo split
else
{
double dLastDimension = 0;
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
{
dLastDimension += m_SplitVertList[SplitIndex].dDimension;
m_SplitVertList.RemoveAt(SplitIndex);
}
dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension);
}
// Controllo quanti split orizzontali ci sono
int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1;
// Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta
for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitVertList.Count * nHoriz) - 1; SplitIndex++)
{
AreaList.Add(Splitted.CreateSplitted(this));
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
}
// Se ho più di uno split, elimino l'ultimo
if (AreaList.Count > 2)
{
int nAreaList = AreaList.Count - 1;
for (var SplitIndex = (m_SplitVertList.Count * nHoriz); SplitIndex <= nAreaList; SplitIndex++)
{
AreaList.Remove(AreaList[AreaList.Count - 1]);
}
}
// Se elimino l'unico split presente
else
{
Splitted s = (Splitted)AreaList[0];
s.SetParentArea(ParentArea);
ParentArea.AreaList.Add(s);
ParentArea.AreaList.Remove(this);
}
}
// Se elimino l'unico split presente
else
{
Splitted s = (Splitted)AreaList[0];
s.SetParentArea(ParentArea);
ParentArea.AreaList.Add(s);
ParentArea.AreaList.Remove(this);
}
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
@@ -1545,67 +1572,79 @@ namespace WebWindowTest
}
set
{
// Ricalcolo dimensioni aggiungendo split
if (value > m_SplitHorizList.Count - 1)
if (value == 0)
{
// recupero larghezza ultimo
double dLastDimension = 100;
double dNewDimension = 100;
if (m_SplitHorizList.Count > 0)
for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value; SplitIndex += -1)
m_SplitHorizList.RemoveAt(SplitIndex);
if (nSplitQtyVert == 0)
{
dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz);
m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension);
ParentArea.AreaList.Remove(this);
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
ParentArea.AreaList.Add(newFill);
}
else
dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz);
// aggiungo area Split di default
for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++)
m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false));
SetSplitShape(SplitShapes.VERTICAL);
}
else if (value == 0)
{
m_SplitHorizList.RemoveAt(1);
m_SplitHorizList.RemoveAt(0);
}
// Ricalcolo dimensioni rimuovendo split
else
{
double dLastDimension = 0;
for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
// Ricalcolo dimensioni aggiungendo split
if (value > m_SplitHorizList.Count - 1)
{
dLastDimension += m_SplitHorizList[SplitIndex].dDimension;
m_SplitHorizList.RemoveAt(SplitIndex);
// recupero larghezza ultimo
double dLastDimension = 100;
double dNewDimension = 100;
if (m_SplitHorizList.Count > 0)
{
dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz);
m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension);
}
else
dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz);
// aggiungo area Split di default
for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++)
m_SplitHorizList.Add(new SplitDimension(dNewDimension, true, this, false));
}
dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension);
}
// Controllo quanti split verticali ci sono
int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1;
// Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta
for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++)
{
AreaList.Add(Splitted.CreateSplitted(this));
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
}
// Se ho più di uno split, elimino l'ultimo
if (AreaList.Count > 2)
{
int nAreaList = AreaList.Count - 1;
for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++)
// Ricalcolo dimensioni rimuovendo split
else
{
AreaList.Remove(AreaList[AreaList.Count - 1]);
double dLastDimension = 0;
for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
{
dLastDimension += m_SplitHorizList[SplitIndex].dDimension;
m_SplitHorizList.RemoveAt(SplitIndex);
}
dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension);
}
// Controllo quanti split verticali ci sono
int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1;
// Se aggiungo split devo aggiungere vetro nell'area splitted aggiunta
for (var SplitIndex = AreaList.Count; SplitIndex <= (m_SplitHorizList.Count * nVert) - 1; SplitIndex++)
{
AreaList.Add(Splitted.CreateSplitted(this));
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
AreaList[AreaList.Count - 1].AreaList.Add(newFill);
}
// Se ho più di uno split, elimino l'ultimo
if (AreaList.Count > 2)
{
int nAreaList = AreaList.Count - 1;
for (var SplitIndex = (m_SplitHorizList.Count * nVert); SplitIndex <= nAreaList; SplitIndex++)
{
AreaList.Remove(AreaList[AreaList.Count - 1]);
}
}
// Se elimino l'unico split presente
else
{
Splitted s = (Splitted)AreaList[0];
s.SetParentArea(ParentArea);
ParentArea.AreaList.Add(s);
ParentArea.AreaList.Remove(this);
}
}
// Se elimino l'unico split presente
else
{
Splitted s = (Splitted)AreaList[0];
s.SetParentArea(ParentArea);
ParentArea.AreaList.Add(s);
ParentArea.AreaList.Remove(this);
}
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
@@ -1789,6 +1828,15 @@ namespace WebWindowTest
return newSplit;
}
public void Remove()
{
ParentArea.AreaList.Remove(this);
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
newFill.SetAreaType(AreaTypes.FILL);
ParentArea.AreaList.Add(newFill);
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
}
internal override JsonArea Serialize()
{
if (nCounterGroup < IdGroup)
@@ -2017,82 +2065,82 @@ namespace WebWindowTest
}
}
public class Hardware
{
private string m_sId;
public string sId
{
get
{
return m_sId;
}
}
//public class Hardware
//{
// private string m_sId;
// public string sId
// {
// get
// {
// return m_sId;
// }
// }
private string m_sFamily;
public string sFamily
{
get
{
return m_sFamily;
}
}
// private string m_sFamily;
// public string sFamily
// {
// get
// {
// return m_sFamily;
// }
// }
private string m_sName;
public string sName
{
get
{
return m_sName;
}
}
// private string m_sName;
// public string sName
// {
// get
// {
// return m_sName;
// }
// }
private string m_sOpeningType;
public string sOpeningType
{
get
{
return m_sOpeningType;
}
}
// private string m_sOpeningType;
// public string sOpeningType
// {
// get
// {
// return m_sOpeningType;
// }
// }
private string m_sShape;
public string sShape
{
get
{
return m_sShape;
}
}
// private string m_sShape;
// public string sShape
// {
// get
// {
// return m_sShape;
// }
// }
private int m_nSashQty;
public int nSashQty
{
get
{
return m_nSashQty;
}
}
// private int m_nSashQty;
// public int nSashQty
// {
// get
// {
// return m_nSashQty;
// }
// }
private int m_nSashPosition;
public int nSashPosition
{
get
{
return m_nSashPosition;
}
}
// private int m_nSashPosition;
// public int nSashPosition
// {
// get
// {
// return m_nSashPosition;
// }
// }
public Hardware(string sId, string sFamily, string sName, string sOpeningType, string sShape, int nSashQty, int nSashPosition)
{
m_sId = sId;
m_sFamily = sFamily;
m_sName = sName;
m_sOpeningType = sOpeningType;
m_sShape = sShape;
m_nSashQty = nSashQty;
m_nSashPosition = nSashPosition;
}
}
// public Hardware(string sId, string sFamily, string sName, string sOpeningType, string sShape, int nSashQty, int nSashPosition)
// {
// m_sId = sId;
// m_sFamily = sFamily;
// m_sName = sName;
// m_sOpeningType = sOpeningType;
// m_sShape = sShape;
// m_nSashQty = nSashQty;
// m_nSashPosition = nSashPosition;
// }
//}
public partial class ParametriOpzioni
{