110,546
社区成员
发帖
与我相关
我的任务
分享
private void btnAdd_Click(object sender, EventArgs e)
{
int Index=1;
double x, y;
if(_Insertting != null)
OnInsertPoint(Index, x, y);
}
private void OnInsertPoint(int index, double x, double y)
{
FlightPoint point = new FlightPoint();
point.X = x;
point.Y = y;
FlightPointCollectionEventArgs e = new FlightPointCollectionEventArgs(index, point, null);
if(_Insertting ! = null)
_Insertting(this, e);
}
public event FlightPointCollectionEventHandler Insertting
{
add
{
_Insertting = (FlightPointCollectionEventHandler)Delegate.Combine(_Insertting, value);
}
remove
{
_Insertting = (FlightPointCollectionEventHandler)Delegate.Remove(_Insertting, value);
}
private void btnAdd_Click(object sender, EventArgs e)
{
int Index=1;
double x, y;
OnInsertPoint(Index, x, y); //这里没有对变量xy赋值啊,肯定出错了
}