/********************************************************************************************************** * void uxNewApplicationButton_Click(...) * Purpose: Creates a new application when the button is clicked. * * Parameters: * Standard click event parameters. **********************************************************************************************************/ private void uxNewApplicationButton_Click(object sender, RoutedEventArgs e) { ApplicationCreationWindow newAppWindow = new ApplicationCreationWindow(); newAppWindow.CreateApplicationEvent += CreateApplicationEventListener; newAppWindow.Show(); }
/********************************************************************************************************** * void CreateApplicationEventListener(ApplicationCreationWindow CreatingWindow) * Purpose: Event listener to be fired when an application is to be created. Processes the values * from the creating window and creates a new application from it. * * Parameters: * ApplicationCreationWindow CreatingWindow * The window that issued the creation event. **********************************************************************************************************/ private void CreateApplicationEventListener(ApplicationCreationWindow CreatingWindow) { ApplicationEntry newApplication = new ApplicationEntry(CreatingWindow.ApplicationName, CreatingWindow.PasswordLength, Convert.ToByte(CreatingWindow.Seed % 255), CreatingWindow.LowerCaseAllowed, CreatingWindow.UpperCaseAllowed, CreatingWindow.NumbersAllowed, CreatingWindow.SpecialCharactersAllowed); Data.Applications.Add(newApplication); ApplicationEntryDisplay newApplicationDisplay = new ApplicationEntryDisplay(MasterPassword, newApplication); newApplicationDisplay.DeleteApplicationEvent += DeleteApplicationEventListener; uxApplicationEntryContainer.Children.Add(newApplicationDisplay); }