Click here to Skip to main content
15,896,915 members
Home / Discussions / C#
   

C#

 
QuestionMSChart RangeColumn type chart [modified] Pin
JohnQuar12-Jul-09 7:23
JohnQuar12-Jul-09 7:23 
Questionhi friends Pin
jeyaluxmy2-Jul-09 6:17
jeyaluxmy2-Jul-09 6:17 
AnswerRe: hi friends Pin
Rajesh R Subramanian2-Jul-09 6:27
professionalRajesh R Subramanian2-Jul-09 6:27 
AnswerRe: hi friends Pin
led mike2-Jul-09 6:37
led mike2-Jul-09 6:37 
AnswerRe: hi friends Pin
Henry Minute2-Jul-09 6:40
Henry Minute2-Jul-09 6:40 
JokeRe: hi friends Pin
musefan2-Jul-09 6:48
musefan2-Jul-09 6:48 
QuestionC# threads and invoking Pin
Blue3652-Jul-09 6:15
Blue3652-Jul-09 6:15 
AnswerRe: C# threads and invoking Pin
Henry Minute2-Jul-09 6:44
Henry Minute2-Jul-09 6:44 
GeneralRe: C# threads and invoking Pin
Luc Pattyn2-Jul-09 6:50
sitebuilderLuc Pattyn2-Jul-09 6:50 
GeneralRe: C# threads and invoking Pin
Henry Minute2-Jul-09 6:56
Henry Minute2-Jul-09 6:56 
AnswerRe: C# threads and invoking Pin
Luc Pattyn2-Jul-09 6:49
sitebuilderLuc Pattyn2-Jul-09 6:49 
GeneralRe: C# threads and invoking Pin
Blue3652-Jul-09 12:22
Blue3652-Jul-09 12:22 
GeneralRe: C# threads and invoking Pin
Luc Pattyn2-Jul-09 12:53
sitebuilderLuc Pattyn2-Jul-09 12:53 
AnswerRe: C# threads and invoking Pin
Alan N2-Jul-09 8:29
Alan N2-Jul-09 8:29 
QuestionGridView and making my site look like this page Pin
mjc2252-Jul-09 6:12
mjc2252-Jul-09 6:12 
AnswerRe: GridView and making my site look like this page Pin
Moim Hossain2-Jul-09 9:30
Moim Hossain2-Jul-09 9:30 
QuestionEnumerate Custom Class Pin
Dowse2-Jul-09 4:40
Dowse2-Jul-09 4:40 
Hi all

Have started writing a Class to help me with a problem in my current project and I would like to be able enumerate the variables in the Class by using a 'foreach(object o in MyClass)' in my main program.

I was getting a 'MyClass does not contain a public definition for GetEnumerator' but have worked out why and I am at the point where I could really do with some help with the GetEnumerator function.

public class MyClass : IEnumerable
{
    public System.DateTime datStart;        //Schedule start date
    public System.DateTime datEnd;          //Date of final occurrence (#1/1/1900# if N/A)
    public int intParam1;                   //Various Uses
    public int intParam2;                   //Various Uses
    //Other fields remove for clarity

    //Constructor
    public MyClass()
    {
        //Set defaults for new MyClass()
        datStart = new DateTime(1900, 1, 1);
        datEnd = datStart;
        intParam1 = -1;
        intParam2 = -1;
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
        //What goes here?

        return null;  //Only added this line to stop compiler error
    }
}


I know there are many, (many, many,) references to this on the web but I haven't been able to re-work any of them to solve my specific problem.

Any help would be MUCH appreciated.

Thank you.
AnswerRe: Enumerate Custom Class Pin
Thomas Weller2-Jul-09 5:36
Thomas Weller2-Jul-09 5:36 
GeneralRe: Enumerate Custom Class Pin
Dowse2-Jul-09 5:45
Dowse2-Jul-09 5:45 
GeneralRe: Enumerate Custom Class Pin
Thomas Weller2-Jul-09 6:07
Thomas Weller2-Jul-09 6:07 
GeneralRe: Enumerate Custom Class Pin
Dowse2-Jul-09 6:10
Dowse2-Jul-09 6:10 
AnswerRe: Enumerate Custom Class Pin
Luc Pattyn2-Jul-09 5:47
sitebuilderLuc Pattyn2-Jul-09 5:47 
AnswerRe: Enumerate Custom Class Pin
Dowse2-Jul-09 6:03
Dowse2-Jul-09 6:03 
AnswerRe: Enumerate Custom Class Pin
Dowse2-Jul-09 7:01
Dowse2-Jul-09 7:01 
AnswerRe: Enumerate Custom Class Pin
DaveyM692-Jul-09 5:58
professionalDaveyM692-Jul-09 5:58 

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.