Click here to Skip to main content
15,900,973 members
Home / Discussions / C#
   

C#

 
GeneralRe: Read the forum guidelines Pin
Not Active1-Mar-08 9:19
mentorNot Active1-Mar-08 9:19 
GeneralRe: C# Pin
Paul Conrad1-Mar-08 12:29
professionalPaul Conrad1-Mar-08 12:29 
GeneralImplementing IEnumerable<t></t> Pin
Jammer1-Mar-08 0:14
Jammer1-Mar-08 0:14 
GeneralRe: Implementing IEnumerable Pin
Not Active1-Mar-08 2:19
mentorNot Active1-Mar-08 2:19 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 2:28
Jammer1-Mar-08 2:28 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 3:01
Jammer1-Mar-08 3:01 
GeneralRe: Implementing IEnumerable Pin
papadimitriou1-Mar-08 3:51
papadimitriou1-Mar-08 3:51 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 4:01
Jammer1-Mar-08 4:01 
Ahhhh ... Thanks for the reply. Just before your reply came through I was repeatedly trying the code in various configs and then noticed that hovering over my code I now say that the class was getting an IEnumerable added but with the following error when I expanded the node:

base {System.Exception} = {"Unable to cast object of type 'SampleSort.DataLayer.BuildGenericLists' to type 'System.Collections.IEnumerator'."}


Changing to your suggestion:

public IEnumerator GetEnumerator ()
{

return MainFileTableObject ;
}


Now makes the compiler report:

Cannot implicitly convert type 'System.Collections.Generic.List<samplesort.datalayer.buildgenericlists.filelist>' to 'System.Collections.IEnumerator'. An explicit conversion exists (are you missing a cast?)</samplesort.datalayer.buildgenericlists.filelist>


I'm assuming that's progress! Smile | :)

I've seen examples using this yield keyword, that's new to C# 3.0 isn't it? (Which I'm using) so it would be good to implement the newer way of doing things.

I'm sure this is also due to my shallow understanding at the moment but my code is just producing an empty generic list so doing a foreach over it will add what exectly? Or is this code here in order to build in that functionality to the object rather than actually perform a foreach on an empty list?

Thanks loads for your help.
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 4:05
Jammer1-Mar-08 4:05 
GeneralRe: Implementing IEnumerable Pin
papadimitriou1-Mar-08 4:16
papadimitriou1-Mar-08 4:16 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 4:23
Jammer1-Mar-08 4:23 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 5:27
Jammer1-Mar-08 5:27 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 8:35
Jammer1-Mar-08 8:35 
GeneralRe: Implementing IEnumerable Pin
buchstaben1-Mar-08 8:40
buchstaben1-Mar-08 8:40 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 8:50
Jammer1-Mar-08 8:50 
GeneralRe: Implementing IEnumerable Pin
buchstaben2-Mar-08 2:38
buchstaben2-Mar-08 2:38 
GeneralRe: Implementing IEnumerable Pin
Jammer2-Mar-08 2:55
Jammer2-Mar-08 2:55 
GeneralRe: Implementing IEnumerable Pin
buchstaben2-Mar-08 3:33
buchstaben2-Mar-08 3:33 
GeneralRe: Implementing IEnumerable Pin
Jammer2-Mar-08 3:46
Jammer2-Mar-08 3:46 
GeneralRe: Implementing IEnumerable Pin
Guffa1-Mar-08 8:52
Guffa1-Mar-08 8:52 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 9:06
Jammer1-Mar-08 9:06 
GeneralRe: Implementing IEnumerable Pin
Guffa1-Mar-08 10:34
Guffa1-Mar-08 10:34 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 10:42
Jammer1-Mar-08 10:42 
GeneralRe: Implementing IEnumerable Pin
Elina Blank1-Mar-08 11:27
sitebuilderElina Blank1-Mar-08 11:27 
GeneralRe: Implementing IEnumerable Pin
Jammer1-Mar-08 11:31
Jammer1-Mar-08 11:31 

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.