private void OpenButton_Click(object sender, RoutedEventArgs e) { // Create OpenFileDialog Microsoft.Win32.OpenFileDialog openFileDlg = new Microsoft.Win32.OpenFileDialog(); // Launch OpenFileDialog by calling ShowDialog method Nullable <bool> result = openFileDlg.ShowDialog(); // Get the selected file name and display in a TextBox. // Load content of file in a TextBlock if (result == true) { string fileName = openFileDlg.SafeFileName; string filePath = openFileDlg.FileName; PasswordWindow passWindow = new PasswordWindow(); passWindow.Title = fileName; passWindow.Show(); this.AddRecentFile(fileName, filePath); ///Para Teste visualizar o arquivo como texto TesteBox.Text = System.IO.File.ReadAllText(openFileDlg.FileName); } }
private void ListViewItem_Selected(object sender, RoutedEventArgs e) { RecentFile item = (sender as FrameworkElement).DataContext as RecentFile; //int index = RecentListView.Items.IndexOf(item); string fileName = item.name; string filePath = item.path; PasswordWindow passWindow = new PasswordWindow(); passWindow.Title = fileName; passWindow.Show(); this.AddRecentFile(fileName, filePath); ///Para Teste visualizar o arquivo como texto TesteBox.Text = System.IO.File.ReadAllText(filePath); }
private void NewButton_Click(object sender, RoutedEventArgs e) { PasswordWindow passWindow = new PasswordWindow(); passWindow.Show(); }