You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

130 lines
2.8 KiB
C#

1 year ago
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Windows.Forms;
namespace Mesnac.Basic
{
/// <summary>
/// 路径类
/// </summary>
public class IntakePath
{
#region 字段定义
private int oldStatus = 0;
private List<IntakeNode> tubes = new List<IntakeNode>();
private List<IntakeNode> valves = new List<IntakeNode>();
#endregion
#region 构造方法
public IntakePath() { }
public IntakePath(IntakePath path)
{
this.tubes.AddRange(path.Tubes);
this.valves.AddRange(path.Valves);
}
#endregion
#region 属性定义
/// <summary>
/// 路径的原始状态
/// </summary>
public int OldStatus
{
get { return oldStatus; }
set { oldStatus = value; }
}
/// <summary>
/// 路径中的管道集合
/// </summary>
public List<IntakeNode> Tubes
{
get { return tubes; }
set { tubes = value; }
}
/// <summary>
/// 路径中阀门集合
/// </summary>
public List<IntakeNode> Valves
{
get { return valves; }
set { valves = value; }
}
#endregion
}
/// <summary>
/// 路径节点
/// </summary>
public class IntakeNode
{
#region 字段定义
private Control ctl;
private PropertyInfo linkProperty;
private PropertyInfo controlProperty;
#endregion
#region 构造方法
public IntakeNode() { }
public IntakeNode(Control ctl)
{
this.ctl = ctl;
}
public IntakeNode(IntakeNode parent)
{
this.ctl = parent.ctl;
this.linkProperty = parent.linkProperty;
this.controlProperty = parent.controlProperty;
}
public IntakeNode(Control ctl, PropertyInfo linkProperty)
{
this.ctl = ctl;
this.linkProperty = linkProperty;
}
#endregion
#region 属性定义
/// <summary>
/// 节点控件
/// </summary>
public Control Ctl
{
get { return ctl; }
set { ctl = value; }
}
/// <summary>
/// 节点链接属性
/// </summary>
public PropertyInfo LinkProperty
{
get { return linkProperty; }
set { linkProperty = value; }
}
/// <summary>
/// 节点控制属性
/// </summary>
public PropertyInfo ControlProperty
{
get { return controlProperty; }
set { controlProperty = value; }
}
#endregion
}
}