Large file copy does not progress the progress bar in this background worker thread example

324 Views Asked by At

I am using the example exactly as defined in the answer here, with the only exception being that I am adding a file extension. That file extension references a file I've placed in the "My Documents" folder (which the example uses for source folder in the file copy process).

        string[] theExtensions = { "*.jpg", "*.jpeg", "*.bmp", "*.png", "*.gif", "*.largefile" };

I've made the file with my new extension 1.8GB in size. When running this code, all the files copy over just fine. The only problem is that the progress bar does not progress at all since adding the new extension and very large file.

The example code is from 2006, so I wonder if there is something in the example that has evolved to handle larger files. Or perhaps there is something with the file extension being larger than 3 characters?

I suspect the issue might be in this part of the example:

    private class UIProgress
    {
        public UIProgress(string name_, long bytes_, long maxbytes_)
        {
            name = name_; bytes = bytes_; maxbytes = maxbytes_;
        }

        public string name;
        public long bytes;
        public long maxbytes;
    }

A second set of eyes is appreciated..

0

There are 0 best solutions below