Пример #1
0
        private void populateListViewFromDirectory(string directory)
        {
            initializeBackgroundSourceLoader();
            listView.Items.Clear();
            DirectoryInfo dirInfo = new DirectoryInfo(directory);

            BackgroundSourceLoaderArgs args = new BackgroundSourceLoaderArgs();

            args.GetDetails = listView.View == View.Details;
            if (sourceTypeComboBox.SelectedIndex > 0)
            {
                args.SourceTypeFilter = sourceTypeComboBox.SelectedItem.ToString();
            }

            foreach (DirectoryInfo subdirInfo in dirInfo.GetDirectories())
            {
                args.SourceDirectories.Add(subdirInfo);
            }

            foreach (FileInfo fileInfo in dirInfo.GetFiles())
            {
                args.SourceFiles.Add(fileInfo);
            }

            backgroundSourceLoader.RunWorkerAsync(args);
        }
Пример #2
0
        private void populateListViewFromDirectory( string directory )
        {
            initializeBackgroundSourceLoader();
            listView.Items.Clear();
            DirectoryInfo dirInfo = new DirectoryInfo( directory );

            BackgroundSourceLoaderArgs args = new BackgroundSourceLoaderArgs();
            args.GetDetails = listView.View == View.Details;
            if( sourceTypeComboBox.SelectedIndex > 0 )
                args.SourceTypeFilter = sourceTypeComboBox.SelectedItem.ToString();

            foreach( DirectoryInfo subdirInfo in dirInfo.GetDirectories() )
                args.SourceDirectories.Add( subdirInfo );

            foreach( FileInfo fileInfo in dirInfo.GetFiles() )
                args.SourceFiles.Add( fileInfo );

            backgroundSourceLoader.RunWorkerAsync( args );
        }