103 lines
2.3 KiB
C#
103 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using WebWindowComplex.Json;
|
|
using static WebWindowComplex.Json.WindowConst;
|
|
|
|
namespace WebWindowComplex.Models
|
|
{
|
|
public class ElementDimension
|
|
{
|
|
#region Public Constructors
|
|
|
|
public ElementDimension(Frame ParentArea, int nIndex, double dDimension)
|
|
{
|
|
m_ParentArea = ParentArea;
|
|
m_nIndex = nIndex;
|
|
m_dDimension = dDimension;
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Properties
|
|
|
|
public double dDimension
|
|
{
|
|
get
|
|
{
|
|
return m_dDimension;
|
|
}
|
|
set
|
|
{
|
|
if(dDimension != value)
|
|
{
|
|
if (value > MaxDim)
|
|
m_dDimension = MaxDim;
|
|
else if (value < MinDim)
|
|
m_dDimension = MinDim;
|
|
else
|
|
m_dDimension = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public int nIndex
|
|
{
|
|
get
|
|
{
|
|
return m_nIndex;
|
|
}
|
|
}
|
|
|
|
public Area ParentArea
|
|
{
|
|
get
|
|
{
|
|
return m_ParentArea;
|
|
}
|
|
}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Public Methods
|
|
|
|
public void SetDimension(double dValue)
|
|
{
|
|
m_dDimension = dValue;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Internal Methods
|
|
|
|
internal JsonElementDimension Serialize()
|
|
{
|
|
JsonElementDimension JsonElementDimension = new JsonElementDimension(m_nIndex, m_dDimension);
|
|
return JsonElementDimension;
|
|
}
|
|
|
|
#endregion Internal Methods
|
|
|
|
#region Protected Fields
|
|
|
|
protected Frame m_ParentArea;
|
|
|
|
#endregion Protected Fields
|
|
|
|
#region Private Fields
|
|
|
|
private double m_dDimension;
|
|
|
|
private int m_nIndex;
|
|
|
|
// valore massimo della dimensione del frame
|
|
private int MaxDim = 200;
|
|
// valore minimo della dimensione del frame
|
|
private int MinDim = 50;
|
|
|
|
#endregion Private Fields
|
|
}
|
|
} |