ContainerControl.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software"), to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2004 Novell, Inc.
  21. //
  22. // Authors:
  23. // Peter Bartok [email protected]
  24. //
  25. //
  26. using System.Collections;
  27. using System.ComponentModel;
  28. using System.ComponentModel.Design;
  29. using System.Drawing;
  30. using System.Runtime.InteropServices;
  31. namespace System.Windows.Forms {
  32. #if NET_2_0
  33. [ClassInterface (ClassInterfaceType.AutoDispatch)]
  34. [ComVisible (true)]
  35. #endif
  36. public class ContainerControl : ScrollableControl, IContainerControl {
  37. private Control active_control;
  38. private Control unvalidated_control;
  39. // This is an internal hack that allows some container controls
  40. // to not auto select their child when they are activated
  41. internal bool auto_select_child = true;
  42. #if NET_2_0
  43. private SizeF auto_scale_dimensions;
  44. private AutoScaleMode auto_scale_mode;
  45. private bool auto_scale_mode_set;
  46. private bool auto_scale_pending;
  47. private bool is_auto_scaling;
  48. #endif
  49. internal bool validation_failed; //track whether validation was cancelled by a validating control
  50. #region Public Constructors
  51. public ContainerControl() {
  52. active_control = null;
  53. unvalidated_control = null;
  54. ControlRemoved += new ControlEventHandler(OnControlRemoved);
  55. #if NET_2_0
  56. auto_scale_dimensions = SizeF.Empty;
  57. auto_scale_mode = AutoScaleMode.Inherit;
  58. #endif
  59. }
  60. #endregion // Public Constructors
  61. #region Public Instance Properties
  62. [Browsable (false)]
  63. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  64. public Control ActiveControl {
  65. get {
  66. return active_control;
  67. }
  68. set {
  69. if (value==null || (active_control == value && active_control.Focused)) {
  70. return;
  71. }
  72. if (!Contains(value)) {
  73. throw new ArgumentException("Cannot activate invisible or disabled control.");
  74. }
  75. // Fire the enter and leave events if possible
  76. Form form = FindForm ();
  77. Control active = GetMostDeeplyNestedActiveControl (form == null ? this : form);
  78. Control common_ancestor = GetCommonContainer (active, value);
  79. ArrayList chain = new ArrayList ();
  80. ArrayList validation_chain = new ArrayList ();
  81. Control walk = active;
  82. // we split this up into three steps:
  83. // 1. walk up the tree (if we need to) to our root, firing leave events.
  84. // 2. validate.
  85. // 3. walk down the tree (if we need to), firing enter events.
  86. // "our root" is either the common ancestor of the current active
  87. // control and the new active control, or the current active control,
  88. // or the new active control. That is, it's either one of these three
  89. // configurations:
  90. // (1) root (2) new (3) current
  91. // / \ / \ / \
  92. // ... ... ... ... ... ...
  93. // / \ / \
  94. // current new current new
  95. // note (3) doesn't require any upward walking, and no leave events are generated.
  96. // (2) doesn't require any downward walking, and no enter events are generated.
  97. // as we walk up the tree, we generate a list of all controls which cause
  98. // validation. After firing the leave events, we invoke (in order starting from
  99. // the most deeply nested) their Validating event. If one sets CancelEventArgs.Cancel
  100. // to true, we ignore the control the user wanted to set ActiveControl to, and use
  101. // the Validating control instead.
  102. bool fire_enter = true;
  103. Control root = common_ancestor;
  104. active_control = value;
  105. // Generate the leave messages
  106. while (walk != common_ancestor && walk != null) {
  107. if (walk == value) {
  108. root = value;
  109. fire_enter = false;
  110. break;
  111. }
  112. walk.FireLeave ();
  113. /* clear our idea of the active control as we go back up */
  114. if (walk is ContainerControl)
  115. ((ContainerControl)walk).active_control = null;
  116. if (walk.CausesValidation)
  117. validation_chain.Add (walk);
  118. walk = walk.Parent;
  119. }
  120. validation_failed = false;
  121. for (int i = 0; i < validation_chain.Count; i ++) {
  122. if (!ValidateControl ((Control)validation_chain[i])) {
  123. active_control = value = (Control)validation_chain[i];
  124. fire_enter = true;
  125. validation_failed = true;
  126. }
  127. }
  128. if (fire_enter) {
  129. walk = value;
  130. while (walk != root && walk != null) {
  131. chain.Add (walk);
  132. walk = walk.Parent;
  133. }
  134. if (root != null && walk == root && !(root is ContainerControl))
  135. chain.Add (walk);
  136. for (int i = chain.Count - 1; i >= 0; i--) {
  137. walk = (Control) chain [i];
  138. walk.FireEnter ();
  139. }
  140. }
  141. walk = this;
  142. Control ctl = this;
  143. while (walk != null) {
  144. if (walk.Parent is ContainerControl) {
  145. ((ContainerControl) walk.Parent).active_control = ctl;
  146. ctl = walk.Parent;
  147. }
  148. walk = walk.Parent;
  149. }
  150. if (this is Form)
  151. CheckAcceptButton();
  152. // Scroll control into view
  153. ScrollControlIntoView(active_control);
  154. walk = this;
  155. ctl = this;
  156. while (walk != null) {
  157. if (walk.Parent is ContainerControl) {
  158. ctl = walk.Parent;
  159. }
  160. walk = walk.Parent;
  161. }
  162. // Let the control know it's selected
  163. if (ctl.InternalContainsFocus)
  164. SendControlFocus (active_control);
  165. }
  166. }
  167. private bool ValidateControl (Control c)
  168. {
  169. CancelEventArgs e = new CancelEventArgs ();
  170. c.FireValidating (e);
  171. if (e.Cancel)
  172. return false;
  173. c.FireValidated ();
  174. return true;
  175. }
  176. private Control GetMostDeeplyNestedActiveControl (ContainerControl container)
  177. {
  178. Control active = container.ActiveControl;
  179. while (active is ContainerControl) {
  180. if (((ContainerControl)active).ActiveControl == null)
  181. break;
  182. active = ((ContainerControl)active).ActiveControl;
  183. }
  184. return active;
  185. }
  186. // Just in a separate method to make debugging a little easier,
  187. // should eventually be rolled into ActiveControl setter
  188. private Control GetCommonContainer (Control active_control, Control value)
  189. {
  190. Control new_container = null;
  191. Control prev_container = active_control;
  192. while (prev_container != null) {
  193. new_container = value.Parent;
  194. while (new_container != null) {
  195. if (new_container == prev_container)
  196. return new_container;
  197. new_container = new_container.Parent;
  198. }
  199. prev_container = prev_container.Parent;
  200. }
  201. return null;
  202. }
  203. internal void SendControlFocus (Control c)
  204. {
  205. if (c.IsHandleCreated) {
  206. XplatUI.SetFocus (c.window.Handle);
  207. }
  208. }
  209. #if NET_2_0
  210. [Browsable (false)]
  211. [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
  212. [EditorBrowsable (EditorBrowsableState.Advanced)]
  213. [Localizable (true)]
  214. public SizeF AutoScaleDimensions {
  215. get {
  216. return auto_scale_dimensions;
  217. }
  218. set {
  219. if (auto_scale_dimensions != value) {
  220. auto_scale_dimensions = value;
  221. PerformAutoScale ();
  222. }
  223. }
  224. }
  225. protected SizeF AutoScaleFactor {
  226. get {
  227. if (auto_scale_dimensions.IsEmpty)
  228. return new SizeF (1f, 1f);
  229. return new SizeF(CurrentAutoScaleDimensions.Width / auto_scale_dimensions.Width,
  230. CurrentAutoScaleDimensions.Height / auto_scale_dimensions.Height);
  231. }
  232. }
  233. [Browsable (false)]
  234. [EditorBrowsable (EditorBrowsableState.Advanced)]
  235. [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
  236. public AutoScaleMode AutoScaleMode {
  237. get {
  238. return auto_scale_mode;
  239. }
  240. set {
  241. if (this is Form)
  242. (this as Form).AutoScale = false;
  243. if (auto_scale_mode != value) {
  244. auto_scale_mode = value;
  245. if (auto_scale_mode_set)
  246. auto_scale_dimensions = SizeF.Empty;
  247. auto_scale_mode_set = true;
  248. PerformAutoScale ();
  249. }
  250. }
  251. }
  252. #endif // NET_2_0
  253. [Browsable (false)]
  254. public override BindingContext BindingContext {
  255. get {
  256. if (base.BindingContext == null) {
  257. base.BindingContext = new BindingContext();
  258. }
  259. return base.BindingContext;
  260. }
  261. set {
  262. base.BindingContext = value;
  263. }
  264. }
  265. #if NET_2_0
  266. [Browsable (false)]
  267. [EditorBrowsable (EditorBrowsableState.Advanced)]
  268. public SizeF CurrentAutoScaleDimensions {
  269. get {
  270. switch(auto_scale_mode) {
  271. case AutoScaleMode.Dpi:
  272. return TextRenderer.GetDpi ();
  273. case AutoScaleMode.Font:
  274. Size s = TextRenderer.MeasureText ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890", Font);
  275. int width = (int)Math.Round ((float)s.Width / 62f);
  276. return new SizeF (width, s.Height);
  277. }
  278. return auto_scale_dimensions;
  279. }
  280. }
  281. #endif
  282. [Browsable (false)]
  283. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  284. public Form ParentForm {
  285. get {
  286. Control parent;
  287. parent = this.Parent;
  288. while (parent != null) {
  289. if (parent is Form) {
  290. return (Form)parent;
  291. }
  292. parent = parent.Parent;
  293. }
  294. return null;
  295. }
  296. }
  297. #endregion // Public Instance Properties
  298. #region Protected Instance Methods
  299. #if NET_2_0
  300. protected override bool CanEnableIme {
  301. get { return false; }
  302. }
  303. #endif
  304. protected override CreateParams CreateParams {
  305. get {
  306. return base.CreateParams;
  307. }
  308. }
  309. #endregion // Public Instance Methods
  310. #region Public Instance Methods
  311. #if NET_2_0
  312. internal void PerformAutoScale (bool called_by_scale)
  313. {
  314. if ((AutoScaleMode == AutoScaleMode.Inherit) && !called_by_scale)
  315. return;
  316. if ((layout_suspended > 0) && !called_by_scale) {
  317. auto_scale_pending = true;
  318. return;
  319. }
  320. // Set this first so we don't get called again from
  321. // PerformDelayedAutoScale after ResumeLayout
  322. auto_scale_pending = false;
  323. SizeF factor = AutoScaleFactor;
  324. if (AutoScaleMode == AutoScaleMode.Inherit) {
  325. ContainerControl cc = FindContainer (this.Parent);
  326. if (cc != null)
  327. factor = cc.AutoScaleFactor;
  328. }
  329. if (factor != new SizeF (1F, 1F)) {
  330. is_auto_scaling = true;
  331. SuspendLayout ();
  332. Scale (factor);
  333. ResumeLayout (false);
  334. is_auto_scaling = false;
  335. }
  336. auto_scale_dimensions = CurrentAutoScaleDimensions;
  337. }
  338. public void PerformAutoScale ()
  339. {
  340. PerformAutoScale (false);
  341. }
  342. internal void PerformDelayedAutoScale ()
  343. {
  344. if (auto_scale_pending)
  345. PerformAutoScale ();
  346. }
  347. internal bool IsAutoScaling {
  348. get { return is_auto_scaling; }
  349. }
  350. #endif
  351. [MonoTODO]
  352. static bool ValidateWarned;
  353. public bool Validate() {
  354. //throw new NotImplementedException();
  355. if (!ValidateWarned) {
  356. Console.WriteLine("ContainerControl.Validate is not yet implemented");
  357. ValidateWarned = true;
  358. }
  359. return true;
  360. }
  361. #if NET_2_0
  362. public bool Validate (bool checkAutoValidate)
  363. {
  364. if ((checkAutoValidate && (AutoValidate != AutoValidate.Disable)) || !checkAutoValidate)
  365. return Validate ();
  366. return true;
  367. }
  368. [Browsable (false)]
  369. [EditorBrowsable (EditorBrowsableState.Never)]
  370. public virtual bool ValidateChildren ()
  371. {
  372. return ValidateChildren (ValidationConstraints.Selectable);
  373. }
  374. [Browsable (false)]
  375. [EditorBrowsable (EditorBrowsableState.Never)]
  376. public virtual bool ValidateChildren (ValidationConstraints validationConstraints)
  377. {
  378. bool recurse = !((validationConstraints & ValidationConstraints.ImmediateChildren) == ValidationConstraints.ImmediateChildren);
  379. foreach (Control control in Controls)
  380. if (!ValidateNestedControls (control, validationConstraints, recurse))
  381. return false;
  382. return true;
  383. }
  384. #endif
  385. bool IContainerControl.ActivateControl(Control control) {
  386. return Select(control);
  387. }
  388. #endregion // Public Instance Methods
  389. #region Protected Instance Methods
  390. [EditorBrowsable (EditorBrowsableState.Advanced)]
  391. protected override void AdjustFormScrollbars(bool displayScrollbars) {
  392. base.AdjustFormScrollbars(displayScrollbars);
  393. }
  394. protected override void Dispose(bool disposing) {
  395. base.Dispose(disposing);
  396. }
  397. // LAMESPEC This used to be documented, but it's not in code
  398. // and no longer listed in MSDN2
  399. // [EditorBrowsable (EditorBrowsableState.Advanced)]
  400. // protected override void OnControlRemoved(ControlEventArgs e) {
  401. private void OnControlRemoved(object sender, ControlEventArgs e) {
  402. if (e.Control == this.unvalidated_control) {
  403. this.unvalidated_control = null;
  404. }
  405. if (e.Control == this.active_control) {
  406. this.unvalidated_control = null;
  407. }
  408. // base.OnControlRemoved(e);
  409. }
  410. protected override void OnCreateControl() {
  411. base.OnCreateControl();
  412. // MS seems to call this here, it gets the whole databinding process started
  413. OnBindingContextChanged (EventArgs.Empty);
  414. }
  415. #if NET_2_0
  416. protected override bool ProcessCmdKey (ref Message msg, Keys keyData)
  417. {
  418. if (ToolStripManager.ProcessCmdKey (ref msg, keyData) == true)
  419. return true;
  420. return base.ProcessCmdKey (ref msg, keyData);
  421. }
  422. #endif
  423. [EditorBrowsable (EditorBrowsableState.Advanced)]
  424. protected override bool ProcessDialogChar(char charCode) {
  425. if (GetTopLevel()) {
  426. if (ProcessMnemonic(charCode)) {
  427. return true;
  428. }
  429. }
  430. return base.ProcessDialogChar(charCode);
  431. }
  432. protected override bool ProcessDialogKey(Keys keyData) {
  433. Keys key;
  434. bool forward;
  435. key = keyData & Keys.KeyCode;
  436. forward = true;
  437. switch (key) {
  438. case Keys.Tab: {
  439. if ((keyData & (Keys.Alt | Keys.Control)) == Keys.None) {
  440. if (ProcessTabKey ((Control.ModifierKeys & Keys.Shift) == 0)) {
  441. return true;
  442. }
  443. }
  444. break;
  445. }
  446. case Keys.Left: {
  447. forward = false;
  448. goto case Keys.Down;
  449. }
  450. case Keys.Up: {
  451. forward = false;
  452. goto case Keys.Down;
  453. }
  454. case Keys.Right: {
  455. goto case Keys.Down;
  456. }
  457. case Keys.Down: {
  458. if (SelectNextControl(active_control, forward, false, false, true)) {
  459. return true;
  460. }
  461. break;
  462. }
  463. }
  464. return base.ProcessDialogKey(keyData);
  465. }
  466. protected override bool ProcessMnemonic(char charCode) {
  467. bool wrapped;
  468. Control c;
  469. wrapped = false;
  470. c = active_control;
  471. #if NET_2_0
  472. System.Collections.Generic.List<MenuStrip> strips = new System.Collections.Generic.List<MenuStrip> ();
  473. #endif
  474. do {
  475. c = GetNextControl(c, true);
  476. #if NET_2_0
  477. if (c is MenuStrip)
  478. strips.Add ((MenuStrip)c);
  479. #endif
  480. if (c != null) {
  481. // This is stupid. I want to be able to call c.ProcessMnemonic directly
  482. if (c.ProcessControlMnemonic(charCode)) {
  483. return(true);
  484. }
  485. continue;
  486. } else {
  487. if (wrapped) {
  488. break;
  489. }
  490. wrapped = true;
  491. }
  492. } while (c != active_control);
  493. #if NET_2_0
  494. // No one has an explicit mnemonic for this key.
  495. // Let MenuStrips have a chance at implicit mnemonics.
  496. foreach (MenuStrip ms in strips)
  497. if (ms.ProcessImplicitMnemonic (charCode))
  498. return true;
  499. #endif
  500. return false;
  501. }
  502. protected virtual bool ProcessTabKey(bool forward) {
  503. return SelectNextControl(active_control, forward, true, true, false);
  504. }
  505. protected override void Select(bool directed, bool forward)
  506. {
  507. if (Parent != null) {
  508. IContainerControl parent = Parent.GetContainerControl ();
  509. if (parent != null) {
  510. parent.ActiveControl = this;
  511. }
  512. }
  513. if (directed && auto_select_child) {
  514. SelectNextControl (null, forward, true, true, false);
  515. }
  516. }
  517. protected virtual void UpdateDefaultButton() {
  518. // MS Internal
  519. }
  520. [EditorBrowsable (EditorBrowsableState.Advanced)]
  521. protected override void WndProc(ref Message m) {
  522. switch ((Msg) m.Msg) {
  523. case Msg.WM_SETFOCUS:
  524. if (active_control != null)
  525. Select (active_control);
  526. else
  527. base.WndProc (ref m);
  528. #if false
  529. else
  530. SelectNextControl (null, true, true, true, false);
  531. #endif
  532. break;
  533. default:
  534. base.WndProc(ref m);
  535. break;
  536. }
  537. }
  538. #endregion // Protected Instance Methods
  539. #region Internal Methods
  540. internal void ChildControlRemoved (Control control)
  541. {
  542. if (control == active_control || control.Contains (active_control)) {
  543. SelectNextControl (this, true, true, true, true);
  544. if (control == active_control || control.Contains (active_control)) {
  545. active_control = null;
  546. }
  547. }
  548. }
  549. internal virtual void CheckAcceptButton()
  550. {
  551. // do nothing here, only called if it is a Form
  552. }
  553. #if NET_2_0
  554. private bool ValidateNestedControls (Control c, ValidationConstraints constraints, bool recurse)
  555. {
  556. bool validate_result = true;
  557. if (!c.CausesValidation)
  558. validate_result = true;
  559. else if (!ValidateThisControl (c, constraints))
  560. validate_result = true;
  561. else if (!ValidateControl (c))
  562. validate_result = false;
  563. if (recurse)
  564. foreach (Control control in c.Controls)
  565. if (!ValidateNestedControls (control, constraints, recurse))
  566. return false;
  567. return validate_result;
  568. }
  569. private bool ValidateThisControl (Control c, ValidationConstraints constraints)
  570. {
  571. if (constraints == ValidationConstraints.None)
  572. return true;
  573. if ((constraints & ValidationConstraints.Enabled) == ValidationConstraints.Enabled && !c.Enabled)
  574. return false;
  575. if ((constraints & ValidationConstraints.Selectable) == ValidationConstraints.Selectable && !c.GetStyle (ControlStyles.Selectable))
  576. return false;
  577. if ((constraints & ValidationConstraints.TabStop) == ValidationConstraints.TabStop && !c.TabStop)
  578. return false;
  579. if ((constraints & ValidationConstraints.Visible) == ValidationConstraints.Visible && !c.Visible)
  580. return false;
  581. return true;
  582. }
  583. #endif
  584. #endregion // Internal Methods
  585. #if NET_2_0
  586. protected override void OnParentChanged (EventArgs e)
  587. {
  588. base.OnParentChanged (e);
  589. }
  590. [EditorBrowsable (EditorBrowsableState.Advanced)]
  591. protected override void OnFontChanged (EventArgs e)
  592. {
  593. base.OnFontChanged (e);
  594. if (AutoScaleMode == AutoScaleMode.Font)
  595. PerformAutoScale ();
  596. }
  597. protected override void OnLayout (LayoutEventArgs e)
  598. {
  599. base.OnLayout (e);
  600. }
  601. AutoValidate auto_validate = AutoValidate.Inherit;
  602. [Browsable (false)]
  603. [AmbientValue (AutoValidate.Inherit)]
  604. [EditorBrowsable (EditorBrowsableState.Never)]
  605. public virtual AutoValidate AutoValidate {
  606. get {
  607. return auto_validate;
  608. }
  609. [MonoTODO("Currently does nothing with the setting")]
  610. set {
  611. if (auto_validate != value){
  612. auto_validate = value;
  613. OnAutoValidateChanged (new EventArgs ());
  614. }
  615. }
  616. }
  617. internal bool ShouldSerializeAutoValidate ()
  618. {
  619. return this.AutoValidate != AutoValidate.Inherit;
  620. }
  621. static object OnValidateChanged = new object ();
  622. protected virtual void OnAutoValidateChanged (EventArgs e)
  623. {
  624. EventHandler eh = (EventHandler) (Events [OnValidateChanged]);
  625. if (eh != null)
  626. eh (this, e);
  627. }
  628. [Browsable (false)]
  629. [EditorBrowsable (EditorBrowsableState.Never)]
  630. public event EventHandler AutoValidateChanged {
  631. add { Events.AddHandler (OnValidateChanged, value); }
  632. remove { Events.RemoveHandler (OnValidateChanged, value); }
  633. }
  634. #endif
  635. }
  636. }