more collection stuff

justplainsoccer

Newcomer
Joined
Dec 3, 2003
Messages
14
i'll first show u the code then try to explain my situation
Visual Basic:
    Select Case MainControl.SelectedIndex
       Case 0
            collectionStr = "keyCol"
       Case 1
            collectionStr = "accCol"
       Case 2
            collectionStr = "denyCol"
     End Select

    ModifyCertainCollectionInSomeWay(collectionStr)
then in the ModifyCertainCollectionInSomeWay i want it to modify that collection in some way... get what im tryin to say?
 
when you say 'certain collection' do you mean there are different collection objects and you'd like to choose which one during runtime?

if so simply pass that collection as a parameter as well... you can even do it byval because it's a complex object.

i think that's what you are trying to say.

are these collections different types? Are you using methods from CollectionBase? or your own?

try adding a parameter that is a CollectionBase.

if you are dealing with some custom property, i THINK you can convert back to the first type using a try catch and nested if (i'm pretty sure this is polymorphism at work, i hope i am correct in that )

i hope that helps
 
Back
Top