public static void RegisterDeviceChangeCallback(yDeviceUpdateFunc callback) { yChange = callback; }
/** * <summary> * Register a callback function, to be called each time * a device is unpluged. * <para> * This callback will be invoked while <c>yUpdateDeviceList</c> * is running. You will have to call this function on a regular basis. * </para> * </summary> * <param name="removalCallback"> * a procedure taking a <c>YModule</c> parameter, or <c>null</c> * to unregister a previously registered callback. * </param> */ public static void RegisterDeviceRemovalCallback(yDeviceUpdateFunc removalCallback) { yRemoval = removalCallback; }
/** * <summary> * Register a callback function, to be called each time * a device is pluged. * <para> * This callback will be invoked while <c>yUpdateDeviceList</c> * is running. You will have to call this function on a regular basis. * </para> * </summary> * <param name="arrivalCallback"> * a procedure taking a <c>YModule</c> parameter, or <c>null</c> * to unregister a previously registered callback. * </param> */ public static void RegisterDeviceArrivalCallback(yDeviceUpdateFunc arrivalCallback) { yArrival = arrivalCallback; if(arrivalCallback != null) { string error = ""; YModule mod = YModule.FirstModule(); while(mod != null){ if (mod.isOnline()) { yapiLockDeviceCallBack(ref error); native_yDeviceArrivalCallback(mod.functionDescriptor()); yapiUnlockDeviceCallBack(ref error); } mod = mod.nextModule(); } } }