有段代码看不明白。大侠帮忙看看
我在单击btnAdd的时候,出现了错误。提示说_Insertting为空。为什么会这样能?
要怎么改这段代码?
private void btnAdd_Click(object sender, EventArgs e)
{
int Index=1;
double x, y;
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);
_Insertting(this, e);
}
private FlightPointCollectionEventHandler _Insertting;
public event FlightPointCollectionEventHandler Insertting
{
add
{
_Insertting = (FlightPointCollectionEventHandler)Delegate.Combine(_Insertting, value);
}
remove
{
_Insertting = (FlightPointCollectionEventHandler)Delegate.Remove(_Insertting, value);
}
}
public delegate void FlightPointCollectionEventHandler(object sender,
FlightPointCollectionEventArgs e);
要怎么改这段代码?
private void btnAdd_Click(object sender, EventArgs e)
{
int Index=1;
double x, y;
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);
_Insertting(this, e);
}
private FlightPointCollectionEventHandler _Insertting;
public event FlightPointCollectionEventHandler Insertting
{
add
{
_Insertting = (FlightPointCollectionEventHandler)Delegate.Combine(_Insertting, value);
}
remove
{
_Insertting = (FlightPointCollectionEventHandler)Delegate.Remove(_Insertting, value);
}
}
public delegate void FlightPointCollectionEventHandler(object sender,
FlightPointCollectionEventArgs e);
...全文
相关推荐
英语学习 提高英语归功于 不能不能明白你们能不明白呢
学习能不不能不能明白你们部门呢你们不能不能明白你们不能明白你们不能不买你们能不能明
Java中不太明白的小知识(五)–泛型
啥是泛型 泛型,就是泛指的数据类型,当代码中的功能代码可以复用,但是数据类型设置单一,如果需要更换数据类型,就必须重新完成一个对应数据类型但是功能完全一样的代码,工作是重复的。假如有一个工厂生产商品,让该工厂生产某个型号的商品,不可能让该工厂而拆了重组才能生产对应的型号。Java中的泛型,就是来解决数据类型的对应问题。 格式 比如: :type :element :key :value 泛型的使用 泛型可以在方法中使用 泛型可以在类中使用 泛型可以在接口中使用 1.泛型在类中使用 格式: class 类名{ 在类内的成员变量和成员方法都可以使用自定义泛型 建议:成员变量不建议使用自定
那些年你没学明白的数学 攻读研究生必知必会的数学
《那些年你没学明白的数学 攻读研究生必知必会的数学》(美)托马斯.A.加里蒂(Thomas A.Garrity)著;赵文 李娜 房永强 译,2016
TestProject:我不明白
测试项目 每个 Git 项目都必须有一个自述文件。
不是我不明白,这世界变化快 CPU让我跟上你的速度.pdf
不是我不明白,这世界变化快 CPU让我跟上你的速度.pdf


