/// <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);
        }
Пример #2
0
        /// <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);
        }
 internal static extern ulong EOS_Friends_AddNotifyFriendsUpdate(System.IntPtr handle, System.IntPtr options, System.IntPtr clientData, OnFriendsUpdateCallbackInternal friendsUpdateHandler);
Пример #4
0
 private static extern ulong EOS_Friends_AddNotifyFriendsUpdate(IntPtr handle, ref AddNotifyFriendsUpdateOptionsInternal options, IntPtr clientData, OnFriendsUpdateCallbackInternal friendsUpdateHandler);