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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="CollectionChangeEventArgs.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>Provides data for the <see langword='CollectionChange '/> event.</para>
  24.     /// </devdoc>
  25.     [HostProtection(SharedState = true)]
  26.     public class CollectionChangeEventArgs : EventArgs
  27.     {
  28.         private CollectionChangeAction action;
  29.         private object element;
  30.        
  31.         /// <devdoc>
  32.         /// <para>Initializes a new instance of the <see cref='System.ComponentModel.CollectionChangeEventArgs'/> class.</para>
  33.         /// </devdoc>
  34.         public CollectionChangeEventArgs(CollectionChangeAction action, object element)
  35.         {
  36.             this.action = action;
  37.             this.element = element;
  38.         }
  39.        
  40.         /// <devdoc>
  41.         /// <para>Gets an action that specifies how the collection changed.</para>
  42.         /// </devdoc>
  43.         public virtual CollectionChangeAction Action {
  44.             get { return action; }
  45.         }
  46.        
  47.         /// <devdoc>
  48.         /// <para>Gets the instance of the collection with the change. </para>
  49.         /// </devdoc>
  50.         public virtual object Element {
  51.             get { return element; }
  52.         }
  53.     }
  54. }

Developer Fusion