using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing.Design;
using CustomControls.Pattern;
using DevExpress.XtraReports.Design;
using DevExpress.XtraReports.Design.Expressions;
namespace CustomControls.Design
{
///
/// 设计清单
///
public class XRPatternDesignerActionList : XRControlBaseDesignerActionList
{
///
/// 实例
///
public string StringData
{
get => ((XRPattern)Component).StringData;
set => SetPropertyValue(nameof(XRPattern.StringData), value);
}
///
/// 绑定表达式
///
[Editor(typeof(ExpressionValueEditor), baseType: typeof(UITypeEditor))]
[TypeConverter(typeof(ExpressionPropertyTypeConverter))]
public string StringDataExpression
{
get => GetExpression(nameof(XRPattern.StringData));
set => SetExpression(nameof(XRPattern.StringData), value);
}
///
/// 构造函数
///
public XRPatternDesignerActionList(XRControlDesigner designer) : base(designer)
{
}
///
/// 添加设计属性
///
protected override void FillActionItemCollection(DesignerActionItemCollection actionItems)
{
AddPropertyItem(actionItems, nameof(StringData), nameof(XRPattern.StringData));
if (TryCreatePropertyItem(nameof(StringDataExpression), string.Empty, out var item))
{
actionItems.Add(item);
}
}
}
}