public static NotificationProxyError np_observe_notifications(NotificationProxyClientHandle client, out string notificationSpec)
        {
            System.Runtime.InteropServices.ICustomMarshaler notificationSpecMarshaler = NativeStringMarshaler.GetInstance(null);
            System.IntPtr          notificationSpecNative = System.IntPtr.Zero;
            NotificationProxyError returnValue            = NotificationProxyNativeMethods.np_observe_notifications(client, out notificationSpecNative);

            notificationSpec = ((string)notificationSpecMarshaler.MarshalNativeToManaged(notificationSpecNative));
            notificationSpecMarshaler.CleanUpNativeData(notificationSpecNative);
            return(returnValue);
        }
Esempio n. 2
0
 /// <summary>
 /// Tells the device to send a notification on specified events.
 /// </summary>
 /// <param name="client">
 /// The client to send to
 /// </param>
 /// <param name="notification_spec">
 /// Specification of the notifications that should be
 /// observed. This is expected to be an array of const char* that MUST have a
 /// terminating NULL entry.
 /// </param>
 /// <returns>
 /// NP_E_SUCCESS on success, NP_E_INVALID_ARG when client is null,
 /// or an error returned by np_observe_notification.
 /// </returns>
 public virtual NotificationProxyError np_observe_notifications(NotificationProxyClientHandle client, out string notificationSpec)
 {
     return(NotificationProxyNativeMethods.np_observe_notifications(client, out notificationSpec));
 }