Imports System.ComponentModel

Namespace Data

    ''' <summary>
    ''' Provides additional list changed data that can be coerced 
    ''' into an INotifyCollectionChanged event by an adapter.
    ''' </summary>
    ''' <remarks></remarks>
    Public Class NotifyListChangedEventArgs
        Inherits ListChangedEventArgs

        ''' <summary>
        ''' Initializes a default instance of the NotifyListChangedEventArgs 
        ''' class given the changed type, item, and the new index value.
        ''' </summary>
        ''' <param name="listChangedType">A <see cref="ListChangedType"/> indicating the type of change.</param>
        ''' <param name="item">The changed item.</param>
        ''' <param name="newIndex">The index of the item that was added, changed, or removed.</param>
        ''' <remarks></remarks>
        Public Sub New(ByVal listChangedType As ListChangedType, ByVal item As Object, ByVal newIndex As Integer)
            MyBase.New(listChangedType, newIndex)
            Me._item = item
        End Sub

        ''' <summary>
        ''' Initializes a default instance of the NotifyListChangedEventArgs 
        ''' class given the changed type, item, new index, and old index.
        ''' </summary>
        ''' <param name="listChangedType">A <see cref="ListChangedType"/> indicating the type of change.</param>
        ''' <param name="item">The changed item.</param>
        ''' <param name="newIndex">The new index of the item that was moved.</param>
        ''' <param name="oldIndex">The old index of the item that was moved.</param>
        ''' <remarks></remarks>
        Public Sub New(ByVal listChangedType As ListChangedType, ByVal item As Object, ByVal newIndex As Integer, ByVal oldIndex As Integer)
            MyBase.New(listChangedType, newIndex, oldIndex)
            Me._item = item
        End Sub

        ''' <summary>
        ''' Initializes a default instance of the NotifyListChangedEventArgs class 
        ''' given the changed type, item, new index, and property descriptor.
        ''' </summary>
        ''' <param name="listChangedType">A <see cref="ListChangedType"/> indicating the type of change.</param>
        ''' <param name="item">The changed item.</param>
        ''' <param name="newIndex">The new index of the item that was moved.</param>
        ''' <param name="descriptor">The property descriptor describing the changed property.</param>
        ''' <remarks></remarks>
        Public Sub New(ByVal listChangedType As ListChangedType, ByVal item As Object, ByVal newIndex As Integer, ByVal descriptor As PropertyDescriptor)
            MyBase.New(listChangedType, newIndex, descriptor)
            Me._item = item
        End Sub

        Private _item As Object

        ''' <summary>
        ''' Gets the item on which the change was made.
        ''' </summary>
        ''' <returns>The item on which the change was made.</returns>
        ''' <remarks></remarks>
        Public ReadOnly Property Item() As Object
            Get
                Return Me._item
            End Get
        End Property

    End Class

End Namespace