private void Container_Change_Password_Click(object sender, RoutedEventArgs e) { if (Settings.ContainerOpen) { ContainerSetPassword containerSetPassword = new ContainerSetPassword(); containerSetPassword.Owner = this; // for centering in parent window containerSetPassword.ShowDialog(); if (containerSetPassword.PasswordSet) { string password = containerSetPassword.PasswordText; (Settings.ContainerOuter, Settings.ContainerKey) = ContainerUtilities.CreateOuterContainer(password); Settings.ContainerSaved = false; UpdateContainerText(); MessageBox.Show("Password Changed", "Information", MessageBoxButton.OK, MessageBoxImage.Information); } } else { MessageBox.Show("No container open", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void Container_New_Click(object sender, RoutedEventArgs e) { if (Settings.ContainerOpen) { MessageBox.Show("A container is already open", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } ContainerSetPassword containerSetPassword = new ContainerSetPassword(); containerSetPassword.Owner = this; // for centering in parent window containerSetPassword.ShowDialog(); if (containerSetPassword.PasswordSet) { string password = containerSetPassword.PasswordText; Settings.ContainerOpen = true; Settings.ContainerSaved = false; Settings.ContainerPath = string.Empty; (Settings.ContainerOuter, Settings.ContainerKey) = ContainerUtilities.CreateOuterContainer(password); Settings.ContainerInner = ContainerUtilities.CreateInnerContainer(); UpdateContainerText(); } }