mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 08:10:50 +08:00
序列化继续整理
This commit is contained in:
@@ -73,7 +73,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
BuildMenuOptions();
|
||||
}
|
||||
|
||||
public LogicalGateItemViewModelBase(IDiagramViewModel root, LogicalGateDesignerItemBase designer) : base(root, designer)
|
||||
public LogicalGateItemViewModelBase(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
BuildMenuOptions();
|
||||
}
|
||||
@@ -141,37 +141,31 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
base.LoadDesignerItemViewModel(root, designerbase);
|
||||
|
||||
LogicalGateDesignerItemBase designer = designerbase as LogicalGateDesignerItemBase;
|
||||
this.LogicalType = designer.LogicalType;
|
||||
this.OrderNumber = designer.OrderNumber;
|
||||
this.Value = designer.Value;
|
||||
this.IsEnabled = designer.IsEnabled;
|
||||
|
||||
ClearConnectors();
|
||||
Input.Clear();
|
||||
Output.Clear();
|
||||
|
||||
foreach (var connector in designer.Connectors)
|
||||
if (designerbase is LogicalGateDesignerItemBase designer)
|
||||
{
|
||||
FullyCreatedConnectorInfo fullyCreatedConnectorInfo = new FullyCreatedConnectorInfo(this, connector.Orientation, true);
|
||||
fullyCreatedConnectorInfo.XRatio = connector.XRatio;
|
||||
fullyCreatedConnectorInfo.YRatio = connector.YRatio;
|
||||
fullyCreatedConnectorInfo.ConnectorWidth = connector.ConnectorWidth;
|
||||
fullyCreatedConnectorInfo.ConnectorHeight = connector.ConnectorHeight;
|
||||
fullyCreatedConnectorInfo.Orientation = connector.Orientation;
|
||||
fullyCreatedConnectorInfo.IsInnerPoint = connector.IsInnerPoint;
|
||||
fullyCreatedConnectorInfo.ValueTypePoint = connector.ValueTypePoint;
|
||||
fullyCreatedConnectorInfo.ConnectorValue = connector.ConnectorValue;
|
||||
this.LogicalType = designer.LogicalType;
|
||||
this.OrderNumber = designer.OrderNumber;
|
||||
this.Value = designer.Value;
|
||||
this.IsEnabled = designer.IsEnabled;
|
||||
|
||||
if (fullyCreatedConnectorInfo.Orientation == ConnectorOrientation.Left)
|
||||
ClearConnectors();
|
||||
Input.Clear();
|
||||
Output.Clear();
|
||||
|
||||
foreach (var connector in designer.Connectors)
|
||||
{
|
||||
Input.Add(Input.Count, fullyCreatedConnectorInfo);
|
||||
FullyCreatedConnectorInfo fullyCreatedConnectorInfo = new FullyCreatedConnectorInfo(this.Root, this, connector);
|
||||
|
||||
if (fullyCreatedConnectorInfo.Orientation == ConnectorOrientation.Left)
|
||||
{
|
||||
Input.Add(Input.Count, fullyCreatedConnectorInfo);
|
||||
}
|
||||
else if (fullyCreatedConnectorInfo.Orientation == ConnectorOrientation.Right)
|
||||
{
|
||||
Output.Add(Output.Count, fullyCreatedConnectorInfo);
|
||||
}
|
||||
AddConnector(fullyCreatedConnectorInfo);
|
||||
}
|
||||
else if (fullyCreatedConnectorInfo.Orientation == ConnectorOrientation.Right)
|
||||
{
|
||||
Output.Add(Output.Count, fullyCreatedConnectorInfo);
|
||||
}
|
||||
AddConnector(fullyCreatedConnectorInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user