我正在嘗試編寫一個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