I want to use a Generic SortedList but I don't need both Key Valuefields

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Deckarep

    I want to use a Generic SortedList but I don't need both Key Valuefields

    What is the best practice technique for using the .net native generic
    sorted list when I don't really need to have the value field
    occupied.

    I'd hate to write something like: mySortedList.Ad d( "John", null );

    Because when I look at that it just doesn't feel right. You don't
    exactly know what the intentions of the programmer are. Does he just
    not have a value in this instance? Should it be null? If it's null
    here can I still put a value if I want?

    I just don't like the fact that .net forces you to use the key/value
    methodology when you don't always need it.

    Or am I just plain old missing some important concept here?

    Anyways, what's the ideal way to handle this because like I said I
    don't need the value part occupied...it's of no use to me but I still
    want to use Generics.

    Thanks,

    -Deckarep
Working...