Пример #1
0
        internal static void OnAcceptInvite(IntPtr address)
        {
            OnAcceptInviteCallback   callback     = null;
            AcceptInviteCallbackInfo callbackInfo = null;

            if (Helper.TryGetAndRemoveCallback <OnAcceptInviteCallback, AcceptInviteCallbackInfoInternal, AcceptInviteCallbackInfo>(address, out callback, out callbackInfo))
            {
                callback(callbackInfo);
            }
        }
Пример #2
0
        /// <summary>
        /// Starts an asynchronous task that accepts a friend invitation from another user. The completion delegate is executed after the backend response has been received.
        /// </summary>
        /// <param name="options">structure containing the logged in account and the inviting account</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 AcceptInvite(AcceptInviteOptions options, object clientData, OnAcceptInviteCallback completionDelegate)
        {
            var optionsInternal = Helper.CopyProperties <AcceptInviteOptionsInternal>(options);

            var completionDelegateInternal = new OnAcceptInviteCallbackInternal(OnAcceptInvite);
            var clientDataAddress          = IntPtr.Zero;

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

            EOS_Friends_AcceptInvite(InnerHandle, ref optionsInternal, clientDataAddress, completionDelegateInternal);
            Helper.TryMarshalDispose(ref optionsInternal);
        }
        /// <summary>
        /// Starts an asynchronous task that accepts a friend invitation from another user. The completion delegate is executed after the backend response has been received.
        /// </summary>
        /// <param name="options">structure containing the logged in account and the inviting account</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 AcceptInvite(AcceptInviteOptions options, object clientData, OnAcceptInviteCallback completionDelegate)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <AcceptInviteOptionsInternal, AcceptInviteOptions>(ref optionsAddress, options);

            var clientDataAddress = System.IntPtr.Zero;

            var completionDelegateInternal = new OnAcceptInviteCallbackInternal(OnAcceptInviteCallbackInternalImplementation);

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

            EOS_Friends_AcceptInvite(InnerHandle, optionsAddress, clientDataAddress, completionDelegateInternal);

            Helper.TryMarshalDispose(ref optionsAddress);
        }