public static extern NotificationProxyError np_set_notify_callback(NotificationProxyClientHandle client, NotificationProxyNotifyCallBack notifyCallBack, System.IntPtr userdata);
Esempio n. 2
0
 /// <summary>
 /// This function allows an application to define a callback function that will
 /// be called when a notification has been received.
 /// It will start a thread that polls for notifications and calls the callback
 /// function if a notification has been received.
 /// In case of an error condition when polling for notifications - e.g. device
 /// disconnect - the thread will call the callback function with an empty
 /// notification "" and terminate itself.
 /// </summary>
 /// <param name="client">
 /// the NP client
 /// </param>
 /// <param name="notify_cb">
 /// pointer to a callback function or NULL to de-register a
 /// previously set callback function.
 /// </param>
 /// <param name="user_data">
 /// Pointer that will be passed to the callback function as
 /// user data. If notify_cb is NULL, this parameter is ignored.
 /// </param>
 /// <returns>
 /// NP_E_SUCCESS when the callback was successfully registered,
 /// NP_E_INVALID_ARG when client is NULL, or NP_E_UNKNOWN_ERROR when
 /// the callback thread could no be created.
 /// </returns>
 /// <remarks>
 /// Only one callback function can be registered at the same time;
 /// any previously set callback function will be removed automatically.
 /// </remarks>
 public virtual NotificationProxyError np_set_notify_callback(NotificationProxyClientHandle client, NotificationProxyNotifyCallBack notifyCallBack, System.IntPtr userdata)
 {
     return(NotificationProxyNativeMethods.np_set_notify_callback(client, notifyCallBack, userdata));
 }