public void Set(AddNotifyOnPresenceChangedOptions other) { if (other != null) { m_ApiVersion = PresenceInterface.AddnotifyonpresencechangedApiLatest; } }
/// <summary> /// Register to receive notifications when presence changes. If the returned NotificationId is valid, you must call RemoveNotifyOnPresenceChanged when you no longer wish to /// have your NotificationHandler called /// <seealso cref="Common.InvalidNotificationid" /> /// <seealso cref="RemoveNotifyOnPresenceChanged" /> /// </summary> /// <param name="clientData">Data the is returned to when NotificationHandler is invoked</param> /// <param name="notificationHandler">The callback to be fired when a presence change occurs</param> /// <returns> /// Notification ID representing the registered callback if successful, an invalid NotificationId if not /// </returns> public ulong AddNotifyOnPresenceChanged(AddNotifyOnPresenceChangedOptions options, object clientData, OnPresenceChangedCallback notificationHandler) { System.IntPtr optionsAddress = new System.IntPtr(); Helper.TryMarshalSet <AddNotifyOnPresenceChangedOptionsInternal, AddNotifyOnPresenceChangedOptions>(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var notificationHandlerInternal = new OnPresenceChangedCallbackInternal(OnPresenceChangedCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, notificationHandler, notificationHandlerInternal); var funcResult = EOS_Presence_AddNotifyOnPresenceChanged(InnerHandle, optionsAddress, clientDataAddress, notificationHandlerInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return(funcResult); }