- Eliminate aree deprecate
- Aggiunti parametri min e max degli elementi del frame e split
This commit is contained in:
@@ -20,15 +20,6 @@ namespace WebWindowComplex.Models
|
||||
m_dDimension = dDimension;
|
||||
}
|
||||
|
||||
public ElementDimension(Area ParentArea, int nIndex, double dDimension, double dMin, double dMax)
|
||||
{
|
||||
m_ParentArea = ParentArea;
|
||||
m_nIndex = nIndex;
|
||||
m_dDimension = dDimension;
|
||||
m_dMin = dMin;
|
||||
m_dMax = dMax;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
@@ -43,10 +34,10 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
if(dDimension != value)
|
||||
{
|
||||
if (value > MaxDim)
|
||||
m_dDimension = MaxDim;
|
||||
else if (value < MinDim)
|
||||
m_dDimension = MinDim;
|
||||
if (value > m_dMax)
|
||||
m_dDimension = m_dMax;
|
||||
else if (value < m_dMin)
|
||||
m_dDimension = m_dMin;
|
||||
else
|
||||
m_dDimension = value;
|
||||
}
|
||||
@@ -60,7 +51,20 @@ namespace WebWindowComplex.Models
|
||||
return m_nIndex;
|
||||
}
|
||||
}
|
||||
|
||||
public string sName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sName;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (m_sName != value)
|
||||
{
|
||||
m_sName = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public Area ParentArea
|
||||
{
|
||||
get
|
||||
@@ -77,7 +81,23 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
m_dDimension = dValue;
|
||||
}
|
||||
|
||||
|
||||
public void SetMaxDimension(double dValue)
|
||||
{
|
||||
m_dMax = dValue;
|
||||
}
|
||||
|
||||
public void SetMinDimension(double dValue)
|
||||
{
|
||||
m_dMin = dValue;
|
||||
}
|
||||
|
||||
public void SetNameElement(string dValue)
|
||||
{
|
||||
m_sName = dValue;
|
||||
}
|
||||
|
||||
|
||||
public ElementDimension Copy()
|
||||
{
|
||||
ElementDimension newElementDimension = new ElementDimension(ParentArea, nIndex, dDimension);
|
||||
@@ -108,13 +128,11 @@ namespace WebWindowComplex.Models
|
||||
|
||||
private int m_nIndex;
|
||||
|
||||
private string m_sName;
|
||||
|
||||
private double m_dMin;
|
||||
|
||||
private double m_dMax;
|
||||
// valore massimo della dimensione del frame
|
||||
private int MaxDim = 200;
|
||||
// valore minimo della dimensione del frame
|
||||
private int MinDim = 50;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
|
||||
@@ -319,6 +319,18 @@ namespace WebWindowComplex.Models
|
||||
m_ElemDimHorizList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<ElementDimension> ElemDimVertList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElemDimVertList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ElemDimVertList = value;
|
||||
}
|
||||
}
|
||||
public List<SplitDimension> SplitPositionList
|
||||
{
|
||||
get
|
||||
@@ -378,6 +390,11 @@ namespace WebWindowComplex.Models
|
||||
ElementDimension newElementDimension = item.Copy();
|
||||
newSplit.ElemDimHorizList.Add(newElementDimension);
|
||||
}
|
||||
foreach (var item in ElemDimVertList)
|
||||
{
|
||||
ElementDimension newElementDimension = item.Copy();
|
||||
newSplit.ElemDimVertList.Add(newElementDimension);
|
||||
}
|
||||
foreach (var item in AreaList)
|
||||
{
|
||||
Area a = item.Copy(newSplit);
|
||||
@@ -395,6 +412,34 @@ namespace WebWindowComplex.Models
|
||||
//m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
|
||||
public bool OnlySashChild()
|
||||
{
|
||||
foreach (var areaSplitted in AreaList)
|
||||
{
|
||||
if (!(areaSplitted.AreaList.FirstOrDefault().AreaType is AreaTypes.SASH))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool MinOneSashChild()
|
||||
{
|
||||
foreach (var areaSplitted in AreaList)
|
||||
{
|
||||
if (areaSplitted.AreaList.FirstOrDefault().AreaType is AreaTypes.SASH)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool SashChildSxOrDx()
|
||||
{
|
||||
foreach (var areaSplitted in AreaList)
|
||||
{
|
||||
if (areaSplitted.AreaList.FirstOrDefault().AreaType is AreaTypes.SASH)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Internal Properties
|
||||
@@ -435,6 +480,8 @@ namespace WebWindowComplex.Models
|
||||
JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize());
|
||||
foreach (var Elem in m_ElemDimHorizList)
|
||||
JsonSplit.ElementDimHorizList.Add(Elem.Serialize());
|
||||
foreach (var Elem in m_ElemDimVertList)
|
||||
JsonSplit.ElementDimVertList.Add(Elem.Serialize());
|
||||
foreach (var Area in AreaList)
|
||||
JsonSplit.AreaList.Add(Area.Serialize(hideHw));
|
||||
return JsonSplit;
|
||||
@@ -539,6 +586,7 @@ namespace WebWindowComplex.Models
|
||||
|
||||
private List<SplitDimension> m_SplitHorizList = new List<SplitDimension>();
|
||||
private List<ElementDimension> m_ElemDimHorizList = new List<ElementDimension>();
|
||||
private List<ElementDimension> m_ElemDimVertList = new List<ElementDimension>();
|
||||
private List<SplitDimension> m_SplitPositionList = new List<SplitDimension>();
|
||||
|
||||
private List<IdNameStruct> m_SplitShapeList = new List<IdNameStruct>
|
||||
|
||||
Reference in New Issue
Block a user