Click here to Skip to main content
15,905,144 members
Home / Discussions / C#
   

C#

 
QuestionI'm Having Way Too Much Fun (but I have another question...) Pin
Roger Wright9-Dec-09 18:39
professionalRoger Wright9-Dec-09 18:39 
AnswerRe: I'm Having Way Too Much Fun (but I have another question...) Pin
dan!sh 9-Dec-09 20:58
professional dan!sh 9-Dec-09 20:58 
GeneralRe: I'm Having Way Too Much Fun (but I have another question...) Pin
Roger Wright10-Dec-09 18:42
professionalRoger Wright10-Dec-09 18:42 
AnswerRe: I'm Having Way Too Much Fun (but I have another question...) Pin
PIEBALDconsult10-Dec-09 3:50
mvePIEBALDconsult10-Dec-09 3:50 
QuestionDataGridViewColumn can be accessed by multiple threads [modified] Pin
jdkulkarni9-Dec-09 18:33
jdkulkarni9-Dec-09 18:33 
Questionreg creation of multi file assembly Pin
sandhiyaus9-Dec-09 17:50
sandhiyaus9-Dec-09 17:50 
AnswerRe: reg creation of multi file assembly Pin
PIEBALDconsult9-Dec-09 18:10
mvePIEBALDconsult9-Dec-09 18:10 
QuestionTrying to use HashSet<t></t> Pin
BobInNJ9-Dec-09 13:38
BobInNJ9-Dec-09 13:38 
I am trying to understand the standard class HashSet<T>. As I understand it, this class implements a hash table. For example, it supports the method Add which adds members to the hash table. It also supports a method Contains which returns a boolean value whether or not the data item is in the table. Let say, I am writing an application with the following class:
class person {
    public int id;
    public string name;
}

Now, I am going to need to overload the operators == and != for the class person. My comparison
operator will return equal if and only if the classes have the same id. If I do that,
then I believe that I can write the following declaration:
HashSet<person> personSet;

Now, given the declaration of personSet, I know how to add things to it, but given an id, how do I find the person's name. That is, I would expect that the class should have some kind of find method. However, after looking thought the documentation, I failed to find such a function. I did find a method Contains, but that just returns a bool value. What am I missing?

Thanks

Bob
AnswerRe: Trying to use HashSet Pin
N a v a n e e t h9-Dec-09 14:53
N a v a n e e t h9-Dec-09 14:53 
QuestionDelete a word everytime the program see it. Pin
ahlm9-Dec-09 10:54
ahlm9-Dec-09 10:54 
AnswerRe: Delete a word everytime the program see it. Pin
Migounette9-Dec-09 11:56
Migounette9-Dec-09 11:56 
AnswerRe: Delete a word everytime the program see it. Pin
Abhinav S9-Dec-09 17:13
Abhinav S9-Dec-09 17:13 
GeneralRe: Delete a word everytime the program see it. Pin
ahlm9-Dec-09 18:31
ahlm9-Dec-09 18:31 
QuestionSqlCeResultSet Problem [modified] Pin
Stanciu Vlad9-Dec-09 6:25
Stanciu Vlad9-Dec-09 6:25 
AnswerRe: SqlCeResultSet Problem Pin
Migounette9-Dec-09 12:19
Migounette9-Dec-09 12:19 
QuestionRe: SqlCeResultSet Problem Pin
Stanciu Vlad9-Dec-09 20:09
Stanciu Vlad9-Dec-09 20:09 
QuestionUpdate own written TabPage Pin
Tagamoga9-Dec-09 4:18
Tagamoga9-Dec-09 4:18 
AnswerRe: Update own written TabPage Pin
The Man from U.N.C.L.E.9-Dec-09 7:01
The Man from U.N.C.L.E.9-Dec-09 7:01 
GeneralRe: Update own written TabPage Pin
Tagamoga9-Dec-09 8:28
Tagamoga9-Dec-09 8:28 
GeneralRe: Update own written TabPage Pin
The Man from U.N.C.L.E.9-Dec-09 10:18
The Man from U.N.C.L.E.9-Dec-09 10:18 
GeneralRe: Update own written TabPage Pin
Tagamoga9-Dec-09 12:24
Tagamoga9-Dec-09 12:24 
GeneralRe: Update own written TabPage Pin
The Man from U.N.C.L.E.10-Dec-09 1:27
The Man from U.N.C.L.E.10-Dec-09 1:27 
QuestionPreventing InvalidDeploymentException exceptions Pin
Jim Crafton9-Dec-09 4:16
Jim Crafton9-Dec-09 4:16 
AnswerRe: Preventing InvalidDeploymentException exceptions Pin
Paulo Zemek9-Dec-09 5:24
Paulo Zemek9-Dec-09 5:24 
GeneralRe: Preventing InvalidDeploymentException exceptions Pin
Jim Crafton9-Dec-09 5:30
Jim Crafton9-Dec-09 5:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.