Beispiel #1
0
        private void PopTheTopOfListBox()
        {
            //if (FileListBox.SelectedItems.Count > -1)
            //{
            if (FileListBox.SelectedItem != null)
            {
                FileListBox.Items.Remove(FileListBox.SelectedItem);
            }

            FileListBox.Focus();
            //}
        }
Beispiel #2
0
 /// <summary>
 /// ファイル全選択解除ボタン押下時
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnClickAllUnSelect(object sender, RoutedEventArgs e)
 {
     FileListBox.SelectedItems.Clear();
     FileListBox.Focus();
 }
Beispiel #3
0
 /// <summary>
 /// ファイル全選択ボタン押下時
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnClickAllSelect(object sender, RoutedEventArgs e)
 {
     FileListBox.SelectAll();
     FileListBox.Focus();
 }
Beispiel #4
0
        public CodeSearchControl()
        {
            InitializeComponent();
            // Add the "VsColors" brushes to the WPF resources of the control, so that the
            // resource keys used on the XAML file can be resolved dynamically.
            Resources.MergedDictionaries.Add(VsResources.BuildResourceDictionary());
            DataContext = new CodeSearchViewModel();

            _progressBarTracker = new ProgressBarTracker(ProgressBar);

            InitComboBox(SearchCodeCombo, new ComboBoxInfo {
                TextChanged    = text => { ViewModel.SearchCodeValue = text; },
                SearchFunction = RefreshSearchResults,
                NextElement    = SearchFilePathsCombo,
            });
            InitComboBox(SearchFilePathsCombo, new ComboBoxInfo {
                TextChanged     = text => { ViewModel.SearchFilePathsValue = text; },
                SearchFunction  = RefreshSearchResults,
                PreviousElement = SearchCodeCombo,
                InitialItems    =
                {
                    "*",
                    "*.c;*.cpp;*.cxx;*.cc;*.tli;*.tlh;*.h;*.hh;*.hpp;*.hxx;*.hh;*.inl;*.rc;*.resx;*.idl;*.asm;*.inc",
                    "*.htm;*.html;*.xml;*.gif;*.jpg;*.png;*.css;*.disco;*.js;*.srf",
                    "*.xml;*.xsl;*.xslt;*.xsd;*.dtd",
                    "*.txt",
                    "*.cs;*.resx;*.resw;*.xsd;*.wsdl;*.xaml;*.xml;*.htm;*.html;*.css",
                    "*.vb;*.resx;*.resw;*.xsd;*.wsdl;*.xaml;*.xml;*.htm;*.html;*.css",
                    "*.*",
                }
            });

            // Setup custom NextElement logic to account for swapping tree/list views
            SearchFilePathsCombo.PrePreviewKeyDown += (s, e) => {
                if (e.KeyboardDevice.Modifiers == ModifierKeys.None && e.Key == Key.Down)
                {
                    if (!SearchFilePathsCombo.IsDropDownOpen)
                    {
                        if (ViewModel.FlattenSearchResults)
                        {
                            FileListBox.Focus();

                            if (FileListBox.SelectedItem == null)
                            {
                                FileListBox.SelectedIndex = 0;
                            }

                            var listBoxItem = (ListBoxItem)FileListBox.ItemContainerGenerator.ContainerFromItem(FileListBox.SelectedItem);
                            if (listBoxItem != null)
                            {
                                listBoxItem.Focus();
                            }
                        }
                        else
                        {
                            FileTreeView.Focus();
                        }
                        e.Handled = true;
                    }
                }
            };
        }