コード例 #1
0
        public void RefreshProfileContextMenuItems()
        {
            var _userAccountsFetch = new Task(() =>
            {
                Win10AuthenticationManager.GetWUUsers();
            });

            Task.Run(async() =>
            {
                _userAccountsFetch.Start();
                await _userAccountsFetch;
                await Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new Action(() =>
                {
                    AccountsList.ItemsSource = null;
                    AccountsList.ItemsSource = Win10AuthenticationManager.CurrentAccounts;

                    if (Win10AuthenticationManager.CurrentAccounts.Count < Properties.LauncherSettings.Default.CurrentInsiderAccount)
                    {
                        AccountsList.SelectedIndex = 0;
                    }
                    else
                    {
                        AccountsList.SelectedIndex = Properties.LauncherSettings.Default.CurrentInsiderAccount;
                    }
                }));
            });
        }
コード例 #2
0
 private int SetMSAUserToken()
 {
     try
     {
         _store_manager.setMSAUserToken(Win10AuthenticationManager.GetWUToken(Properties.LauncherSettings.Default.CurrentInsiderAccount));
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine("Error while Authenticating UserToken for Version Fetching:\n" + ex);
     }
     return(1);
 }
コード例 #3
0
 public void EnableUserAuthorization()
 {
     _store_manager.setMSAUserToken(Win10AuthenticationManager.GetWUToken(Properties.LauncherSettings.Default.CurrentInsiderAccount));
 }