2021-07-23 09:42:22 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
|
2022-10-28 22:45:39 +08:00
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
2021-07-23 09:42:22 +08:00
|
|
|
|
{
|
|
|
|
|
|
public class LogicalGateDesignerItemBase : DesignerItemBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public LogicalGateDesignerItemBase()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public LogicalGateDesignerItemBase(LogicalGateItemViewModelBase item) : base(item)
|
|
|
|
|
|
{
|
2023-01-31 22:45:50 +08:00
|
|
|
|
this.Connectors = new List<LogicalConnectorInfoItem>();
|
|
|
|
|
|
foreach (var fullyCreatedConnectorInfo in item.Connectors.OfType<LogicalConnectorInfo>())
|
2021-07-23 09:42:22 +08:00
|
|
|
|
{
|
2023-01-31 22:45:50 +08:00
|
|
|
|
LogicalConnectorInfoItem connector = new LogicalConnectorInfoItem(fullyCreatedConnectorInfo);
|
2021-07-23 09:42:22 +08:00
|
|
|
|
this.Connectors.Add(connector);
|
|
|
|
|
|
}
|
|
|
|
|
|
this.OrderNumber = item.OrderNumber;
|
|
|
|
|
|
this.LogicalType = item.LogicalType;
|
|
|
|
|
|
this.Value = item.Value;
|
|
|
|
|
|
this.IsEnabled = item.IsEnabled;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[XmlArray]
|
2023-01-31 22:45:50 +08:00
|
|
|
|
public List<LogicalConnectorInfoItem> Connectors { get; set; }
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public int OrderNumber { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public double Value { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public LogicalType LogicalType { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
|
public bool IsEnabled { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|