public static void OpenAddUserDialog() { /* * Starts a new Add user window on a separate UI thread */ Thread thread = new Thread(() => { AddUser adduser = new AddUser(); adduser.Closed += (sender, e) => { adduser.Dispatcher.InvokeShutdown(); DataStore.handle1.Set(); AddUserRunning = false; }; adduser.Show(); System.Windows.Threading.Dispatcher.Run(); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
public static void StartDataStoreManager() { LoadUserSettings(); if (NoStoredUser) { AddUser.OpenAddUserDialog(); handle1.WaitOne(); } else { SelectUser.OpenUserSelectWindow(); handle1.WaitOne(); } SetUserNow(CurrentUser); IsUserSet = true; Directory.CreateDirectory(voixDir); Directory.CreateDirectory(voixDir + @"\Dump"); Init.waitHandle2.Set(); }
public static void OpenAddUserDialog() { /* Starts a new Add user window on a separate UI thread */ Thread thread = new Thread(() => { AddUser adduser = new AddUser(); adduser.Closed += (sender, e) => { adduser.Dispatcher.InvokeShutdown(); DataStore.handle1.Set(); AddUserRunning = false; }; adduser.Show(); System.Windows.Threading.Dispatcher.Run(); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
private void addUser_Click(object sender, RoutedEventArgs e) { /* UI blocking AddUser Window */ AddUser userTab = new AddUser(); userTab.Show(); }