Click here to Skip to main content
15,900,258 members
Home / Discussions / C#
   

C#

 
GeneralRe: Regex.Replace hangs !!! Pin
whizzs2-Nov-05 10:32
whizzs2-Nov-05 10:32 
QuestionHow to Retrieve Serial Ports and Parallel Ports in the current system by Using Visual C# Pin
sums081-Nov-05 10:26
sums081-Nov-05 10:26 
AnswerRe: How to Retrieve Serial Ports and Parallel Ports in the current system by Using Visual C# Pin
whizzs2-Nov-05 10:49
whizzs2-Nov-05 10:49 
GeneralRe: How to Retrieve Serial Ports and Parallel Ports in the current system by Using Visual C# Pin
sums083-Nov-05 5:35
sums083-Nov-05 5:35 
QuestionCustom Collections Pin
tsramkumar1-Nov-05 10:06
tsramkumar1-Nov-05 10:06 
AnswerRe: Custom Collections Pin
S. Senthil Kumar1-Nov-05 18:18
S. Senthil Kumar1-Nov-05 18:18 
GeneralRe: Custom Collections Pin
tsramkumar2-Nov-05 3:06
tsramkumar2-Nov-05 3:06 
GeneralRe: Custom Collections Pin
S. Senthil Kumar2-Nov-05 4:37
S. Senthil Kumar2-Nov-05 4:37 
tsramkumar wrote:
Can you give me the reason behind your recommendation for overriding this method and where it will be used?


This will be used when you put your custom objects into a Hashtable, or in any associative container. You'd expect to get the same Customer, provided the id is the same, regardless of whether they are two different instances. What I mean is
Hashtable h = new Hashtable();
Customer c1 = new Customer(1);
h[c1] = "Senthil";
...
Customer c2 = new Customer(1);
Console.WriteLine((string)h[c2]);

Users of your class would expect "Senthil", right?


tsramkumar wrote:
Btw, I got around with this by making the custom object implement the IComprable interface


I'm not sure if implementing IComparable is enough, does your code work correctly for standard .NET collections like ArrayList?


Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
QuestionRigid body transformation parameters Pin
pxp1-Nov-05 9:54
pxp1-Nov-05 9:54 
QuestionAnother Dynamic Button Question Pin
TheMajorRager1-Nov-05 9:47
TheMajorRager1-Nov-05 9:47 
AnswerRe: Another Dynamic Button Question Pin
Wjousts1-Nov-05 10:45
Wjousts1-Nov-05 10:45 
QuestionLoop Through XML File Pin
Stephen McAllister1-Nov-05 9:34
Stephen McAllister1-Nov-05 9:34 
AnswerRe: Loop Through XML File Pin
MalikRizwan1-Nov-05 18:30
MalikRizwan1-Nov-05 18:30 
AnswerRe: Loop Through XML File Pin
S. Senthil Kumar1-Nov-05 18:43
S. Senthil Kumar1-Nov-05 18:43 
QuestionGet a column HeaderText Pin
zaboboa1-Nov-05 9:32
zaboboa1-Nov-05 9:32 
AnswerRe: Get a column HeaderText Pin
Wjousts1-Nov-05 10:51
Wjousts1-Nov-05 10:51 
Question[Message Deleted] Pin
Stephen McAllister1-Nov-05 9:31
Stephen McAllister1-Nov-05 9:31 
QuestionSort Array by Date properly Pin
Joshua Lunsford1-Nov-05 8:13
Joshua Lunsford1-Nov-05 8:13 
AnswerRe: Sort Array by Date properly Pin
Jon Sagara1-Nov-05 8:17
Jon Sagara1-Nov-05 8:17 
GeneralRe: Sort Array by Date properly Pin
Joshua Lunsford1-Nov-05 8:23
Joshua Lunsford1-Nov-05 8:23 
QuestionFile information Pin
KaptinKrunch1-Nov-05 6:57
KaptinKrunch1-Nov-05 6:57 
AnswerRe: File information Pin
Dan Neely1-Nov-05 7:09
Dan Neely1-Nov-05 7:09 
GeneralRe: File information Pin
KaptinKrunch1-Nov-05 7:30
KaptinKrunch1-Nov-05 7:30 
GeneralRe: File information Pin
Dan Neely1-Nov-05 8:14
Dan Neely1-Nov-05 8:14 
QuestionRuntime dragging a control Pin
hain1-Nov-05 6:32
hain1-Nov-05 6:32 

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.