コード例 #1
0
        private void ListFiles_Click(object sender, RoutedEventArgs e)
        {
            e.Handled = true;
            var filterStringDlg = new EnterFileFilterString(this);

            var bRtn = filterStringDlg.ShowDialog();

            if (null != bRtn && bRtn.Value)
            {
                var fileFilter = filterStringDlg.FileFilter;

                if (!string.IsNullOrEmpty(fileFilter))
                {
                    _usnEntryDetail.Visibility = Visibility.Hidden;
                    resultsLb.ItemsSource      = null;
                    resultsLb.Items.Clear();

                    Cursor = Cursors.Wait;
                    new Thread(ListFilesThreadStart).Start(fileFilter);
                }

                else
                {
                    var lbItem = new ListBoxItem
                    {
                        Content    = "\'List Files\'-> File Filter is Null or Empty",
                        Foreground = Brushes.Red
                    };

                    resultsLb.Items.Add(lbItem);
                }
            }
        }
コード例 #2
0
        private void ListFiles_Click(object sender, RoutedEventArgs e)
        {
            EnterFileFilterString filterStringDlg = new EnterFileFilterString(this);
            bool?bRtn = filterStringDlg.ShowDialog();

            if (bRtn != null && bRtn.Value)
            {
                string fileFilter = filterStringDlg.FileFilter;
                if (!string.IsNullOrEmpty(fileFilter))
                {
                    _usnEntryDetail.Visibility = Visibility.Hidden;
                    resultsLb.ItemsSource      = null;
                    resultsLb.Items.Clear();

                    Thread usnJournalThread = new Thread(ListFilesThreadStart);
                    Cursor = Cursors.Wait;
                    usnJournalThread.Start(fileFilter);
                }
                else
                {
                    ListBoxItem lbItem = new ListBoxItem();
                    lbItem.Content    = string.Format("'List Files'-> File Filter is Null or Empty");
                    lbItem.Foreground = Brushes.Red;
                    resultsLb.Items.Add(lbItem);
                }
            }
        }