Generic List Order

S

shapper

Hello,

I have an enum as follows:

Public Enum Feature
Title
Content
Date
Search
End

And a generic list:
Dim features As Generic.List(Of Feature)

I need to do 2 things:

1. Remove duplicate elements from my generic list (I am not sure if
generic.list allows to add duplicate elements)
2. Reorder the features according to a variable:

if a = 1 Then

Reorder features as follows:
Search, Title, Content, Date

elseif a = 2

Reorder features as follows:
Title, Search, Date, Content

...

Note: features might have all elements in feature enum or not ...
however that shouldn't affect the order.
For example, if features include Search and Content and a
= 1 then the order would be:
Search, Content

How can I do this?

Thank You,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,871
Messages
2,569,919
Members
46,172
Latest member
JamisonPat

Latest Threads

Top