コード例 #1
0
        private void Button_Forget_Click(object sender, RoutedEventArgs e)
        {
            PassportDelete();

            UserSelect.accountList.Remove(activeAccount);
            AccountsHelper.SaveAccountList(UserSelect.accountList);
        }
コード例 #2
0
ファイル: UserSelect.xaml.cs プロジェクト: ice0/test
        /// <summary>
        /// Uses the AccountsHelper to load the list of accounts from a saved local app file,
        /// then checks to see if it was empty or not. If it is empty then just go to the sign in form.
        /// </summary>
        private async void SetUpAccounts()
        {
            accountList = await AccountsHelper.LoadAccountList();

            accountListView.ItemsSource = accountList;

            if (accountList.Count == 0)
            {
                this.Frame.Navigate(typeof(SignIn));
            }
        }
コード例 #3
0
ファイル: Content.xaml.cs プロジェクト: ice0/test
        private void Button_Forget_Click(object sender, RoutedEventArgs e)
        {
            if (activeAccount.UsesPassport == true)
            {
                PassportDelete();
            }

            UserSelect.accountList.Remove(activeAccount);
            AccountsHelper.SaveAccountList(UserSelect.accountList);

            rootPage.NotifyUser("User " + activeAccount.Email + " deleted.", NotifyType.StatusMessage);
            button_Forget.IsEnabled = false;
            button_Forget.Content   = "User Forgotten.";
        }
コード例 #4
0
ファイル: AccountsHelper.cs プロジェクト: HiepMa/go-sample
        /// <summary>
        /// Gets the account list file and deserializes it from XML to a list of accounts object.
        /// </summary>
        /// <returns>List of account objects</returns>
        static public async Task <List <Account> > LoadAccountList()
        {
            try
            {
                StorageFile accountsFile = await ApplicationData.Current.LocalFolder.GetFileAsync(USER_LIST_FILE_NAME);

                string accountsXml = await Windows.Storage.FileIO.ReadTextAsync(accountsFile);

                return(AccountsHelper.DeserializeXmlToAccountList(accountsXml));
            }
            catch (FileNotFoundException e)
            {
                List <Account> emptyAccountList = new List <Account>();
                return(emptyAccountList);
            }
        }
コード例 #5
0
ファイル: SignIn.xaml.cs プロジェクト: ice0/test
 /// <summary>
 /// Uses the AccountsHelper class to save the account list before we move on from
 /// the sign in process
 /// </summary>
 private void CleanUpUserList()
 {
     AccountsHelper.SaveAccountList(UserSelect.accountList);
 }