Namespace Client

  ' This is the same as the "old" class except that the 
  ' Friend New(DataRow) constructor has been removed.
  Public Class DescriptorInfo

    Private _id As Integer ' the unique ID of the descriptor
    Private _typeID As Integer   ' the internal descriptor type
    Private _term As Term        ' descriptor term in a given language

    Friend Sub New(ByVal ID As Integer, ByVal typeID As Integer, ByVal term As Term)
      MyBase.New()
      If term Is Nothing Then
        Throw New ArgumentNullException("term")
      End If
      _id = ID
      _typeID = typeID
      _term = term
    End Sub


    Public ReadOnly Property ID() As Integer
      Get
        Return _id
      End Get
    End Property


    Public ReadOnly Property TypeID() As Integer
      Get
        Return _typeID
      End Get
    End Property


    Public ReadOnly Property Term() As Term
      Get
        Return _term
      End Get
    End Property

  End Class


  Public Class DescriptorInfoCollection
      Inherits CollectionBase

      Public Sub New()
          MyBase.New(GetType(DescriptorInfo))
      End Sub


      Default Public Property Item(ByVal index As Integer) As DescriptorInfo
          Get
              Return DirectCast(Me.List(index), DescriptorInfo)
          End Get
          Set(ByVal Value As DescriptorInfo)
              Me.List(index) = Value
          End Set
      End Property 

      Public Sub Add(ByVal value As DescriptorInfo)
          Me.List.Add(value)
      End Sub 

      Public Function IndexOf(ByVal value As DescriptorInfo) As Integer
          Return Me.List.IndexOf(value)
      End Function

      Public Sub Insert(ByVal index As Integer, ByVal value As DescriptorInfo)
          Me.List.Insert(index, value)
      End Sub


      Public Sub Remove(ByVal value As DescriptorInfo)
          Me.List.Remove(value)
      End Sub


      Public Function Contains(ByVal value As DescriptorInfo) As Boolean
          Return Me.List.Contains(value)
      End Function 


  End Class


End Namespace