Files
aistudio-wpf-diagram/AIStudio.Wpf.DiagramDesigner/Models/Serializables/Container/BlockItemsContainerInfoItem.cs

69 lines
1.7 KiB
C#
Raw Normal View History

2023-07-15 10:20:50 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using Newtonsoft.Json;
namespace AIStudio.Wpf.DiagramDesigner
{
[Serializable]
[XmlInclude(typeof(BlockItemsContainerInfoItem))]
public class BlockItemsContainerInfoItem : SelectableItemBase
{
public BlockItemsContainerInfoItem()
{
}
public BlockItemsContainerInfoItem(BlockItemsContainerInfo viewmodel) : base(viewmodel)
{
this.OnlyOneChild = viewmodel.OnlyOneChild;
this.ChildFlag = viewmodel.ChildFlag;
this.PhysicalItemWidth = viewmodel.PhysicalItemWidth;
this.PhysicalItemHeight = viewmodel.PhysicalItemHeight;
2023-08-26 21:30:31 +08:00
this.Parameter = new ConstParameterItem(viewmodel.Parameter);
2023-07-15 10:20:50 +08:00
Children = new List<BlockDesignerItem>(viewmodel.Children.Select(p => new BlockDesignerItem(p)));
}
public bool OnlyOneChild
{
get; set;
}
public List<string> ChildFlag
{
get; set;
}
[JsonProperty(PropertyName = "ItemWidth")]
[XmlAttribute("ItemWidth")]
public double PhysicalItemWidth
{
get; set;
}
[JsonProperty(PropertyName = "ItemHeight")]
[XmlAttribute("ItemHeight")]
public double PhysicalItemHeight
{
get; set;
}
2023-08-26 21:30:31 +08:00
[XmlElement]
public ConstParameterItem Parameter
{
get; set;
}
2023-07-15 10:20:50 +08:00
[XmlArray]
public List<BlockDesignerItem> Children
{
get; set;
2023-08-26 21:30:31 +08:00
}
2023-07-15 10:20:50 +08:00
}
}