You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.7 KiB
79 lines
1.7 KiB
|
1 month ago
|
using ReactiveUI;
|
||
|
|
using System;
|
||
|
|
|
||
|
|
namespace AuroraDesk.Core.Entities;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 连接点实体 - 节点的输入/输出连接点
|
||
|
|
/// </summary>
|
||
|
|
public class ConnectionPoint : ReactiveObject
|
||
|
|
{
|
||
|
|
private string _label = string.Empty;
|
||
|
|
private ConnectionPointType _type = ConnectionPointType.Output;
|
||
|
|
private int _index;
|
||
|
|
private bool _isConnected;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 连接点唯一标识符
|
||
|
|
/// </summary>
|
||
|
|
public string Id { get; set; } = Guid.NewGuid().ToString();
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 连接点标签(显示在连接点旁边的文本)
|
||
|
|
/// </summary>
|
||
|
|
public string Label
|
||
|
|
{
|
||
|
|
get => _label;
|
||
|
|
set => this.RaiseAndSetIfChanged(ref _label, value);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 连接点类型(输入或输出)
|
||
|
|
/// </summary>
|
||
|
|
public ConnectionPointType Type
|
||
|
|
{
|
||
|
|
get => _type;
|
||
|
|
set => this.RaiseAndSetIfChanged(ref _type, value);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 连接点索引(在节点上的位置顺序)
|
||
|
|
/// </summary>
|
||
|
|
public int Index
|
||
|
|
{
|
||
|
|
get => _index;
|
||
|
|
set => this.RaiseAndSetIfChanged(ref _index, value);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 是否已连接
|
||
|
|
/// </summary>
|
||
|
|
public bool IsConnected
|
||
|
|
{
|
||
|
|
get => _isConnected;
|
||
|
|
set => this.RaiseAndSetIfChanged(ref _isConnected, value);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 所属节点
|
||
|
|
/// </summary>
|
||
|
|
public Node? Node { get; set; }
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 连接点类型枚举
|
||
|
|
/// </summary>
|
||
|
|
public enum ConnectionPointType
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 输入连接点(在左侧)
|
||
|
|
/// </summary>
|
||
|
|
Input,
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 输出连接点(在右侧)
|
||
|
|
/// </summary>
|
||
|
|
Output
|
||
|
|
}
|
||
|
|
|