| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System.ComponentModel;
- namespace TeamAAS.FlowEditor.PropertyModels
- {
- /// <summary>
- /// 节点属性包装模型基类,包含通用属性。
- /// 每种节点类型派生自己的模型,添加特定的配置属性。
- /// </summary>
- public abstract class NodePropertyModelBase
- {
- protected readonly Models.FlowNode Node;
- protected NodePropertyModelBase(Models.FlowNode node)
- {
- Node = node;
- }
- #region 通用属性
- [Category("基本信息")]
- [DisplayName("节点名称")]
- [Description("节点的显示名称")]
- public string NodeName
- {
- get => Node.NodeName;
- set => Node.NodeName = value;
- }
- [Category("基本信息")]
- [DisplayName("节点类型")]
- [Description("节点的分类类型")]
- [ReadOnly(true)]
- public string NodeType => Node.Category.ToString();
- [Category("基本信息")]
- [DisplayName("插件标识")]
- [Description("关联的插件ID")]
- [ReadOnly(true)]
- public string PluginId => Node.PluginId ?? "(无)";
- [Category("基本信息")]
- [DisplayName("启用状态")]
- [Description("是否启用此节点")]
- public bool IsEnabled
- {
- get => Node.IsEnabled;
- set => Node.IsEnabled = value;
- }
- #endregion
- }
- }
|