Click here to Skip to main content
15,892,269 members
Home / Discussions / C#
   

C#

 
AnswerRe: Develop IT helpdesk Pin
Dave Kreskowiak6-Oct-09 17:53
mveDave Kreskowiak6-Oct-09 17:53 
GeneralRe: Develop IT helpdesk Pin
Christian Graus6-Oct-09 18:02
protectorChristian Graus6-Oct-09 18:02 
AnswerJust in case.... Pin
Christian Graus6-Oct-09 18:11
protectorChristian Graus6-Oct-09 18:11 
AnswerRe: Develop IT helpdesk Pin
Pete O'Hanlon6-Oct-09 22:52
mvePete O'Hanlon6-Oct-09 22:52 
QuestionASP Print Pin
smarttom996-Oct-09 13:43
smarttom996-Oct-09 13:43 
AnswerRe: ASP Print Pin
Christian Graus6-Oct-09 13:57
protectorChristian Graus6-Oct-09 13:57 
Questionc# crystal reports remote server Pin
Shuaib wasif khan6-Oct-09 13:41
Shuaib wasif khan6-Oct-09 13:41 
Generalproblem with moving objects in a 2d array Pin
F Green6-Oct-09 13:12
F Green6-Oct-09 13:12 
Hi, I’m trying to get some objects to move around in a 2d array of lists, but the program keeps exiting with ‘System.InvalidOperationException’ and “Additional information: Collection was modified; enumeration operation may not execute.”


I’m pretty sure that this is the part of the code causing all the problems-

public void cycleThroughList()<br />
        {<br />
            for (int x = 0; x < GridDimention; x++)<br />
            {<br />
                for (int y = 0; y < GridDimention; y++)<br />
                {<br />
                    foreach (Microbe i in theWorld[x, y])<br />
                    {<br />
                        i.Talk();<br />
                        Update_Position(i);<br />
                        <br />
                    }<br />
                }<br />
            }<br />
        }<br />
<br />
public void Update_Position (Microbe m)<br />
{<br />
    if (m.sX != 0 & m.sY != 0)<br />
    { <br />
    theWorld[m.positionX, m.positionY].Remove (m);<br />
    theWorld[m.positionX + m.sX, m.positionY + m.sY].Add (m);    <br />
    }<br />
<br />
    m.Talk();<br />
}


Where ‘Talk’ is a method that writes to the console the coordinates of the Microbe object, and the ‘int sX’ and ‘int sY’ are the modifications to the objects location on the array.

Do you guys have any idea how to fix this?
I really appreciate any advice you can give me!
GeneralRe: problem with moving objects in a 2d array Pin
Christian Graus6-Oct-09 13:23
protectorChristian Graus6-Oct-09 13:23 
QuestionHow do I get a image_click to work more than once? Pin
Fenix26-Oct-09 13:08
Fenix26-Oct-09 13:08 
AnswerRe: How do I get a image_click to work more than once? Pin
Christian Graus6-Oct-09 13:24
protectorChristian Graus6-Oct-09 13:24 
GeneralRe: How do I get a image_click to work more than once? Pin
Fenix26-Oct-09 14:22
Fenix26-Oct-09 14:22 
Generalwrong forum Pin
Luc Pattyn6-Oct-09 14:59
sitebuilderLuc Pattyn6-Oct-09 14:59 
GeneralRe: wrong forum Pin
Fenix26-Oct-09 16:12
Fenix26-Oct-09 16:12 
GeneralRe: wrong forum Pin
Fenix26-Oct-09 16:24
Fenix26-Oct-09 16:24 
GeneralRe: wrong forum Pin
Fenix26-Oct-09 16:25
Fenix26-Oct-09 16:25 
QuestionHow to change the button's value in Datagrid Pin
dwark1066-Oct-09 12:00
dwark1066-Oct-09 12:00 
AnswerRe: How to change the button's value in Datagrid Pin
Henry Minute6-Oct-09 12:36
Henry Minute6-Oct-09 12:36 
GeneralRe: How to change the button's value in Datagrid Pin
dwark1066-Oct-09 13:58
dwark1066-Oct-09 13:58 
GeneralRe: How to change the button's value in Datagrid Pin
Henry Minute6-Oct-09 15:04
Henry Minute6-Oct-09 15:04 
QuestionHow do I pin an object in C#? [modified] - FIXED Pin
Richard Andrew x646-Oct-09 11:07
professionalRichard Andrew x646-Oct-09 11:07 
AnswerRe: How do I pin an object in C#? Pin
DaveyM696-Oct-09 11:35
professionalDaveyM696-Oct-09 11:35 
QuestionBackgroundworker disposal Pin
vsaratkar6-Oct-09 10:49
vsaratkar6-Oct-09 10:49 
AnswerRe: Backgroundworker disposal Pin
Christian Graus6-Oct-09 10:52
protectorChristian Graus6-Oct-09 10:52 
AnswerRe: Backgroundworker disposal Pin
DaveyM696-Oct-09 11:42
professionalDaveyM696-Oct-09 11: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.