/// <summary>
        /// Register to receive login status updates.
        /// @note must call RemoveNotifyLoginStatusChanged to remove the notification
        /// </summary>
        /// <param name="options">structure containing the api version of AddNotifyLoginStatusChanged to use</param>
        /// <param name="clientData">arbitrary data that is passed back to you in the callback</param>
        /// <param name="notification">a callback that is fired when the login status for a user changes</param>
        /// <returns>
        /// handle representing the registered callback
        /// </returns>
        public ulong AddNotifyLoginStatusChanged(AddNotifyLoginStatusChangedOptions options, object clientData, OnLoginStatusChangedCallback notification)
        {
            System.IntPtr optionsAddress = new System.IntPtr();
            Helper.TryMarshalSet <AddNotifyLoginStatusChangedOptionsInternal, AddNotifyLoginStatusChangedOptions>(ref optionsAddress, options);

            var clientDataAddress = System.IntPtr.Zero;

            var notificationInternal = new OnLoginStatusChangedCallbackInternal(OnLoginStatusChangedCallbackInternalImplementation);

            Helper.AddCallback(ref clientDataAddress, clientData, notification, notificationInternal);

            var funcResult = EOS_Auth_AddNotifyLoginStatusChanged(InnerHandle, optionsAddress, clientDataAddress, notificationInternal);

            Helper.TryMarshalDispose(ref optionsAddress);

            Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult);

            return(funcResult);
        }
Exemple #2
0
        /// <summary>
        /// Register to receive user login status updates.
        /// @note must call RemoveNotifyLoginStatusChanged to remove the notification
        /// </summary>
        /// <param name="options">structure containing the API version of the callback to use</param>
        /// <param name="clientData">arbitrary data that is passed back to you in the callback</param>
        /// <param name="notification">a callback that is fired when the login status for a user changes</param>
        /// <returns>
        /// handle representing the registered callback
        /// </returns>
        public ulong AddNotifyLoginStatusChanged(AddNotifyLoginStatusChangedOptions options, object clientData, OnLoginStatusChangedCallback notification)
        {
            var optionsInternal = Helper.CopyProperties <AddNotifyLoginStatusChangedOptionsInternal>(options);

            var notificationInternal = new OnLoginStatusChangedCallbackInternal(OnLoginStatusChanged);
            var clientDataAddress    = IntPtr.Zero;

            Helper.AddCallback(ref clientDataAddress, clientData, notification, notificationInternal);

            var funcResult = EOS_Connect_AddNotifyLoginStatusChanged(InnerHandle, ref optionsInternal, clientDataAddress, notificationInternal);

            Helper.TryMarshalDispose(ref optionsInternal);

            Helper.TryAssignNotificationIdToCallback(clientDataAddress, funcResult);

            var funcResultReturn = Helper.GetDefault <ulong>();

            Helper.TryMarshalGet(funcResult, out funcResultReturn);
            return(funcResultReturn);
        }
Exemple #3
0
 private static extern ulong EOS_Connect_AddNotifyLoginStatusChanged(IntPtr handle, ref AddNotifyLoginStatusChangedOptionsInternal options, IntPtr clientData, OnLoginStatusChangedCallbackInternal notification);
 internal static extern ulong EOS_Auth_AddNotifyLoginStatusChanged(System.IntPtr handle, System.IntPtr options, System.IntPtr clientData, OnLoginStatusChangedCallbackInternal notification);