// *********************************************************************** // Assembly : Construction // Author : flythink // Created : 06-30-2020 // // Last Modified By : flythink // Last Modified On : 09-01-2020 // *********************************************************************** // // Copyright (c) jindongfang. All rights reserved. // // // *********************************************************************** namespace WellWorkDataUI.CustomControls { using DevExpress.XtraEditors; using DevExpress.XtraEditors.Drawing; using DevExpress.XtraEditors.Repository; using DevExpress.XtraEditors.ViewInfo; using System.ComponentModel; using System.Drawing; /// /// Class CustomSearchControl. /// Implements the /// /// public class CustomSearchControl : SearchControl { /// /// Gets the painter. /// /// The painter. protected override BaseControlPainter Painter { get { return HighDpiPainter.GetNewPainter(base.Painter); } } /// /// Creates the repository item core. /// /// RepositoryItem. protected override RepositoryItem CreateRepositoryItemCore() { return new CustomRepositoryItemSearchControl(); } /// /// Updates the mask box properties. /// /// if set to true [always]. protected override void UpdateMaskBoxProperties(bool always) { base.UpdateMaskBoxProperties(always); this.MaskBox.Font = HightDpiHelper.ScaleFont(this.Font); } } /// /// Class CustomSearchControlViewInfo. /// Implements the /// /// public class CustomSearchControlViewInfo : SearchControlViewInfo { /// /// Initializes a new instance of the class. /// /// The item. public CustomSearchControlViewInfo(RepositoryItem item) : base(item) { } /// /// Gets the mask box rect. /// /// The mask box rect. public override Rectangle MaskBoxRect { get { Rectangle bound = this.Bounds; bound.Inflate(-2, -2); return bound; } } } /// /// Class CustomRepositoryItemSearchControl. /// Implements the /// /// public class CustomRepositoryItemSearchControl : RepositoryItemSearchControl { /// /// Initializes a new instance of the class. /// public CustomRepositoryItemSearchControl() { } /// /// This member supports the editors library's internal infrastructure and is not intended to be used in your applications. /// /// A DevExpress.XtraEditors.ViewInfo.BaseEditViewInfo descendant containing the editor's view information. public override BaseEditViewInfo CreateViewInfo() { return new CustomSearchControlViewInfo(this); } /// /// Raises the query pop up. /// /// The instance containing the event data. protected override void RaiseQueryPopUp(CancelEventArgs e) { base.RaiseQueryPopUp(e); } } }