57 lines
1.6 KiB
C#
57 lines
1.6 KiB
C#
using WebWindowTest.Json;
|
|
using static WebWindowTest.Json.WindowConst;
|
|
|
|
namespace WebWindowTest.Models
|
|
{
|
|
public class Splitted : Area
|
|
{
|
|
#region Public Constructors
|
|
|
|
public Splitted(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
|
|
{
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Methods
|
|
|
|
public override Splitted Copy(Area newParentArea)
|
|
{
|
|
Splitted newSplitted = new Splitted(newParentArea, ParentWindow);
|
|
AddCounterGroup();
|
|
newSplitted.SetGroupId(nCounterGroup);
|
|
newSplitted.SetAreaType(AreaType);
|
|
foreach (var item in AreaList)
|
|
{
|
|
Area a = item.Copy(newSplitted);
|
|
newSplitted.AreaList.Add(a);
|
|
}
|
|
return newSplitted;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Internal Methods
|
|
|
|
internal static Splitted CreateSplitted(Area ParentArea)
|
|
{
|
|
Splitted Splitted = new Splitted(ParentArea, ParentArea.ParentWindow);
|
|
AddCounterGroup();
|
|
Splitted.SetGroupId(nCounterGroup);
|
|
Splitted.SetAreaType(AreaTypes.SPLITTED);
|
|
return Splitted;
|
|
}
|
|
|
|
internal override JsonArea Serialize(bool hideHw)
|
|
{
|
|
if (nCounterGroup < GroupId)
|
|
Area.nCounterGroup = GroupId;
|
|
JsonSplitted JsonSplitted = new JsonSplitted(GroupId);
|
|
foreach (var Area in AreaList)
|
|
JsonSplitted.AreaList.Add(Area.Serialize(hideHw));
|
|
return JsonSplitted;
|
|
}
|
|
|
|
#endregion Internal Methods
|
|
}
|
|
} |