コード例 #1
0
 private void OnRightKeyDown(DirectoryListingPane pane)
 {
     if (pane.SelectedItem is FileViewModel)
     {
         // If a file is selected in this pane, try to move down (which should change the deeper panes)
         // and focus on the newly selected item
         if (pane.SelectedIndex < pane.Items.Count - 1)
         {
             pane.SelectItemAndFocus(pane.SelectedIndex + 1);
         }
     }
     else if (pane.SelectedItem is DirectoryViewModel)
     {
         // Go into the next pane, which is guaranteed to be open
         // bc the selected file system item in this pane is itself a directory
         var nextPane = (DirectoryListingPane)_panes[_panes.IndexOf(pane) + 1];
         if (nextPane.Items.Count > 0)
         {
             nextPane.SelectItemAndFocus(0);
         }
     }
     else if (pane.SelectedItem == null)
     {
         // If nothing is selected, then select the first item
         pane.SelectItemAndFocus(0);
     }
 }
コード例 #2
0
        private bool OnDownKeyDown(DirectoryListingPane pane)
        {
            if (pane.SelectedItem == null)
            {
                // If nothing is selected, then select the first item
                pane.SelectItemAndFocus(0);
                return(true);
            }

            return(false);
        }