Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# .NET question Pin
Anonymous16-Jul-02 12:00
Anonymous16-Jul-02 12:00 
GeneralRe: C# .NET question Pin
Christian Graus16-Jul-02 12:32
protectorChristian Graus16-Jul-02 12:32 
GeneralRe: C# .NET question Pin
Eric Gunnerson (msft)17-Jul-02 12:49
Eric Gunnerson (msft)17-Jul-02 12:49 
GeneralRe: C# .NET question Pin
Christian Graus17-Jul-02 13:07
protectorChristian Graus17-Jul-02 13:07 
GeneralRe: C# .NET question Pin
Eric Gunnerson (msft)17-Jul-02 13:38
Eric Gunnerson (msft)17-Jul-02 13:38 
GeneralRe: C# .NET question Pin
Feng Qin16-Jul-02 15:09
Feng Qin16-Jul-02 15:09 
GeneralCollections and Controls Pin
Paul Selormey15-Jul-02 18:50
Paul Selormey15-Jul-02 18:50 
GeneralIterate and modify Pin
J. Ehrnström15-Jul-02 14:10
J. Ehrnström15-Jul-02 14:10 
How do I iterate through a collection while modifying it?

Let's say I have a hashtable I want to clear one entry at a time. I might want to retrieve an object from the table and do something with it before I remove it.

I can not use the foreach statement on the dictionary entries in the table without getting an exception. I've understand that enumerators work the same way. The remove method is no good either since it does not return what it removes.

How can I solve this problem as easily as possible? Any hints would be much appreciated.

Thanks!
GeneralRe: Iterate and modify Pin
James T. Johnson15-Jul-02 14:29
James T. Johnson15-Jul-02 14:29 
GeneralRe: Iterate and modify Pin
J. Ehrnström15-Jul-02 15:02
J. Ehrnström15-Jul-02 15:02 
GeneralRe: Iterate and modify Pin
Eric Gunnerson (msft)16-Jul-02 5:32
Eric Gunnerson (msft)16-Jul-02 5:32 
GeneralRe: Iterate and modify Pin
J. Ehrnström17-Jul-02 1:29
J. Ehrnström17-Jul-02 1:29 
GeneralReflection Pin
Christian Graus15-Jul-02 12:28
protectorChristian Graus15-Jul-02 12:28 
GeneralRe: Reflection Pin
Andy Smith15-Jul-02 13:50
Andy Smith15-Jul-02 13:50 
GeneralRe: Reflection Pin
Christian Graus15-Jul-02 13:55
protectorChristian Graus15-Jul-02 13:55 
GeneralRe: Reflection Pin
Andy Smith15-Jul-02 14:13
Andy Smith15-Jul-02 14:13 
GeneralRe: Reflection Pin
Christian Graus15-Jul-02 14:19
protectorChristian Graus15-Jul-02 14:19 
GeneralRemoting and Load balancing in Multi tier Pin
Orion Buttigieg15-Jul-02 12:21
Orion Buttigieg15-Jul-02 12:21 
GeneralPosition in file Pin
Nnamdi Onyeyiri15-Jul-02 10:28
Nnamdi Onyeyiri15-Jul-02 10:28 
QuestionCode Profiler/Stack Tracer??? Pin
tdb15-Jul-02 7:09
tdb15-Jul-02 7:09 
AnswerRe: Code Profiler/Stack Tracer??? Pin
leppie15-Jul-02 8:01
leppie15-Jul-02 8:01 
GeneralRe: Code Profiler/Stack Tracer??? Pin
tdb15-Jul-02 8:16
tdb15-Jul-02 8:16 
GeneralRemoving CR-LF's from a string using Regex Pin
sultan_of_6string15-Jul-02 6:07
sultan_of_6string15-Jul-02 6:07 
GeneralRe: Removing CR-LF's from a string using Regex Pin
leppie15-Jul-02 6:49
leppie15-Jul-02 6:49 
GeneralRe: Removing CR-LF's from a string using Regex Pin
sultan_of_6string15-Jul-02 7:18
sultan_of_6string15-Jul-02 7:18 

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.