Пример #1
0
        public void LogIn(Native.Credentials credentials, TaskCompletionSource <SyncUserHandle> tcs)
        {
            var tcsHandle = GCHandle.Alloc(tcs);

            NativeMethods.login_user(this, credentials, GCHandle.ToIntPtr(tcsHandle), out var ex);
            ex.ThrowIfNecessary(tcsHandle);
        }
Пример #2
0
        public void LinkCredentials(AppHandle app, Native.Credentials credentials, TaskCompletionSource <SyncUserHandle> tcs)
        {
            var tcsHandle = GCHandle.Alloc(tcs);

            NativeMethods.link_credentials(this, app, credentials, GCHandle.ToIntPtr(tcsHandle), out var ex);
            ex.ThrowIfNecessary(tcsHandle);
        }
Пример #3
0
        public async Task <SyncUserHandle> LogInAsync(Native.Credentials credentials)
        {
            var tcs       = new TaskCompletionSource <SyncUserHandle>();
            var tcsHandle = GCHandle.Alloc(tcs);

            try
            {
                NativeMethods.login_user(this, credentials, GCHandle.ToIntPtr(tcsHandle), out var ex);
                ex.ThrowIfNecessary();

                return(await tcs.Task);
            }
            finally
            {
                tcsHandle.Free();
            }
        }
Пример #4
0
 public static extern void login_user(AppHandle app, Native.Credentials credentials, IntPtr tcs_ptr, out NativeException ex);
Пример #5
0
 public static extern void link_credentials(SyncUserHandle handle, AppHandle app, Native.Credentials credentials, IntPtr tcs_ptr, out NativeException ex);