コード例 #1
0
 public void CheckSelectAllOrSelectPos(int pos)
 {
     if (FileListBox.Items.Count > pos)
     {
         if (SelectAllCheckBox.IsChecked ?? false)
         {
             FileListBox.SelectAll();
         }
         else
         {
             FileListBox.UnselectAll();
             FileListBox.SelectedIndex = pos;
         }
     }
 }
コード例 #2
0
ファイル: MainControl.xaml.cs プロジェクト: dengfan/LMFinder
        private void SelectAllButton_Click(object sender, RoutedEventArgs e)
        {
            if (FileListBox.Items.Count == 0)
            {
                return;
            }

            if (FileListBox.SelectedItems.Count == 0)
            {
                FileListBox.SelectAll();
            }
            else
            {
                FileListBox.UnselectAll();
            }
        }
コード例 #3
0
 /// <summary>
 /// Fills the List Box with the Dynamo Files everytime the SelectedFolder Changes
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void FillFileListBox(object sender, System.Windows.Controls.TextChangedEventArgs e)
 {
     try
     {
         selectedDirectory = this.selectedDirectoryLabel.Text;
         string   directory = selectedDirectory;
         string[] files     = Directory.GetFiles(directory, "*.dyn");
         this.FileListBox.Items.Clear();
         foreach (string file in files)
         {
             string fileName = Path.GetFileName(file);
             FileListBox.Items.Add(fileName);
         }
         FileListBox.SelectAll();
     }
     catch
     {
     }
 }
コード例 #4
0
 /// <summary>
 /// ファイル全選択ボタン押下時
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnClickAllSelect(object sender, RoutedEventArgs e)
 {
     FileListBox.SelectAll();
     FileListBox.Focus();
 }