Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
QuestionHow to add checkbox to the title of the groupbox in C#.Net Pin
s_akram23-Sep-11 21:22
s_akram23-Sep-11 21:22 
AnswerRe: How to add checkbox to the title of the groupbox in C#.Net Pin
BillWoodruff23-Sep-11 23:13
professionalBillWoodruff23-Sep-11 23:13 
QuestionSample Data Pin
Xarzu23-Sep-11 15:44
Xarzu23-Sep-11 15:44 
AnswerRe: Sample Data Pin
BillWoodruff23-Sep-11 23:34
professionalBillWoodruff23-Sep-11 23:34 
Questionhelp to deal with graph data structure Pin
Mahdi_mnj23-Sep-11 12:10
Mahdi_mnj23-Sep-11 12:10 
AnswerRe: help to deal with graph data structure Pin
SledgeHammer0123-Sep-11 13:53
SledgeHammer0123-Sep-11 13:53 
AnswerRe: help to deal with graph data structure Pin
BillWoodruff24-Sep-11 0:04
professionalBillWoodruff24-Sep-11 0:04 
AnswerRe: help to deal with graph data structure Pin
BobJanova26-Sep-11 1:33
BobJanova26-Sep-11 1:33 
The short answer to this is that IEnumerable<T> also mandates that you implement IEnumerable, which requires a method of signature
IEnumerator GetEnumerator()

Fortunately IEnumerator<T> similarly mandates IEnumerator, so you can fulfil this contract with an explicit interface implementation:
IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }


(If you need to write an enumerator yourself, there's a similar issue with the Current property in IEnumerator<T> and IEnumerator, and a similar fix to return the same value but cast to object.)

However, as already pointed out, your graph is essentially wrapping a NodeList, and that already implements IEnumerable<T>. Instead of making an intermediate iterator, why not just forward the interface methods directly to the inner list?

IEnumerator<T> IEnumerable<T>.GetEnumerator() { return nodeList.GetEnumerator(); }
IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); }


(I've done both as explicit for symmetry and because you shouldn't be calling GetEnumerator directly; only one of them needs to be explicit.)
GeneralRe: help to deal with graph data structure Pin
Mahdi_mnj26-Sep-11 4:32
Mahdi_mnj26-Sep-11 4:32 
GeneralRe: help to deal with graph data structure Pin
BobJanova26-Sep-11 5:54
BobJanova26-Sep-11 5:54 
GeneralRe: help to deal with graph data structure Pin
Mahdi_mnj26-Sep-11 4:50
Mahdi_mnj26-Sep-11 4:50 
QuestionVersioning the hard way Pin
lukeer23-Sep-11 4:43
lukeer23-Sep-11 4:43 
AnswerRe: Versioning the hard way Pin
André Kraak23-Sep-11 23:03
André Kraak23-Sep-11 23:03 
GeneralRe: Versioning the hard way Pin
lukeer25-Sep-11 20:40
lukeer25-Sep-11 20:40 
AnswerRe: Versioning the hard way Pin
BobJanova26-Sep-11 2:02
BobJanova26-Sep-11 2:02 
QuestionC sharp GUI help needed! Pin
memed0922-Sep-11 20:42
memed0922-Sep-11 20:42 
AnswerRe: C sharp GUI help needed! Pin
memed0922-Sep-11 20:46
memed0922-Sep-11 20:46 
AnswerRe: C sharp GUI help needed! Pin
ScottM122-Sep-11 20:57
ScottM122-Sep-11 20:57 
GeneralRe: C sharp GUI help needed! Pin
memed0922-Sep-11 21:03
memed0922-Sep-11 21:03 
AnswerRe: C sharp GUI help needed! Pin
DaveAuld22-Sep-11 21:53
professionalDaveAuld22-Sep-11 21:53 
AnswerRe: C sharp GUI help needed! Pin
BillWoodruff23-Sep-11 0:43
professionalBillWoodruff23-Sep-11 0:43 
AnswerRe: C sharp GUI help needed! Pin
Bernhard Hiller26-Sep-11 1:07
Bernhard Hiller26-Sep-11 1:07 
QuestionHow can we restrict a user from changing the download path url's fine name. Pin
Member 825992122-Sep-11 11:21
Member 825992122-Sep-11 11:21 
AnswerRe: How can we restrict a user from changing the download path url's fine name. Pin
André Kraak22-Sep-11 11:47
André Kraak22-Sep-11 11:47 
AnswerRe: How can we restrict a user from changing the download path url's fine name. Pin
ScottM122-Sep-11 21:08
ScottM122-Sep-11 21:08 

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.