5e4907479b
- Iniziato a sistemare per converisone dimensione Inglesina
126 lines
3.2 KiB
C#
126 lines
3.2 KiB
C#
using WebWindowComplex.Json;
|
|
using static WebWindowComplex.Json.WindowConst;
|
|
|
|
namespace WebWindowComplex.Models
|
|
{
|
|
public class Fill : Area
|
|
{
|
|
#region Public Constructors
|
|
public Fill(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
|
|
{
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Properties
|
|
|
|
public FillTypes FillType
|
|
{
|
|
get
|
|
{
|
|
return (FillTypes)m_SelFillType;
|
|
}
|
|
}
|
|
|
|
//public List<IdNameStruct> FillTypeList
|
|
//{
|
|
// get
|
|
// {
|
|
// return m_FillTypeList;
|
|
// }
|
|
//}
|
|
|
|
public FillTypes SelFillType
|
|
{
|
|
get
|
|
{
|
|
return m_SelFillType;
|
|
}
|
|
set
|
|
{
|
|
m_SelFillType = value;
|
|
}
|
|
}
|
|
|
|
//public int SelFillTypeIndex
|
|
//{
|
|
// get
|
|
// {
|
|
// return IdNameStruct.IndFromId((int)m_SelFillType, m_FillTypeList);
|
|
// }
|
|
// set
|
|
// {
|
|
// m_SelFillType = (FillTypes)IdNameStruct.IdFromInd(value, m_FillTypeList);
|
|
// }
|
|
//}
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Public Methods
|
|
|
|
public override Fill Copy(Area newParentArea)
|
|
{
|
|
Fill newFill = new Fill(newParentArea, m_ParentWindow);
|
|
AddCounterGroup();
|
|
newFill.SetGroupId(nCounterGroup);
|
|
newFill.SetFillType(SelFillType);
|
|
newFill.SetAreaType(AreaType);
|
|
if(AreaList != null && AreaList.Count > 0)
|
|
{
|
|
foreach (var item in AreaList)
|
|
{
|
|
Area newArea = item.Copy(newFill);
|
|
newFill.AreaList.Add(newArea);
|
|
}
|
|
}
|
|
return newFill;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Internal Methods
|
|
|
|
internal static Fill CreateFill(Area AreaParent, FillTypes FillType)
|
|
{
|
|
Fill Fill = new Fill(AreaParent, AreaParent.ParentWindow);
|
|
AddCounterGroup();
|
|
Fill.SetGroupId(nCounterGroup);
|
|
Fill.SetAreaType(AreaTypes.FILL);
|
|
Fill.SetFillType(FillType);
|
|
return Fill;
|
|
}
|
|
|
|
internal override JsonArea Serialize(bool hideHw)
|
|
{
|
|
if (nCounterGroup < GroupId)
|
|
Area.nCounterGroup = GroupId;
|
|
JsonFill JsonFill = new JsonFill(FillType, GroupId);
|
|
foreach (var Area in AreaList)
|
|
JsonFill.AreaList.Add(Area.Serialize(hideHw));
|
|
return JsonFill;
|
|
}
|
|
|
|
internal void SetSelFillType(FillTypes value)
|
|
{
|
|
m_SelFillType = value;
|
|
}
|
|
internal void SetFillType(FillTypes value)
|
|
{
|
|
m_SelFillType = value;
|
|
}
|
|
|
|
#endregion Internal Methods
|
|
|
|
#region Private Fields
|
|
|
|
private List<IdNameStruct> m_FillTypeList = new List<IdNameStruct>
|
|
{
|
|
new IdNameStruct((int)FillTypes.GLASS, "Glass"),
|
|
new IdNameStruct((int)FillTypes.WOOD, "Wood")
|
|
};
|
|
|
|
private FillTypes m_SelFillType;
|
|
|
|
#endregion Private Fields
|
|
}
|
|
} |