jjzjj

updateErrorIcons

全部标签

c# - 编写事件的简短方法?

通常我们使用此代码:privateEventHandler_updateErrorIcons;publiceventEventHandlerUpdateErrorIcons{add{_updateErrorIcons+=value;}remove{_updateErrorIcons-=value;}}是否有类似自动属性的快捷方式?像这样的东西:publiceventEventHandlerUpdateErrorIcons{add;remove;} 最佳答案 是的。去掉{添加;去掉;}部分和支持委托(delegate)字段,你就成功了