PlcDataMonitorEditor.cs 747 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Collections;
  7. using System.ComponentModel;
  8. using System.ComponentModel.Design;
  9. using System.Windows.Forms.Design;
  10. // 自定义编辑器,用于 DataMonitor 属性
  11. public class PlcDataMonitorEditor : CollectionEditor
  12. {
  13. public PlcDataMonitorEditor(Type type) : base(type)
  14. {
  15. }
  16. // 禁用添加新项
  17. //protected override object CreateInstance(Type itemType)
  18. //{
  19. // // 返回 null 表示不允许创建新实例
  20. // //return null;
  21. //}
  22. //protected override bool CanRemoveInstance(object value)
  23. //{
  24. // return true; // 返回 false 表示不允许删除
  25. //}
  26. }