Files
aistudio-wpf-diagram/AIStudio.Wpf.DiagramDesigner/ViewModels/BaseViewModel/Connector/LogicalConnectorInfo.cs

85 lines
2.7 KiB
C#
Raw Normal View History

2023-01-31 22:45:50 +08:00
using System;
using System.Collections.Generic;
using System.Text;
using AIStudio.Wpf.DiagramDesigner.Models;
namespace AIStudio.Wpf.DiagramDesigner
{
public class LogicalConnectorInfo : FullyCreatedConnectorInfo
{
2023-04-19 22:26:04 +08:00
public LogicalConnectorInfo(DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ValueType valueTypePoint = ValueType.Real) : base(dataItem, orientation, isInnerPoint, isPortless)
2023-01-31 22:45:50 +08:00
{
2023-04-19 22:26:04 +08:00
this.ValueType = valueTypePoint;
2023-01-31 22:45:50 +08:00
}
2023-04-19 22:26:04 +08:00
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, ConnectorOrientation orientation, bool isInnerPoint = false, bool isPortless = false, ValueType valueTypePoint = ValueType.Real) : base(root, dataItem, orientation, isInnerPoint, isPortless)
2023-01-31 22:45:50 +08:00
{
2023-04-19 22:26:04 +08:00
this.ValueType = valueTypePoint;
2023-01-31 22:45:50 +08:00
}
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SelectableItemBase designer) : base(root, dataItem, designer)
{
}
public LogicalConnectorInfo(IDiagramViewModel root, DesignerItemViewModelBase dataItem, SerializableItem serializableItem, string serializableType) : base(root, dataItem, serializableItem, serializableType)
{
}
public override SelectableItemBase GetSerializableObject()
{
return new LogicalConnectorInfoItem(this);
}
protected override void LoadDesignerItemViewModel(SelectableItemBase designerbase)
{
base.LoadDesignerItemViewModel(designerbase);
if (designerbase is LogicalConnectorInfoItem designer)
{
2023-02-11 22:20:24 +08:00
ConnectorValue = designer.ConnectorValue;
2023-04-19 22:26:04 +08:00
ValueType = designer.ValueType;
ConnectorString = designer.ConnectorString;
2023-01-31 22:45:50 +08:00
}
}
2023-02-11 22:20:24 +08:00
public double _connectorValue;
public double ConnectorValue
{
get
{
return _connectorValue;
}
set
{
SetProperty(ref _connectorValue, value);
}
}
2023-04-19 22:26:04 +08:00
public string _connectorString;
public string ConnectorString
2023-01-31 22:45:50 +08:00
{
get
{
2023-04-19 22:26:04 +08:00
return _connectorString;
2023-01-31 22:45:50 +08:00
}
set
{
2023-04-19 22:26:04 +08:00
SetProperty(ref _connectorString, value);
}
}
public ValueType _valueType;
public ValueType ValueType
{
get
{
return _valueType;
}
set
{
SetProperty(ref _valueType, value);
2023-01-31 22:45:50 +08:00
}
}
}
}