NodePropertyModel.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System.ComponentModel;
  2. namespace TeamAAS.FlowEditor.PropertyModels
  3. {
  4. /// <summary>
  5. /// 节点属性包装模型基类,包含通用属性。
  6. /// 每种节点类型派生自己的模型,添加特定的配置属性。
  7. /// </summary>
  8. public abstract class NodePropertyModelBase
  9. {
  10. protected readonly Models.FlowNode Node;
  11. protected NodePropertyModelBase(Models.FlowNode node)
  12. {
  13. Node = node;
  14. }
  15. #region 通用属性
  16. [Category("基本信息")]
  17. [DisplayName("节点名称")]
  18. [Description("节点的显示名称")]
  19. public string NodeName
  20. {
  21. get => Node.NodeName;
  22. set => Node.NodeName = value;
  23. }
  24. [Category("基本信息")]
  25. [DisplayName("节点类型")]
  26. [Description("节点的分类类型")]
  27. [ReadOnly(true)]
  28. public string NodeType => Node.Category.ToString();
  29. [Category("基本信息")]
  30. [DisplayName("插件标识")]
  31. [Description("关联的插件ID")]
  32. [ReadOnly(true)]
  33. public string PluginId => Node.PluginId ?? "(无)";
  34. [Category("基本信息")]
  35. [DisplayName("启用状态")]
  36. [Description("是否启用此节点")]
  37. public bool IsEnabled
  38. {
  39. get => Node.IsEnabled;
  40. set => Node.IsEnabled = value;
  41. }
  42. #endregion
  43. }
  44. }