2021-07-23 09:42:22 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Media;
|
2023-01-12 23:02:53 +08:00
|
|
|
|
using AIStudio.Wpf.DiagramDesigner.Geometrys;
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
2022-10-28 22:45:39 +08:00
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
2021-07-23 09:42:22 +08:00
|
|
|
|
{
|
|
|
|
|
|
public abstract class ConnectorInfoBase : BindableBase
|
|
|
|
|
|
{
|
2023-01-12 23:02:53 +08:00
|
|
|
|
public virtual ConnectorPoint Location
|
2023-01-08 09:22:37 +08:00
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-23 09:42:22 +08:00
|
|
|
|
public ConnectorInfoBase(ConnectorOrientation orientation)
|
|
|
|
|
|
{
|
|
|
|
|
|
this.Orientation = orientation;
|
|
|
|
|
|
ColorViewModel = new ColorViewModel()
|
|
|
|
|
|
{
|
|
|
|
|
|
LineColor = new ColorObject() { Color = Color.FromArgb(0xAA, 0x00, 0x00, 0x80) },
|
|
|
|
|
|
FillColor = new ColorObject() { Color = Colors.Lavender },
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private ConnectorOrientation _orientation;
|
|
|
|
|
|
public ConnectorOrientation Orientation
|
|
|
|
|
|
{
|
2023-01-08 09:22:37 +08:00
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _orientation;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
SetProperty(ref _orientation, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private double connectorWidth = 8;
|
|
|
|
|
|
public double ConnectorWidth
|
|
|
|
|
|
{
|
2023-01-08 09:22:37 +08:00
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return connectorWidth;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
connectorWidth = value;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private double connectorHeight = 8;
|
|
|
|
|
|
public double ConnectorHeight
|
|
|
|
|
|
{
|
2023-01-08 09:22:37 +08:00
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return connectorHeight;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
connectorHeight = value;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private IColorViewModel _colorViewModel;
|
|
|
|
|
|
public IColorViewModel ColorViewModel
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _colorViewModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
SetProperty(ref _colorViewModel, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public double _connectorValue;
|
|
|
|
|
|
public double ConnectorValue
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _connectorValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
SetProperty(ref _connectorValue, value);
|
|
|
|
|
|
}
|
2023-01-08 09:22:37 +08:00
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|