Exemplo n.º 1
0
        private void folderCopier_UnitCopy(object sender, UnitCopyEventArgs e)
        {
            prgFolderFile.Maximum = (int)e.FileSize;
            prgFolderFile.Value  += (int)e.BytesCopied;

            prgFolderTotal.Value += (int)e.BytesCopied;

            lblFolderFileDetails.Text = e.Percent.ToString() + "% Done";

            if (prgFolderFile.Value == prgFolderFile.Maximum)
            {
                prgFolderFile.Value   = 0;
                prgFolderFile.Maximum = 0;
            }

            if (prgFolderTotal.Value == prgFolderTotal.Maximum)
            {
                prgFolderTotal.Value       = 0;
                prgFolderTotal.Maximum     = 0;
                lblFolderTotalDetails.Text = "0% Done";
                btnFolderCancel.Enabled    = false;
                btnFolderCopy.Enabled      = true;
                txtOutput.Text            += "Done copying...\r\n";
                MessageBox.Show("Done!", "Demo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void fileCopier_UnitCopy(object sender, UnitCopyEventArgs e)
        {
            prgFile.Maximum = (int)e.FileSize;
            prgFile.Value  += (int)e.BytesCopied;

            lblFileDetails.Text = e.Percent.ToString() + "% Done";

            if (prgFile.Value == prgFile.Maximum)
            {
                prgFile.Maximum       = 0;
                prgFile.Value         = 0;
                btnFileCancel.Enabled = false;
                btnFileCopy.Enabled   = true;
                MessageBox.Show("Done!", "Demo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }