TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
onez
NA
73
0
Ienumerate, class design help
Feb 10 2005 9:28 PM
I have an indexer and can foreach through it but cannot do a nested foreach loop becuase the Current Counts become interchanged for an infinite loop. When should I call Reset? public void Reset() { Cnt = -1; } public bool MoveNext() { return (++Cnt < this.Count); } public object Current { get { return this[Cnt]; } } public IEnumerator GetEnumerator() { Reset(); return (IEnumerator)this; } public void Add(object o) { Datas.Add(o); } Also, I have a objects that are nested like a treeview. I need to be able to easily change a node to another parent, etc. My current objects are indexers and using the arraylist remove, insert is not simple to work with. Looking for a class design suggestion, the main object is a financial statement.
Reply
Answers (
1
)
Ziping File
Disconnect internet connection