Click here to Skip to main content
16,009,156 members
Home / Discussions / C#
   

C#

 
Generalthe msmq problem Pin
williamchou9-Sep-04 23:44
williamchou9-Sep-04 23:44 
GeneralCheck program running. Pin
tsunsau7179-Sep-04 22:59
tsunsau7179-Sep-04 22:59 
GeneralRe: Check program running. Pin
Ikarus769-Sep-04 23:43
Ikarus769-Sep-04 23:43 
GeneralRe: Check program running. Pin
tsunsau71712-Sep-04 17:45
tsunsau71712-Sep-04 17:45 
QuestionWhy this ? Pin
sreejith ss nair9-Sep-04 22:43
sreejith ss nair9-Sep-04 22:43 
AnswerRe: Why this ? Pin
Sebastian Schneider9-Sep-04 23:43
Sebastian Schneider9-Sep-04 23:43 
GeneralRe: Why this ? Pin
sreejith ss nair9-Sep-04 23:51
sreejith ss nair9-Sep-04 23:51 
AnswerRe: Why this ? Pin
Colin Angus Mackay10-Sep-04 0:40
Colin Angus Mackay10-Sep-04 0:40 
sreejith ss nair wrote:
why did the designers of .NET decide it was necessary to implement 2 interfaces in order to support enumeration?

Because you might want to have two separate threads enumerate over the same collection at the same time. Because the iteration model used in .NET does not permit alterations to a collection during enumeration this is completely safe.

The IEnumerator interface allows you to get the current state of a particular enumeration. While the IEnumerable interface allows you to retrieve a (normally new) IEnumerator object.

So, if you have two threads they can both get separate objects with an IEnumerator interface to the same collection - and both threads can iterate over the collection at their own speed without coliding with one another.

Also, it allows you to provide sevaral different ways to enumerate over one collection. A collection, through the IEnumerable interface, can expose a default enumeration, while it can also expose more object with the IEnumerator interface for other non-default enumerations. For instance, the default enumerator could just iterate through the collection in the order in which the data appears. While a second IEnumerator could expose the contents of the collection in a particular sort order, or with some filter.

Does this help?


"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!


GeneralRe: Why this ? Pin
sreejith ss nair10-Sep-04 0:55
sreejith ss nair10-Sep-04 0:55 
GeneralRe: Why this ? Pin
Colin Angus Mackay10-Sep-04 1:35
Colin Angus Mackay10-Sep-04 1:35 
GeneralRe: Why this ? Pin
Matt Gerrans10-Sep-04 7:18
Matt Gerrans10-Sep-04 7:18 
GeneralRe: Why this ? Pin
Colin Angus Mackay10-Sep-04 7:46
Colin Angus Mackay10-Sep-04 7:46 
GeneralRe: Why this ? Pin
Anonymous10-Sep-04 20:47
Anonymous10-Sep-04 20:47 
GeneralRe: Why this ? Pin
Colin Angus Mackay10-Sep-04 22:57
Colin Angus Mackay10-Sep-04 22:57 
QuestionWeb-style UI with re-flow - seen any examples? Pin
Mal Ross9-Sep-04 22:27
Mal Ross9-Sep-04 22:27 
AnswerRe: Web-style UI with re-flow - seen any examples? Pin
sreejith ss nair9-Sep-04 23:41
sreejith ss nair9-Sep-04 23:41 
GeneralRe: Web-style UI with re-flow - seen any examples? Pin
Mal Ross9-Sep-04 23:47
Mal Ross9-Sep-04 23:47 
AnswerRe: Web-style UI with re-flow - seen any examples? Pin
mav.northwind10-Sep-04 1:45
mav.northwind10-Sep-04 1:45 
AnswerRe: Web-style UI with re-flow - seen any examples? Pin
mav.northwind10-Sep-04 2:45
mav.northwind10-Sep-04 2:45 
GeneralRe: Web-style UI with re-flow - seen any examples? Pin
Mal Ross10-Sep-04 4:46
Mal Ross10-Sep-04 4:46 
Generalcall Javascript Function Pin
Ikarus769-Sep-04 22:16
Ikarus769-Sep-04 22:16 
Generaldisable cross button Pin
xiaowenjie9-Sep-04 20:22
xiaowenjie9-Sep-04 20:22 
GeneralRe: disable cross button Pin
Jay Shankar9-Sep-04 20:56
Jay Shankar9-Sep-04 20:56 
GeneralRe: disable cross button Pin
Stefan Troschuetz10-Sep-04 2:39
Stefan Troschuetz10-Sep-04 2:39 
Questionhow to import COM DLL in ASP.NET using C# Pin
zahid_ash9-Sep-04 19:09
zahid_ash9-Sep-04 19:09 

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.