Пример #1
0
 private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
 {
     Result = new AddFileDialogOutput {
         FileName = FilenameBox.Text, Password = PasswordBox.Password
     };
     this.Hide();
 }
Пример #2
0
        private async Task OpenFile(StorageFile file)
        {
            bool isValid = await _fileService.ValidateFileAsync(file);

            if (!isValid)
            {
                MessageDialog dialog = new MessageDialog("The file you tried to open was not formatted correctly. Are you sure it's a two-column comma-delimited file?", "Unable to read file");
                await dialog.ShowAsync();

                return;
            }
            AddFileDialogOutput output = await ShowAddFileDialog(file.Name);

            if (output == null)
            {
                return;
            }
            string contents = await FileIO.ReadTextAsync(file);

            ActiveFile = await _fileService.SaveAndEncryptFileAsync(contents, output.FileName, output.Password);

            ShouldShowPlaceholder = FileGroups.Any(x => x.Files.Any()) ? Visibility.Collapsed : Visibility.Visible;
            _codeDictionary       = await GetCodes(output.Password);
        }