在按钮 8 点击事件中我做了:
private void button8_Click(object sender, EventArgs e)
{
if (buttonLockMode == true)
{
trackBar1.Enabled = true;
button8.ForeColor = Color.Red;
button8.Enabled = false;
textBox1.Text = "Frame Number : " + trackBar1.Value;
this.trackBar1.Select();
textBox3.Enabled = true;
textBox4.Enabled = true;
wireObjectAnimation1 = new WireObjectAnimation(this, wireObject1);
int currentFrameIndexRight = trackBar1.Value;
wireObjectCoordinates1 = new WireObjectCoordinates() { FrameNumber = currentFrameIndexRight };
WireObjectCoordinatesCloneFrame();
List<WireObjectCoordinates> temp = wireObjectAnimation1.CoordinatesList;
temp.Add(wireObjectCoordinates1);
//wireObjectAnimation1.CoordinatesList.Add(wireObjectCoordinates1);
//WireObjectCoordinatesCloneFrame();
}
else
{
button8.ForeColor = Color.Black;
}
}
Phoog 我使用了与临时列表相同的想法。在wireObjectanimation中我做了:
private List<WireObjectCoordinates> _coordinateslist = new List<WireObjectCoordinates>();
public List<WireObjectCoordinates> CoordinatesList
{
get { return _coordinateslist; }
}
而且当我在获取行上放置断点时,_coordinateslist 和 CoordinatesList 都是空的。