C#中的委托和事件 ... heater.Boiled += (new Alarm()).MakeAlert;//给匿名对象注册方法 heater.Boiled += new Heater.BoiledEventHandler(alarm.MakeAlert);//也可以这么注册 heater.Boiled += Display.ShowMsg;//注册静态方法 ...
基于12个网页-相关网页
通过允许特定类型的特定factory方法和类的静态注册,可以克服这个问题。
This problem could be overcome by allowing static registration of specific factory methods and classes for specific types.
然而,在我们使用ofy之前,我们需要在一个静态的初始化方法中注册持久化类,如清单2的Photo。
Before we can use ofy, however, we need to register persistent classes in a static initializer like Photo in Listing 2.
应用推荐