internal static void OnLoginStatusChanged(IntPtr address) { OnLoginStatusChangedCallback callback = null; LoginStatusChangedCallbackInfo callbackInfo = null; if (Helper.TryGetAndRemoveCallback <OnLoginStatusChangedCallback, LoginStatusChangedCallbackInfoInternal, LoginStatusChangedCallbackInfo>(address, out callback, out callbackInfo)) { callback(callbackInfo); } }
/// <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); }
/// <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); }