Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i'll first show u the code then try to explain my situation

   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?

Posted

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

i'm not lazy i'm just resting before i get tired.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...