コード例 #1
0
        /**********************************************************************************************************
        *	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);
        }
コード例 #2
0
        /**********************************************************************************************************
        *	PasswordViewer(string MasterPassword), UserData Data)
        *       Purpose:	Constructs the display object from an existing set of data.
        *
        *       Parameters:
        *			string MasterPassword
        *				The master password to use for all hashed passwords.
        *			UserData Data
        *				The location to store data in. The existing data to load.
        **********************************************************************************************************/
        public PasswordViewerPage(string MasterPassword, UserData Data)
        {
            InitializeComponent();

            this.MasterPassword = MasterPassword;

            this.Data = Data;

            foreach (ApplicationEntry application in this.Data.Applications)
            {
                ApplicationEntryDisplay newApplicationDisplay = new ApplicationEntryDisplay(this.MasterPassword, application);
                newApplicationDisplay.DeleteApplicationEvent += DeleteApplicationEventListener;

                uxApplicationEntryContainer.Children.Add(newApplicationDisplay);
            }
        }