C
ChinkyP
Guest
<pre>I have created a desktop app using winforms that fetches files from a local drive and displays in winforms on the right hand side. As a next step, I'd like for the user to be able to select multiple files from this list using something like the ListViewItem Selected Files function:
ListViewItem[] SelectedFiles = fileListView1.SelectedItems.Any()
Next, I have already written code to execute a function to optimize each files resolution after the user selects either one file or multiple files.
However what do I need to do to modify this code so it allows the user to select one or multiple files from the list displayed to the right? Here is some of the code so you can see it in context of this app:
Thanks for your help in advance!
private void combinePDFsBtn_Click(object sender, EventArgs e)
{
DirectoryInfo root = new DirectoryInfo(folderTreeView.CurrentDirectory.FullName);
ListViewItem[] SelectedFiles = fileListView1.SelectedItems.Any()
List<DirectoryInfo> directories = new List<DirectoryInfo>();
IEnumerable<DirectoryInfo> dirs = root.GetDirectories();
foreach (DirectoryInfo path in dirs)
directories.Add(path);
DynamicProgressForm prog = new DynamicProgressForm(0, directories.Count);
prog.StatusText = "Combining PDFs from folder: {0} of {2} \r\n({3}% complete) - Approx. {4} seconds remaining";
Cursor = Cursors.WaitCursor;
Application.DoEvents();
prog.Show(this);
Application.DoEvents();
prog.Value++;
Application.DoEvents();
DirectoryInfo dest = root.CreateSubdirectory("Optimized Files");
StitchFolder(root.FullName, root, dest);
//foreach (DirectoryInfo path in directories)
//{
// StitchFolder(root.FullName, path, dest);
// prog.Value++;
// Application.DoEvents();
//}
Cursor = Cursors.Default;
prog.Close();
}[/code]
Continue reading...
ListViewItem[] SelectedFiles = fileListView1.SelectedItems.Any()
Next, I have already written code to execute a function to optimize each files resolution after the user selects either one file or multiple files.
However what do I need to do to modify this code so it allows the user to select one or multiple files from the list displayed to the right? Here is some of the code so you can see it in context of this app:
Thanks for your help in advance!
private void combinePDFsBtn_Click(object sender, EventArgs e)
{
DirectoryInfo root = new DirectoryInfo(folderTreeView.CurrentDirectory.FullName);
ListViewItem[] SelectedFiles = fileListView1.SelectedItems.Any()
List<DirectoryInfo> directories = new List<DirectoryInfo>();
IEnumerable<DirectoryInfo> dirs = root.GetDirectories();
foreach (DirectoryInfo path in dirs)
directories.Add(path);
DynamicProgressForm prog = new DynamicProgressForm(0, directories.Count);
prog.StatusText = "Combining PDFs from folder: {0} of {2} \r\n({3}% complete) - Approx. {4} seconds remaining";
Cursor = Cursors.WaitCursor;
Application.DoEvents();
prog.Show(this);
Application.DoEvents();
prog.Value++;
Application.DoEvents();
DirectoryInfo dest = root.CreateSubdirectory("Optimized Files");
StitchFolder(root.FullName, root, dest);
//foreach (DirectoryInfo path in directories)
//{
// StitchFolder(root.FullName, path, dest);
// prog.Value++;
// Application.DoEvents();
//}
Cursor = Cursors.Default;
prog.Close();
}[/code]
Continue reading...