mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
52 lines
1.8 KiB
C#
52 lines
1.8 KiB
C#
using System.Collections.Generic;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
|
{
|
|
public class MediaDesignerItem : DesignerItemBase
|
|
{
|
|
public MediaDesignerItem()
|
|
{
|
|
|
|
}
|
|
|
|
public MediaDesignerItem(GifImageItemViewModel item) : base(item)
|
|
{
|
|
Connectors = new List<ConnectorItem>();
|
|
foreach (var fullyCreatedConnectorInfo in item.Connectors)
|
|
{
|
|
ConnectorItem connector = new ConnectorItem()
|
|
{
|
|
XRatio = fullyCreatedConnectorInfo.XRatio,
|
|
YRatio = fullyCreatedConnectorInfo.YRatio,
|
|
ConnectorWidth = fullyCreatedConnectorInfo.ConnectorWidth,
|
|
ConnectorHeight = fullyCreatedConnectorInfo.ConnectorHeight,
|
|
Orientation = fullyCreatedConnectorInfo.Orientation
|
|
};
|
|
Connectors.Add(connector);
|
|
}
|
|
}
|
|
|
|
public MediaDesignerItem(MediaItemViewModel item) : base(item)
|
|
{
|
|
Connectors = new List<ConnectorItem>();
|
|
foreach (var fullyCreatedConnectorInfo in item.Connectors)
|
|
{
|
|
ConnectorItem connector = new ConnectorItem()
|
|
{
|
|
XRatio = fullyCreatedConnectorInfo.XRatio,
|
|
YRatio = fullyCreatedConnectorInfo.YRatio,
|
|
ConnectorWidth = fullyCreatedConnectorInfo.ConnectorWidth,
|
|
ConnectorHeight = fullyCreatedConnectorInfo.ConnectorHeight,
|
|
Orientation = fullyCreatedConnectorInfo.Orientation
|
|
};
|
|
Connectors.Add(connector);
|
|
}
|
|
}
|
|
|
|
[XmlArray]
|
|
public List<ConnectorItem> Connectors { get; set; }
|
|
|
|
}
|
|
}
|