public async Task UpdateDatabaseCredentials(CredentialsSetMessage message) { await _mediator.Send(new UpdateCredentialsCommand { KeyFilePath = message.KeyFilePath, Password = message.Password }); var database = await _mediator.Send(new GetDatabaseQuery()); _notification.Show(database.Name, _resource.GetResourceValue("CompositeKeyUpdated")); }
private async Task TryCreateDatabase(CredentialsSetMessage message) { var database = await _mediator.Send(new GetDatabaseQuery()); if (database.IsDirty) { MessengerInstance.Register <DatabaseClosedMessage>(this, async m => await CreateDatabase(m.Parameter as CredentialsSetMessage)); MessengerInstance.Send(new DatabaseAlreadyOpenedMessage { Parameter = message }); } else { await CreateDatabase(message); } }
private async Task CreateDatabase(CredentialsSetMessage message) { await _mediator.Send(new CreateDatabaseCommand { FilePath = Token, KeyFilePath = message.KeyFilePath, Password = message.Password, Name = "ModernKeePass", Version = _settings.GetSetting(Constants.Settings.DefaultFileFormat, "4"), CreateSampleData = _settings.GetSetting(Constants.Settings.Sample, true) }); var database = await _mediator.Send(new GetDatabaseQuery()); _navigation.NavigateTo(Constants.Navigation.GroupPage, new NavigationItem { Id = database.RootGroupId }); }