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; } })); }); }
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); }
public void EnableUserAuthorization() { _store_manager.setMSAUserToken(Win10AuthenticationManager.GetWUToken(Properties.LauncherSettings.Default.CurrentInsiderAccount)); }