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:
+220
-172
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user