更新时间:2022-06-20 21:43:58
是的,你可以实现类似与事件,你可以与部分应用效果。部分方法是真正让code发电机,主要是设计,生成挂钩的非产生code的只是一种方式。活动可以填补这个角色。
Yes, you could achieve a similar effect with events as you can with partial methods. Partial methods are really just a way of letting code generators, primarily designers, to generate hooks for the non-generated code. Events could fill this role.
不过也有优势,部分方法在具体事件
However there are advantages to partial methods over events in particular