Beispiel #1
0
        /// <summary>
        /// Event launched when Split is in process
        /// </summary>
        /// <param name="sender">spliter object</param>
        /// <param name="args">Paramaters of actual split</param>
        void fileSplitter_splitProcess(object sender, ProcessingArgs args)
        {
            lbSplitInfo.Text = String.Format(Properties.Resources.SPLITTING_FILE, args.FileName);
            if (fileSplitter.OperationMode != SplitUnit.Lines)
            {
                progressBarFiles.Style = ProgressBarStyle.Continuous;
                int percPart = Convert.ToInt32((args.Part * 100) / args.Parts);
                if (percPart < progressBarFiles.Maximum)
                {
                    progressBarFiles.Value = percPart;
                }
                else
                {
                    progressBarFiles.Value = progressBarFiles.Maximum;
                }
            }
            else
            {
                progressBarFiles.Style = ProgressBarStyle.Marquee;
            }

            int percSize = Convert.ToInt32((args.PartSizeWritten * 100) / args.PartSize);

            if (percSize < progressBarFileSize.Maximum)
            {
                progressBarFileSize.Value = percSize;
            }
            else
            {
                progressBarFileSize.Value = progressBarFileSize.Maximum;
            }
            Application.DoEvents();
        }
Beispiel #2
0
        /// <summary>
        /// Handler for event in FileSplitWorker, Process in execution
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>

        static void fs_splitProcess(object sender, ProcessingArgs args)
        {
            if (lastFile != args.FileName)
            {
                lastFile = args.FileName;
                Console.WriteLine("Writing " + lastFile);
            }
        }