public void ExecuteOpenSearchResult(object sender, ExecutedRoutedEventArgs e)
{
// Get parameter (e.Parameter as T)
// Try shell execute...
// TODO: Determine which app to start the file as and boom!
var searchObj = (VistaSearchProvider.SearchResult)e.Parameter;
Process p = new Process();
p.StartInfo.UseShellExecute = true;
p.StartInfo.FileName = searchObj.Path; // e.Parameter as T.x
p.StartInfo.Verb = "Open";
try
{
p.Start();
}
catch (Exception ex)
{
CairoMessage.Show("Woops, it seems we had some trouble opening the search result you chose.\n\n The error we received was: " + ex.Message, "Uh Oh!", MessageBoxButton.OK, MessageBoxImage.Error);
}
}