Exemple #1
0
        public IDatabase LoadDatabase(string path)
        {
            using (var stream = _storage.Load(path))
            {
                var database = LoadDatabase(stream, string.Empty);

                if (database != null)
                {
                    return(database);
                }

                do
                {
                    var password = _passwordProvider.GetPassword();
                    database = LoadDatabase(stream, password);

                    if (database != null)
                    {
                        return(database);
                    }
                }while (_passwordProvider.CanProvideNewPassword());

                return(null);
            }
        }