Copiato codice da componente WebWindowTest a WebWindowComplex
This commit is contained in:
+145
-80
@@ -6,8 +6,8 @@ using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Runtime.Intrinsics.Arm;
|
||||
using System.Xml.Serialization;
|
||||
using WebWindow.Base;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.ParametriOpzioni;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
namespace WebWindowComplex
|
||||
@@ -30,6 +30,48 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
private string m_sMaterial;
|
||||
public string sMaterial
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sMaterial;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sMaterial = value;
|
||||
OnUpdatePreview(sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
private string m_sColorMaterial;
|
||||
public string sColorMaterial
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sColorMaterial;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sColorMaterial = value;
|
||||
OnUpdatePreview(sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
private string m_sGlass;
|
||||
public string sGlass
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sGlass;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sGlass = value;
|
||||
OnUpdatePreview(sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<Frame> m_AreaList = new ObservableCollection<Frame>();
|
||||
public ObservableCollection<Frame> AreaList
|
||||
{
|
||||
@@ -45,7 +87,7 @@ namespace WebWindowComplex
|
||||
|
||||
internal JsonWindow Serialize()
|
||||
{
|
||||
JsonWindow JsonWindow = new JsonWindow(sProfilePath);
|
||||
JsonWindow JsonWindow = new JsonWindow(sProfilePath, sMaterial, sColorMaterial, sGlass);
|
||||
foreach (var Area in AreaList)
|
||||
JsonWindow.AreaList.Add(Area.Serialize());
|
||||
return JsonWindow;
|
||||
@@ -202,7 +244,7 @@ namespace WebWindowComplex
|
||||
Sash SashArea = Sash.CreateSash(ParentArea);
|
||||
// Aggiungo area
|
||||
AreaList.Add(SashArea);
|
||||
if(SashArea.nSashQty == 1)
|
||||
if (SashArea.nSashQty == 1)
|
||||
{
|
||||
// Inserisco il riempimento precedente
|
||||
AreaList[0].AreaList.Add(ContentArea[0]);
|
||||
@@ -227,7 +269,7 @@ namespace WebWindowComplex
|
||||
public void SwapAree()
|
||||
{
|
||||
Area tempArea;
|
||||
if(this is Sash || this is Split)
|
||||
if (this is Sash || this is Split)
|
||||
{
|
||||
tempArea = AreaList[0];
|
||||
AreaList[0] = AreaList[1];
|
||||
@@ -630,7 +672,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
else if (value < m_SashList.Count)
|
||||
{
|
||||
if(value > 0)
|
||||
if (value > 0)
|
||||
{
|
||||
double dLastDimension = 0;
|
||||
for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= value; SplitIndex += -1)
|
||||
@@ -646,7 +688,7 @@ namespace WebWindowComplex
|
||||
SashList.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
if(m_SashList.Count == 0)
|
||||
if (m_SashList.Count == 0)
|
||||
{
|
||||
Area child = AreaList[0];
|
||||
// Se nella singola anta ho uno split
|
||||
@@ -687,7 +729,7 @@ namespace WebWindowComplex
|
||||
else
|
||||
{
|
||||
// Se aggiungo ante
|
||||
if(SashList.Count > AreaList.Count)
|
||||
if (SashList.Count > AreaList.Count)
|
||||
{
|
||||
List<Area> ContentArea = new List<Area>();
|
||||
// Salvo in ContentArea il sottoalbero delle singole aree che mantengo
|
||||
@@ -842,7 +884,7 @@ namespace WebWindowComplex
|
||||
set
|
||||
{
|
||||
m_SelOrientationSashType = (OrientationSash)IdNameStruct.IdFromInd(value, m_OrientationSashTypeList);
|
||||
if(value == 0)
|
||||
if (value == 0)
|
||||
{
|
||||
m_bIsSashVertical = true;
|
||||
}
|
||||
@@ -966,7 +1008,7 @@ namespace WebWindowComplex
|
||||
set
|
||||
{
|
||||
// Controllo che il valore inserito sia positivo
|
||||
if(value >= 0)
|
||||
if (value >= 0)
|
||||
{
|
||||
m_nSashBottomRailQty = value;
|
||||
if (m_nSashBottomRailQty > 0)
|
||||
@@ -1093,9 +1135,9 @@ namespace WebWindowComplex
|
||||
|
||||
internal void SetSelHardwareFromId(string sId)
|
||||
{
|
||||
m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId)?? new Hardware("","","","","",0,0);
|
||||
if (m_SelHardware != null)
|
||||
m_SelHardware = m_HardwareList[0];
|
||||
m_SelHardware = m_HardwareList.FirstOrDefault(x => x.sId == sId) ?? new Hardware("", "", "", "", "", 0, 0);
|
||||
if (m_SelHardware == null)
|
||||
m_SelHardware = m_HardwareList[0];
|
||||
}
|
||||
|
||||
public int SelHardwareTypeIndex
|
||||
@@ -1126,8 +1168,8 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<AGBOption> m_HwdOptionList = new ObservableCollection<AGBOption>();
|
||||
public ObservableCollection<AGBOption> HwdOptionList
|
||||
private ObservableCollection<ParametriOpzioni> m_HwdOptionList = new ObservableCollection<ParametriOpzioni>();
|
||||
public ObservableCollection<ParametriOpzioni> HwdOptionList
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -1215,9 +1257,9 @@ namespace WebWindowComplex
|
||||
|
||||
private string ConvertOpeningType()
|
||||
{
|
||||
if(m_SashList.Count > 1)
|
||||
if (m_SashList.Count > 1)
|
||||
{
|
||||
for(int i = 0; i < m_SashList.Count; i++)
|
||||
for (int i = 0; i < m_SashList.Count; i++)
|
||||
{
|
||||
if (m_SashList[i].bHasHandle)
|
||||
{
|
||||
@@ -1226,11 +1268,11 @@ namespace WebWindowComplex
|
||||
else
|
||||
return "ANTA_RIBALTA";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return "ANTA_BANDIERA";
|
||||
return "";
|
||||
}
|
||||
else
|
||||
else if (m_SashList.Count > 0)
|
||||
{
|
||||
switch (GetOpeningType(m_SashList[0].OpeningType))
|
||||
{
|
||||
@@ -1266,6 +1308,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public void RefreshHardwareList()
|
||||
@@ -1283,34 +1326,34 @@ namespace WebWindowComplex
|
||||
m_HwdOptionList.Clear();
|
||||
}
|
||||
|
||||
//internal OpeningSides GetOpeningSide(Openings OpeningType)
|
||||
//{
|
||||
// switch (OpeningType)
|
||||
// {
|
||||
// case Openings.TURNONLY_LEFT:
|
||||
// case Openings.TILTTURN_LEFT:
|
||||
// case Openings.TILTONLY_TOP:
|
||||
// case Openings.COMPLANARSLIDE_LEFT:
|
||||
// case Openings.LIFTSLIDE_LEFT:
|
||||
// {
|
||||
// return OpeningSides.LEFT;
|
||||
// }
|
||||
internal OpeningSides GetOpeningSide(Openings OpeningType)
|
||||
{
|
||||
switch (OpeningType)
|
||||
{
|
||||
case Openings.TURNONLY_LEFT:
|
||||
case Openings.TILTTURN_LEFT:
|
||||
case Openings.TILTONLY_TOP:
|
||||
case Openings.COMPLANARSLIDE_LEFT:
|
||||
case Openings.LIFTSLIDE_LEFT:
|
||||
{
|
||||
return OpeningSides.LEFT;
|
||||
}
|
||||
|
||||
// case Openings.TURNONLY_RIGHT:
|
||||
// case Openings.TILTTURN_RIGHT:
|
||||
// case Openings.TILTONLY_BOTTOM:
|
||||
// case Openings.COMPLANARSLIDE_RIGHT:
|
||||
// case Openings.LIFTSLIDE_RIGHT:
|
||||
// {
|
||||
// return OpeningSides.RIGHT;
|
||||
// }
|
||||
case Openings.TURNONLY_RIGHT:
|
||||
case Openings.TILTTURN_RIGHT:
|
||||
case Openings.TILTONLY_BOTTOM:
|
||||
case Openings.COMPLANARSLIDE_RIGHT:
|
||||
case Openings.LIFTSLIDE_RIGHT:
|
||||
{
|
||||
return OpeningSides.RIGHT;
|
||||
}
|
||||
|
||||
// default:
|
||||
// {
|
||||
// return OpeningSides.NULL;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
default:
|
||||
{
|
||||
return OpeningSides.NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Sash Copy(Area newParentArea)
|
||||
{
|
||||
@@ -1324,12 +1367,12 @@ namespace WebWindowComplex
|
||||
newSash.RefreshHardwareList();
|
||||
newSash.RefreshHardwareOptionList();
|
||||
newSash.SetSelHardware(SelHardware);
|
||||
for (int i = 0; i <SashList.Count; i++)
|
||||
for (int i = 0; i < SashList.Count; i++)
|
||||
{
|
||||
//Cancello SashDimension di default e aggiungo la copia
|
||||
newSash.SashList.RemoveAt(i);
|
||||
SashDimension newSashDim = SashList[i].Copy();
|
||||
newSash.SashList.Insert(i,newSashDim);
|
||||
newSash.SashList.Insert(i, newSashDim);
|
||||
}
|
||||
foreach (var item in JointList)
|
||||
{
|
||||
@@ -1385,7 +1428,7 @@ namespace WebWindowComplex
|
||||
for (var SplitIndex = m_SplitPositionList.Count; SplitIndex <= value; SplitIndex++)
|
||||
SplitPositionList.Add(new SplitDimension(dNewDimension, true, this));
|
||||
}
|
||||
else if(value == 0)
|
||||
else if (value == 0)
|
||||
{
|
||||
SplitPositionList.RemoveAt(1);
|
||||
SplitPositionList.RemoveAt(0);
|
||||
@@ -1424,7 +1467,7 @@ namespace WebWindowComplex
|
||||
{
|
||||
Splitted s = (Splitted)AreaList[0];
|
||||
s.SetParentArea(ParentArea);
|
||||
ParentArea.AreaList.Add(s.AreaList[0]);
|
||||
ParentArea.AreaList.Add(s);
|
||||
ParentArea.AreaList.Remove(this);
|
||||
}
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
@@ -1537,7 +1580,7 @@ namespace WebWindowComplex
|
||||
newSplit.SetSplitQty(nSplitQty);
|
||||
newSplit.SetSplitShape(SelSplitShape, true);
|
||||
newSplit.SetAreaType(AreaType);
|
||||
foreach(var item in AreaList)
|
||||
foreach (var item in AreaList)
|
||||
{
|
||||
Area a = item.Copy(newSplit);
|
||||
newSplit.AreaList.Add(a);
|
||||
@@ -1736,7 +1779,7 @@ namespace WebWindowComplex
|
||||
|
||||
public Joint Copy()
|
||||
{
|
||||
Joint newJoint = new Joint(ParentArea,nIndex, SelJointType);
|
||||
Joint newJoint = new Joint(ParentArea, nIndex, SelJointType);
|
||||
return newJoint;
|
||||
}
|
||||
|
||||
@@ -1754,7 +1797,6 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
public class Hardware
|
||||
{
|
||||
private string m_sId;
|
||||
@@ -1830,10 +1872,9 @@ namespace WebWindowComplex
|
||||
m_nSashQty = nSashQty;
|
||||
m_nSashPosition = nSashPosition;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
public class AGBOption
|
||||
public partial class ParametriOpzioni
|
||||
{
|
||||
public enum HDWOPTIONTYPES : int
|
||||
{
|
||||
@@ -1842,7 +1883,7 @@ namespace WebWindowComplex
|
||||
COMBO = 3
|
||||
}
|
||||
|
||||
private HDWOPTIONTYPES m_Type;
|
||||
protected HDWOPTIONTYPES m_Type;
|
||||
public HDWOPTIONTYPES Type
|
||||
{
|
||||
get
|
||||
@@ -1869,6 +1910,25 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
private Visibility m_OptVisibility;
|
||||
public Visibility OptVisibility
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_OptVisibility;
|
||||
}
|
||||
}
|
||||
|
||||
public ParametriOpzioni(ParametriOpzioniParametri HdwOptionParam)
|
||||
{
|
||||
m_sName = HdwOptionParam.NomeParametro;
|
||||
m_sDescription = HdwOptionParam.DescrizioneParametro;
|
||||
m_OptVisibility = Visibility.VISIBLE; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed)
|
||||
}
|
||||
}
|
||||
|
||||
public class AGBOptionCombo : ParametriOpzioni
|
||||
{
|
||||
private List<AGBOptionParameter> m_ValueList = new List<AGBOptionParameter>();
|
||||
public List<AGBOptionParameter> ValueList
|
||||
{
|
||||
@@ -1891,30 +1951,13 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
private Visibility m_OptVisibility;
|
||||
public Visibility OptVisibility
|
||||
public AGBOptionCombo(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam)
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_OptVisibility;
|
||||
}
|
||||
m_Type = HDWOPTIONTYPES.COMBO;
|
||||
foreach (var Value in HdwOptionParam.Opzioni)
|
||||
m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione));
|
||||
m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente) ?? new AGBOptionParameter("", "");
|
||||
}
|
||||
|
||||
//public AGBOption(ParametriOpzioniParametri HdwOptionParam)
|
||||
//{
|
||||
// if (HdwOptionParam.Opzioni.Count > 0)
|
||||
// {
|
||||
// m_Type = HDWOPTIONTYPES.COMBO;
|
||||
// foreach (var Value in HdwOptionParam.Opzioni)
|
||||
// m_ValueList.Add(new AGBOptionParameter(Value.Valore, Value.DescrizioneOpzione));
|
||||
// }
|
||||
// else
|
||||
// m_Type = HDWOPTIONTYPES.TEXT;
|
||||
// m_sName = HdwOptionParam.NomeParametro;
|
||||
// m_sDescription = HdwOptionParam.DescrizioneParametro;
|
||||
// m_sValue = m_ValueList.FirstOrDefault(x => x.sValue == HdwOptionParam.ValoreCorrente);
|
||||
// m_OptVisibility = Visibility.Visible; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed)
|
||||
//}
|
||||
}
|
||||
|
||||
public class AGBOptionParameter
|
||||
@@ -1944,6 +1987,28 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
public class AGBOptionText : ParametriOpzioni
|
||||
{
|
||||
private string m_sValue;
|
||||
public string sValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public AGBOptionText(ParametriOpzioniParametri HdwOptionParam) : base(HdwOptionParam)
|
||||
{
|
||||
m_Type = HDWOPTIONTYPES.TEXT;
|
||||
m_sValue = HdwOptionParam.ValoreCorrente;
|
||||
}
|
||||
}
|
||||
|
||||
public class FrameDimension
|
||||
{
|
||||
// valore massimo e minimo della dimensione del frame
|
||||
@@ -2386,8 +2451,8 @@ namespace WebWindowComplex
|
||||
}
|
||||
m_dDimension = value;
|
||||
m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
internal void SetDimension(double dValue)
|
||||
|
||||
Reference in New Issue
Block a user