Aggiornato modo per sollevare gli eventi di Frame, Fill, Splitted, Joint
This commit is contained in:
@@ -33,18 +33,20 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
set
|
||||
{
|
||||
m_dValue = value;
|
||||
if (value > MaxDim)
|
||||
if(m_dValue != value)
|
||||
{
|
||||
m_dValue = MaxDim;
|
||||
m_dValue = value;
|
||||
if (value > MaxDim)
|
||||
{
|
||||
m_dValue = MaxDim;
|
||||
}
|
||||
else if (value < MinDim && !m_sName.Equals("Radius"))
|
||||
{
|
||||
m_dValue = MinDim;
|
||||
}
|
||||
if (ParentFrame.AreaList.Count > 0)
|
||||
SearchAreaList(ParentFrame);
|
||||
}
|
||||
else if (value < MinDim && !m_sName.Equals("Radius"))
|
||||
{
|
||||
m_dValue = MinDim;
|
||||
}
|
||||
if (ParentFrame.AreaList.Count > 0)
|
||||
SearchAreaList(ParentFrame);
|
||||
m_ParentFrame.ParentWindow.OnUpdatePreview(m_ParentFrame.ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,9 +87,9 @@ namespace WebWindowComplex.Models
|
||||
if (node != null)
|
||||
{
|
||||
if (node.AreaType.Equals(AreaTypes.SASH))
|
||||
calculateWidth((Sash)node);
|
||||
updateDimSubArea((Sash)node);
|
||||
else if (node.AreaType.Equals(AreaTypes.SPLIT))
|
||||
calculateWidth((Split)node);
|
||||
updateDimSubArea((Split)node);
|
||||
foreach (var item in node.AreaList)
|
||||
{
|
||||
SearchAreaList(item);
|
||||
@@ -95,17 +97,17 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
protected void calculateWidth(Area area)
|
||||
protected void updateDimSubArea(Area area)
|
||||
{
|
||||
if(area is Sash && sName.Equals("Width"))
|
||||
{
|
||||
Sash sash = (Sash)area;
|
||||
int countAbsolute = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUT)).Count();
|
||||
if(countAbsolute == sash.SashList.Count)
|
||||
if (countAbsolute == sash.SashList.Count)
|
||||
{
|
||||
double sum = sash.SashList.Sum(x => x.dDimension);
|
||||
double res = dValue - sum;
|
||||
if(res > 0)
|
||||
if (res > 0)
|
||||
{
|
||||
foreach (var sashDim in sash.SashList)
|
||||
{
|
||||
@@ -154,6 +156,11 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetDimension(double dValue)
|
||||
{
|
||||
m_dValue = dValue;
|
||||
}
|
||||
|
||||
internal JsonFrameDimension Serialize()
|
||||
{
|
||||
JsonFrameDimension JsonFrameDimension = new JsonFrameDimension(m_nIndex, m_sName, m_dValue);
|
||||
|
||||
Reference in New Issue
Block a user