在回答我的其他问题How to send custom event message just after control instantiation?我这样说的:我不明白事件委托的双重语法
if (ValueChanged != null)
{
ValueChanged(sender, e);
}
是什么的ValueChanged在第一种情况?不是第二条指令中的函数吗?如何将同一个符号用于...和函数?
uPDATE james的答案后:如果ValueChanged是一个对象,我怎么能称它为好像它是一个方法?它是一种语法糖或外来语法,带有一些神秘的机制,如调用ValueChanged.Invoke(sender,e); ?
嘿谢谢爱这个想法从来没有null。 – user310291 2010-12-07 22:51:24