internal static void OnFriendsUpdate(IntPtr address) { OnFriendsUpdateCallback callback = null; OnFriendsUpdateInfo callbackInfo = null; if (Helper.TryGetAndRemoveCallback <OnFriendsUpdateCallback, OnFriendsUpdateInfoInternal, OnFriendsUpdateInfo>(address, out callback, out callbackInfo)) { callback(callbackInfo); } }
/// <summary> /// Listen for changes to friends for a particular account. /// </summary> /// <param name="options">Information about who would like notifications.</param> /// <param name="clientData">This value is returned to the caller when FriendsUpdateHandler is invoked.</param> /// <param name="friendsUpdateHandler">The callback to be invoked when a change to any friend status changes.</param> /// <returns> /// A valid notification ID if successfully bound, or <see cref="Common.InvalidNotificationid" /> otherwise /// </returns> public ulong AddNotifyFriendsUpdate(AddNotifyFriendsUpdateOptions options, object clientData, OnFriendsUpdateCallback friendsUpdateHandler) { System.IntPtr optionsAddress = new System.IntPtr(); Helper.TryMarshalSet <AddNotifyFriendsUpdateOptionsInternal, AddNotifyFriendsUpdateOptions>(ref optionsAddress, options); var clientDataAddress = System.IntPtr.Zero; var friendsUpdateHandlerInternal = new OnFriendsUpdateCallbackInternal(OnFriendsUpdateCallbackInternalImplementation); Helper.AddCallback(ref clientDataAddress, clientData, friendsUpdateHandler, friendsUpdateHandlerInternal); var funcResult = EOS_Friends_AddNotifyFriendsUpdate(InnerHandle, optionsAddress, clientDataAddress, friendsUpdateHandlerInternal); Helper.TryMarshalDispose(ref optionsAddress); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); return(funcResult); }
/// <summary> /// Listen for changes to friends for a particular account. /// </summary> /// <param name="options">Information about who would like notifications.</param> /// <param name="clientData">This value is returned to the caller when FriendsUpdateHandler is invoked.</param> /// <param name="friendsUpdateHandler">The callback to be invoked when a change to any friend status changes.</param> /// <returns> /// A valid notification ID if successfully bound, or <see cref="Common.InvalidNotificationid" /> otherwise /// </returns> public ulong AddNotifyFriendsUpdate(AddNotifyFriendsUpdateOptions options, object clientData, OnFriendsUpdateCallback friendsUpdateHandler) { var optionsInternal = Helper.CopyProperties <AddNotifyFriendsUpdateOptionsInternal>(options); var friendsUpdateHandlerInternal = new OnFriendsUpdateCallbackInternal(OnFriendsUpdate); var clientDataAddress = IntPtr.Zero; Helper.AddCallback(ref clientDataAddress, clientData, friendsUpdateHandler, friendsUpdateHandlerInternal); var funcResult = EOS_Friends_AddNotifyFriendsUpdate(InnerHandle, ref optionsInternal, clientDataAddress, friendsUpdateHandlerInternal); Helper.TryMarshalDispose(ref optionsInternal); Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult); var funcResultReturn = Helper.GetDefault <ulong>(); Helper.TryMarshalGet(funcResult, out funcResultReturn); return(funcResultReturn); }