Example #1
0
        /// <summary>
        /// Sets the <see cref="SubscriberListener" />.
        /// </summary>
        /// <param name="listener">The <see cref="SubscriberListener" /> to be set.</param>
        /// <param name="mask">The <see cref="StatusMask" /> of which status changes the listener should be notified.</param>
        /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
        public ReturnCode SetListener(SubscriberListener listener, StatusMask mask)
        {
            Listener = listener;
            IntPtr ptr = IntPtr.Zero;

            if (listener != null)
            {
                ptr = listener.ToNative();
            }

            return(UnsafeNativeMethods.SetListener(_native, ptr, mask));
        }
Example #2
0
 /// <summary>
 /// Sets the <see cref="SubscriberListener" /> using the <see cref="StatusMask.DefaultStatusMask" />.
 /// </summary>
 /// <param name="listener">The <see cref="SubscriberListener" /> to be set.</param>
 /// <returns>The <see cref="ReturnCode" /> that indicates the operation result.</returns>
 public ReturnCode SetListener(SubscriberListener listener)
 {
     return(SetListener(listener, StatusMask.DefaultStatusMask));
 }