Exemplo n.º 1
0
        internal static void OnSendInvite(IntPtr address)
        {
            OnSendInviteCallback   callback     = null;
            SendInviteCallbackInfo callbackInfo = null;

            if (Helper.TryGetAndRemoveCallback <OnSendInviteCallback, SendInviteCallbackInfoInternal, SendInviteCallbackInfo>(address, out callback, out callbackInfo))
            {
                callback(callbackInfo);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Starts an asynchronous task that sends a friend invitation to another user. The completion delegate is executed after the backend response has been received.
        /// It does not indicate that the target user has responded to the friend invitation.
        /// </summary>
        /// <param name="options">structure containing the account to send the invite from and the account to send the invite to</param>
        /// <param name="clientData">arbitrary data that is passed back to you in the CompletionDelegate</param>
        /// <param name="completionDelegate">a callback that is fired when the async operation completes, either successfully or in error</param>
        public void SendInvite(SendInviteOptions options, object clientData, OnSendInviteCallback completionDelegate)
        {
            var optionsInternal = Helper.CopyProperties <SendInviteOptionsInternal>(options);

            var completionDelegateInternal = new OnSendInviteCallbackInternal(OnSendInvite);
            var clientDataAddress          = IntPtr.Zero;

            Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal);

            EOS_Friends_SendInvite(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
            Helper.TryMarshalDispose(ref optionsInternal);
        }
        /// <summary>
        /// Starts an asynchronous task that sends a friend invitation to another user. The completion delegate is executed after the backend response has been received.
        /// It does not indicate that the target user has responded to the friend invitation.
        /// </summary>
        /// <param name="options">structure containing the account to send the invite from and the account to send the invite to</param>
        /// <param name="clientData">arbitrary data that is passed back to you in the CompletionDelegate</param>
        /// <param name="completionDelegate">a callback that is fired when the async operation completes, either successfully or in error</param>
        public void SendInvite(SendInviteOptions options, object clientData, OnSendInviteCallback completionDelegate)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <SendInviteOptionsInternal, SendInviteOptions>(ref optionsAddress, options);

            var clientDataAddress = System.IntPtr.Zero;

            var completionDelegateInternal = new OnSendInviteCallbackInternal(OnSendInviteCallbackInternalImplementation);

            Helper.AddCallback(ref clientDataAddress, clientData, completionDelegate, completionDelegateInternal);

            EOS_Friends_SendInvite(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal);

            Helper.TryMarshalDispose(ref optionsAddress);
        }