コード例 #1
0
        private async void Continue_Tapped(object sender, TappedRoutedEventArgs e)
        {
            try
            {
                MainPage.ShowLoader(ResourceLoader.GetForCurrentView().GetString("SynchronizingAccountsWithCloud"));

                IOneDriveClient oneDriveClient = OneDriveClientExtensions.GetUniversalClient(new[] { "onedrive.appfolder" });
                AccountSession  session        = await oneDriveClient.AuthenticateAsync();

                IEncrypter encrypter = new AESEncrypter();

                if (session.AccountType == AccountType.MicrosoftAccount)
                {
                    synchronizer.SetEncrypter(encrypter, userKey);
                    await AccountStorage.Instance.Synchronize();

                    MainPage.HideLoader();

                    Frame.Navigate(typeof(SetupSynchronizationFinishedPage), mainPage);
                }
            }
            catch (OneDriveException ex)
            {
                MessageDialog dialog = GetOneDriveErrorMessageDialog(ex);
                await dialog.ShowAsync();
            }
        }