我正在尝试编写一个C#程序。该功能已经实现(但在Java中)。在C中实现Java的Listener#
有没有什么办法可以在像Java一样的方法中实现“DeviceController.OnDeviceControllerListener” - 接口? 我需要像在Java代码示例来实现和定制覆盖的方法(onError的,onRead和onInsert):
deviceController.setOnDeviceControllerListener(new DeviceController.OnDeviceControllerListener() {
@Override
public void onError(ControllerError.Error error, String message) {
}
@Override
public void onRead(MobileServiceList<Device> devices) {
if(devices == null || devices.size() == 0) {
deviceController.insert(context, device);
}
}
@Override
public void onInsert(Device device) {
}
});
我希望你明白我的问题。这很难为我解释。
您可以重写java co的funcionality去C#? – puko 2015-02-23 14:20:58
我已经写了整个其他功能。在我的程序中有一些异步方法,并且在它们的结尾我想返回到这个方法(onError,...) – TableCreek 2015-02-23 14:22:21
使用诸如锐化之类的工具可以为您节省大量时间。 – 2015-02-23 14:29:22