I have an array list full of structs and everytime I try and access the object in the array list and change a value in it, it does nothing.
// Line Cache
public ArrayList lineCache = new ArrayList();
public object drawLine(Point start, Point finish)
{
line lineObject = new line(start, finish);
object lineBuffer = lineCache.Add(lineObject);
return lineBuffer;
}
public void render()
{
while (!renderObject.IsDisposed)
{
renderTarget.BeginDraw();
renderTarget.Clear(transparencyDirect2D);
// Line Updaters
for (int i = 0; i < lineCache.Count; i++)
{
line cache = (line)lineCache[i];
renderTarget.DrawLine(drawingBrush, cache.PointA, cache.PointB);
}
renderTarget.EndDraw();
new System.Threading.ManualResetEvent(false).WaitOne(5);
}
}
Then in my part of the code where I make the line.
line tracer = (line)canvas.drawLine(new Point(0,0), new Point(900, 900));
for (int i = 0; i < 200; i++)
{
tracer.PointB = new Point(100, 100 + i);
}
When I set a new point it doesn't move and the point is never updated.