Inizio spacchettamento file window delle classi di base del modello
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
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);
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public override Fill Copy(Area newParentArea)
|
||||
{
|
||||
Fill newFill = new Fill(newParentArea, m_ParentWindow);
|
||||
AddCounterGroup();
|
||||
newFill.SetIdGroup(nCounterGroup);
|
||||
newFill.SetFillType(SelFillType);
|
||||
newFill.SetAreaType(AreaType);
|
||||
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.SetIdGroup(nCounterGroup);
|
||||
Fill.SetAreaType(AreaTypes.FILL);
|
||||
Fill.SetFillType(FillType);
|
||||
return Fill;
|
||||
}
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
if (nCounterGroup < IdGroup)
|
||||
Area.nCounterGroup = IdGroup;
|
||||
JsonFill JsonFill = new JsonFill(FillType, IdGroup);
|
||||
foreach (var Area in AreaList)
|
||||
JsonFill.AreaList.Add(Area.Serialize());
|
||||
return JsonFill;
|
||||
}
|
||||
|
||||
internal void SetFillType(FillTypes value)
|
||||
{
|
||||
m_SelFillType = value;
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private List<IdNameStruct> m_FillTypeList = new List<IdNameStruct>
|
||||
{
|
||||
new IdNameStruct((int)FillTypes.GLASS, "SvgPreview"),
|
||||
new IdNameStruct((int)FillTypes.WOOD, "Wood")
|
||||
};
|
||||
|
||||
private FillTypes m_SelFillType;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user