none
cast to Generic Collection

    Pergunta

  • I have the following class
    ===================================================

    Public Class CollectionClass

    Default Public Property Item(ByVal index As Integer) As classA

    Get

    Return DirectCast(List(index), classA)

    End Get

    Set(ByVal value As classA)

    List(index) = value

    End Set

    End Property
    End Class
    ======================================
    Public Class classB
    Public Property Items() As CollectionClass
    Get

    Return _items

    End Get

    Set(ByVal value As CollectionClass)

    _items = value

    End Set

    End Property

    End Class
    ======================================
    And i have following object in another class and need to cast

    Dim objBase as new CollectionClass

    Dim kk as new Classb

    Dim objGeneric as new ObjectCollection(of  classA)


    objBase=kk.Items

    I need to  assign objBase to objGeneric like

    objGeneric=objBase



    Is it possible if pls let me know how we can do this

    Thanks

    • Editado Pulikkan quinta-feira, 19 de fevereiro de 2009 14:05 Edit
    quinta-feira, 19 de fevereiro de 2009 13:55