posição ([0], [i])
, I want to get by reference [LacoAzul] [CorVermelha]
.
Can you create a list like this?
Thanks in advance!
posição ([0], [i])
, I want to get by reference [LacoAzul] [CorVermelha]
.
Can you create a list like this?
Thanks in advance!
There are some Framework classes that work like this.
You can use a dictionary . In a dictionary there is no order. You access the elements by keys. The key can be of any type - if it is a type by reference, then you can pass the reference of an object to get the other object of the key - value .
Maybe a hash table (with class Hashtable ) also solves your problem. Like the dictionary it also works with key pairs - value , but it's a simpler structure. editing: Hashtable is now obsolete.
PS: if the purpose is just to know if the element is in the list, the generic list itself (class List ) has the Contains
, which indicates whether or not an element is in the list from its reference.