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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CancelEventArgs.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.    
  23.     /// <devdoc>
  24.     /// <para>
  25.     /// Provides data for the <see cref='System.ComponentModel.CancelEventArgs.Cancel'/>
  26.     /// event.
  27.     /// </para>
  28.     /// </devdoc>
  29.     [HostProtection(SharedState = true)]
  30.     public class CancelEventArgs : EventArgs
  31.     {
  32.        
  33.         /// <devdoc>
  34.         /// Indicates, on return, whether or not the operation should be cancelled
  35.         /// or not. 'true' means cancel it, 'false' means don't.
  36.         /// </devdoc>
  37.         private bool cancel;
  38.        
  39.         /// <devdoc>
  40.         /// <para>
  41.         /// Initializes a new instance of the <see cref='System.ComponentModel.CancelEventArgs'/> class with
  42.         /// cancel set to <see langword='false'/>.
  43.         /// </para>
  44.         /// </devdoc>
  45.         public CancelEventArgs() : this(false)
  46.         {
  47.         }
  48.        
  49.         /// <devdoc>
  50.         /// <para>
  51.         /// Initializes a new instance of the <see cref='System.ComponentModel.CancelEventArgs'/> class with
  52.         /// cancel set to the given value.
  53.         /// </para>
  54.         /// </devdoc>
  55.         public CancelEventArgs(bool cancel) : base()
  56.         {
  57.             this.cancel = cancel;
  58.         }
  59.        
  60.         /// <devdoc>
  61.         /// <para>
  62.         /// Gets or sets a value
  63.         /// indicating whether the operation should be cancelled.
  64.         /// </para>
  65.         /// </devdoc>
  66.         public bool Cancel {
  67.             get { return cancel; }
  68.             set { this.cancel = value; }
  69.         }
  70.     }
  71. }

Developer Fusion