/// <summary>
        /// Initialize new instance of the upgrade providing fresh not initialized persistence and password prompt.
        /// </summary>
        /// <param name="persistence">Not null,not authenticated, not initialized persistence</param>
        /// <param name="knowsUserPassword">Not null password prompt to obtain current master password from user</param>
        internal FilesV2ContentUpgrade(IPersistence persistence, Func<bool, AuthenticationPrompt> knowsUserPassword)
        {
            this.persistence = persistence;

            // prevents ask for password two times
            this.passwordsUpdate = new PasswordsV2Update(retry =>
                {
                    this.prompt = knowsUserPassword(retry);
                    return this.prompt;
                });
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize new instance of the upgrade providing fresh not initialized persistence and password prompt.
        /// </summary>
        /// <param name="persistence">Not null,not authenticated, not initialized persistence</param>
        /// <param name="knowsUserPassword">Not null password prompt to obtain current master password from user</param>
        internal FilesV2ContentUpgrade(IPersistence persistence, ConnectionManager connectionManager, Func <bool, AuthenticationPrompt> knowsUserPassword)
        {
            this.persistence       = persistence;
            this.connectionManager = connectionManager;

            // prevents ask for password two times
            this.passwordsUpdate = new PasswordsV2Update(retry =>
            {
                this.prompt = knowsUserPassword(retry);
                return(this.prompt);
            });
        }