コード例 #1
0
 private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         string fullPath        = ((Grid)((TextBlock)sender).Parent).ToolTip.ToString();
         var    openFileManager = OpenFileManager.GetInstance();
         if (Directory.Exists(fullPath))
         {
             openFileManager.OpenFileInExplorer(fullPath);
         }
         else
         {
             openFileManager.OpenFileInVisualStudio(fullPath);
         }
     }
 }
コード例 #2
0
        private void OpenInDefaultProgram_Click(object sender, RoutedEventArgs e)
        {
            MenuItem menuItem = sender as MenuItem;

            if (menuItem == null)
            {
                return;
            }
            ContextMenu parentContextMenu = menuItem.CommandParameter as ContextMenu;
            var         grid = parentContextMenu?.PlacementTarget as Grid;

            if (grid == null)
            {
                return;
            }
            string fullPath = grid.ToolTip.ToString();

            OpenFileManager.GetInstance().OpenInDefaultProgram(fullPath);
        }