The Labs \ Source Viewer \ SSCLI \ System.ComponentModel \ HandledEventArgs

  1. //------------------------------------------------------------------------------
  2. // <copyright file="HandledEventArgs.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.ComponentModel
  16. {
  17.     using System;
  18.     using System.ComponentModel;
  19.     using System.Diagnostics;
  20.     using System.Security.Permissions;
  21.    
  22.     /// <devdoc>
  23.     /// <para>
  24.     /// Provides data for the <see cref='System.ComponentModel.HandledEventArgs.Handled'/>
  25.     /// event.
  26.     /// </para>
  27.     /// </devdoc>
  28.     [HostProtection(SharedState = true)]
  29.     public class HandledEventArgs : EventArgs
  30.     {
  31.        
  32.         /// <devdoc>
  33.         /// Indicates, on return, whether or not the event was handled in the application's event handler.
  34.         /// 'true' means the application handled the event, 'false' means it didn't.
  35.         /// </devdoc>
  36.         private bool handled;
  37.        
  38.         /// <devdoc>
  39.         /// <para>
  40.         /// Initializes a new instance of the <see cref='System.ComponentModel.HandledEventArgs'/> class with
  41.         /// handled set to <see langword='false'/>.
  42.         /// </para>
  43.         /// </devdoc>
  44.         public HandledEventArgs() : this(false)
  45.         {
  46.         }
  47.        
  48.         /// <devdoc>
  49.         /// <para>
  50.         /// Initializes a new instance of the <see cref='System.ComponentModel.HandledEventArgs'/> class with
  51.         /// handled set to the given value.
  52.         /// </para>
  53.         /// </devdoc>
  54.         public HandledEventArgs(bool defaultHandledValue) : base()
  55.         {
  56.             this.handled = defaultHandledValue;
  57.         }
  58.        
  59.         /// <devdoc>
  60.         /// <para>
  61.         /// Gets or sets a value
  62.         /// indicating whether the event is handled.
  63.         /// </para>
  64.         /// </devdoc>
  65.         public bool Handled {
  66.             get { return this.handled; }
  67.             set { this.handled = value; }
  68.         }
  69.     }
  70. }

Developer Fusion