hmmm... Implement IDisposable.. yes, if you are creating your own Enumerator then that got to be done, but I mean on the side of the caller, there you can use a using block or a try ... finally and call dispose. Also... you got have some good reason to write your own enumerator, that's not common in a new to the language. Exactly ahat are you trying to do?
For a page... Try CodeProject.com - but don't take them as the last word. A good disposal pattern takes time to get ritgh, I've rewrote mine a few times already (I reuse it). And never forget msdn.microsoft.com. You will get good help in StackOverflow (although you will need to be more explicit and especifique than here). If you are implementing IDisposable: Here on a disposing pattern: http://www.codeproject.com/KB/cs/idisposable.aspx This one is not thread-safe, but will get you to work, if you want to make it thread-safe this is the do: don't allow two threads in your dispose method (use lock or interlocked). here is using in msdn: http://msdn.microsoft.com/en-us/library/yh598w02(VS.80).aspx And lastly always come back :) On 2 ago, 13:38, John Smith <[email protected]> wrote: > On Aug 2, 8:44 am, Theraot <[email protected]> wrote: > > > Sorry, Cerebrus not Cerberus, Dislexya strikes.... > > > On 2 ago, 07:42, Theraot <[email protected]> wrote: > > > > In the Enumerator example you are not disposing the Enumerator, it a > > > good practice to do it, aslo foreach will do it for you > > I tried writing my own code that disposes the Enumerator; but the best > I can come up with is to implement the IDisposable interface and > implement my own IDisposable.Dispose() > Method.http://msdn.microsoft.com/en-us/library/system.idisposable.dispose.aspx > What are some good websites for sample C# code online? > (I Googled for the better part of an hour but couldn't find any > examples on disposing Enumerator.) > > Also after reading this group's posting guidelines I have a few > questions: > 1) Does this group accept top post, inline post, or both (this post I > interjected my addition to Theraot's respose which is inline post; if > I put my additions at the beginning of the post then it's top post)? > 2) After posting at Pastebin.com which offers syntax highlighting, do > I include the link to Pastebin?http://dotnetdevelopment.pastebin.com/XhzV2xz4 > Or do I just assume other members at this group will go search on > Pastebin? > 3) For google groups I can't seem to find the option that hides the > quote text: "- Show quoted text -" Any help? > > Thanks and please cut me some slack for the beginner questions - it's > my first thread in this new forum.
