XRPatternDesignerActionList.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.ComponentModel;
  2. using System.ComponentModel.Design;
  3. using System.Drawing.Design;
  4. using CustomControls.Pattern;
  5. using DevExpress.XtraReports.Design;
  6. using DevExpress.XtraReports.Design.Expressions;
  7. namespace CustomControls.Design
  8. {
  9. /// <summary>
  10. /// 设计清单
  11. /// </summary>
  12. public class XRPatternDesignerActionList : XRControlBaseDesignerActionList
  13. {
  14. /// <summary>
  15. /// 实例
  16. /// </summary>
  17. public string StringData
  18. {
  19. get => ((XRPattern)Component).StringData;
  20. set => SetPropertyValue(nameof(XRPattern.StringData), value);
  21. }
  22. /// <summary>
  23. /// 绑定表达式
  24. /// </summary>
  25. [Editor(typeof(ExpressionValueEditor), baseType: typeof(UITypeEditor))]
  26. [TypeConverter(typeof(ExpressionPropertyTypeConverter))]
  27. public string StringDataExpression
  28. {
  29. get => GetExpression(nameof(XRPattern.StringData));
  30. set => SetExpression(nameof(XRPattern.StringData), value);
  31. }
  32. /// <summary>
  33. /// 构造函数
  34. /// </summary>
  35. public XRPatternDesignerActionList(XRControlDesigner designer) : base(designer)
  36. {
  37. }
  38. /// <summary>
  39. /// 添加设计属性
  40. /// </summary>
  41. protected override void FillActionItemCollection(DesignerActionItemCollection actionItems)
  42. {
  43. AddPropertyItem(actionItems, nameof(StringData), nameof(XRPattern.StringData));
  44. if (TryCreatePropertyItem(nameof(StringDataExpression), string.Empty, out var item))
  45. {
  46. actionItems.Add(item);
  47. }
  48. }
  49. }
  50. }