grayson
Mon Dec 06 14:51:03 CST 2004
Thanx Sahil!
Now I got the idea... Sometimes it takes awhile... , Sorry Miha. Use the
index number and I'm right back were I wanted to be and still moving forward.
Perfect
"Sahil Malik" wrote:
> Grayson,
>
> To add bookmark functionality, you'd have to override the
> IEnumerator.GetEnumerator function and basically implement your own
> enumerator. When you'd do it, you'd realize why it was taken out - the
> enumerator will now have to deal with remembering it's client's bookmarks -
> not a good idea. So basically it's do-able, but it's a pain in the neck and
> generally not recommended.
>
> So I'd recommend "faking" it - by using a "For" loop instead of a foreach
> loop, and storing the ordinal (index integer) of where you wanted your
> bookmark to be, and thence start running the for loop from the bookmark
> onwards.
>
> In .NET 2.0, Enumerators are GREATLY simplified using a new keyword called
> "yeild", and well - then it'd be much easier to implement bookmarks but you
> still run into the problem mentioned in para #1. Essentially it will get
> easier to implement though.
>
> - Sahil Malik
>
http://dotnetjunkies.com/weblog/sahilmalik
>
>
>
>
>
> "Grayson" <grayson@community.nospam> wrote in message
> news:3E175B69-6C52-4ADE-BE9E-D54FEED1A87C@microsoft.com...
> > I have a 'for each DataRow in DataTable.Rows loop and I need a way to jump
> > back to a privious row and continue the loop. I haven't been able to come
> up
> > with any clever ways of faking this since Bookmarks don't exist anymore:-(
> >
> > Thnx,
> > Grayson
> >
>
>
>