class Plane
{
public event EventHandler Land;
protected void OnLand()
{
if (null != Land)
{
Land(this, null);
}
}
}
它是事件处理程序做,而不是最好的做法:事件处理程序在C#语言
EventHandler temp = Land;
if (null != temp)
{
temp(this, null);
}
那是真的有必要吗?在什么情况下,土地的温度可能会不同?
我看不到您订阅活动的位置。如果您要尝试更新用户界面,您可能还需要检查是否需要调用。 –