private void ShowFileProperties() { // get the unique set of files from the selections List <string> files = new List <string>(); foreach (var item in inputData.SelectedItems) { var fileNode = item as FormattedGrepResult; if (fileNode != null) { string name = fileNode.GrepResult.FileNameReal; if (!files.Contains(name) && File.Exists(name)) { files.Add(name); } } var lineNode = item as FormattedGrepLine; if (lineNode != null) { string name = lineNode.Parent.GrepResult.FileNameReal; if (!files.Contains(name) && File.Exists(name)) { files.Add(name); } } } foreach (var fileName in files) { ShellIntegration.ShowFileProperties(fileName); } }
private void btnShowFileProperties_Click(object sender, RoutedEventArgs e) { string fileName = ""; if (tvSearchResult.SelectedItem is FormattedGrepLine) { FormattedGrepLine selectedNode = (FormattedGrepLine)tvSearchResult.SelectedItem; fileName = selectedNode.Parent.GrepResult.FileNameReal; } else if (tvSearchResult.SelectedItem is FormattedGrepResult) { FormattedGrepResult selectedNode = (FormattedGrepResult)tvSearchResult.SelectedItem; fileName = selectedNode.GrepResult.FileNameReal; } if (fileName != "" && File.Exists(fileName)) { ShellIntegration.ShowFileProperties(fileName); } }