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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ListChangedEventArgs.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. //can not fix - Everett breaking change
  16. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.ComponentModel.ListChangedEventArgs..ctor(System.ComponentModel.ListChangedType,System.Int32,System.ComponentModel.PropertyDescriptor)")]
  17. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", Scope = "member", Target = "System.ComponentModel.ListChangedEventArgs..ctor(System.ComponentModel.ListChangedType,System.ComponentModel.PropertyDescriptor)")]
  18. namespace System.ComponentModel
  19. {
  20.    
  21.     using Microsoft.Win32;
  22.     using System;
  23.     using System.Diagnostics;
  24.     using System.Security.Permissions;
  25.    
  26.     /// <devdoc>
  27.     /// <para>[To be supplied.]</para>
  28.     /// </devdoc>
  29.     [HostProtection(SharedState = true)]
  30.     public class ListChangedEventArgs : EventArgs
  31.     {
  32.        
  33.         private ListChangedType listChangedType;
  34.         private int newIndex;
  35.         private int oldIndex;
  36.         private PropertyDescriptor propDesc;
  37.        
  38.         /// <devdoc>
  39.         /// <para>[To be supplied.]</para>
  40.         /// </devdoc>
  41.         public ListChangedEventArgs(ListChangedType listChangedType, int newIndex) : this(listChangedType, newIndex, -1)
  42.         {
  43.         }
  44.        
  45.         /// <devdoc>
  46.         /// <para>[To be supplied.]</para>
  47.         /// </devdoc>
  48.         public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, PropertyDescriptor propDesc) : this(listChangedType, newIndex)
  49.         {
  50.             this.propDesc = propDesc;
  51.             this.oldIndex = newIndex;
  52.         }
  53.        
  54.         /// <devdoc>
  55.         /// <para>[To be supplied.]</para>
  56.         /// </devdoc>
  57.         public ListChangedEventArgs(ListChangedType listChangedType, PropertyDescriptor propDesc)
  58.         {
  59.             Debug.Assert(listChangedType != ListChangedType.Reset, "this constructor is used only for changes in the list MetaData");
  60.             Debug.Assert(listChangedType != ListChangedType.ItemAdded, "this constructor is used only for changes in the list MetaData");
  61.             Debug.Assert(listChangedType != ListChangedType.ItemDeleted, "this constructor is used only for changes in the list MetaData");
  62.             Debug.Assert(listChangedType != ListChangedType.ItemChanged, "this constructor is used only for changes in the list MetaData");
  63.            
  64.             this.listChangedType = listChangedType;
  65.             this.propDesc = propDesc;
  66.         }
  67.        
  68.         /// <devdoc>
  69.         /// <para>[To be supplied.]</para>
  70.         /// </devdoc>
  71.         public ListChangedEventArgs(ListChangedType listChangedType, int newIndex, int oldIndex)
  72.         {
  73.             Debug.Assert(listChangedType != ListChangedType.PropertyDescriptorAdded, "this constructor is used only for item changed in the list");
  74.             Debug.Assert(listChangedType != ListChangedType.PropertyDescriptorDeleted, "this constructor is used only for item changed in the list");
  75.             Debug.Assert(listChangedType != ListChangedType.PropertyDescriptorChanged, "this constructor is used only for item changed in the list");
  76.             this.listChangedType = listChangedType;
  77.             this.newIndex = newIndex;
  78.             this.oldIndex = oldIndex;
  79.         }
  80.        
  81.         /// <devdoc>
  82.         /// <para>[To be supplied.]</para>
  83.         /// </devdoc>
  84.         public ListChangedType ListChangedType {
  85.             get { return listChangedType; }
  86.         }
  87.        
  88.         /// <devdoc>
  89.         /// <para>[To be supplied.]</para>
  90.         /// </devdoc>
  91.         public int NewIndex {
  92.             get { return newIndex; }
  93.         }
  94.        
  95.         /// <devdoc>
  96.         /// <para>[To be supplied.]</para>
  97.         /// </devdoc>
  98.         public int OldIndex {
  99.             get { return oldIndex; }
  100.         }
  101.        
  102.         /// <devdoc>
  103.         /// <para>[To be supplied.]</para>
  104.         /// </devdoc>
  105.         public PropertyDescriptor PropertyDescriptor {
  106.             get { return propDesc; }
  107.         }
  108.     }
  109. }

Developer Fusion