Click here to Skip to main content
15,922,015 members
Home / Discussions / C#
   

C#

 
JokeRe: C# Pin
Xmen Real 1-Mar-08 2:32
professional Xmen Real 1-Mar-08 2:32 
GeneralRead the forum guidelines Pin
pmarfleet1-Mar-08 2:32
pmarfleet1-Mar-08 2:32 
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 
Hi,

I've got this to compile now but how do I know if this is actually implementing IEnumerable?

class BuildGenericLists : IEnumerable
 {
     // this defines the structure of the main file table object that will
     // contain the list of files and information gained from the system scan.
     public struct Filelist
     {
         public string file_name, file_size, file_ext, last_access;

         // create a constructor
         public Filelist(string fileName, string fileSize, string fileExt, string lastAccess)
         {
             file_name = fileName;
             file_size = fileSize;
             file_ext = fileExt;
             last_access = lastAccess;
         }
     }

     // this method builds the main table from the structure defined above and returns an
     // empty generic list ready for populating.
     public static object BuildMainFileList()
     {
         List<Filelist> MainFileTableObject = new List<Filelist>();

         // return the empty list
         return MainFileTableObject;
     }
     public IEnumerator GetEnumerator()
     {
         return (IEnumerator)this;
     }
 }


Using breakpoints I can't see the program ever hitting the return (IEnumerator)this; line. I'm feeling pretty dumb at the moment. I thought I was starting to get a grip of C# basics but I'm stumped on this at the moment.
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 
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 

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.