using CustomControls.Pattern; using DevExpress.XtraPrinting; using DevExpress.XtraPrinting.Native; namespace CustomControls { /// /// 自定义控件 /// public class CustomControl { /// /// 注册解析事件,映射类型 /// public static void EnsurePatternBrick() => BrickFactory.BrickResolve += BrickFactory_BrickResolve; /// /// 映射控件类型 /// private static void BrickFactory_BrickResolve(object sender, BrickResolveEventArgs args) { if (args.Brick != null) return; /* 根据控件名称选择控件 */ switch (args.Name) { case nameof(PatternBrick): args.Brick = new PatternBrick(); break; } } } }