AssToolkit.MainForm.bgwS2AOutput_DoWork C# (CSharp) Method

bgwS2AOutput_DoWork() private method

private bgwS2AOutput_DoWork ( object sender, DoWorkEventArgs e ) : void
sender object
e DoWorkEventArgs
return void
        private void bgwS2AOutput_DoWork(object sender, DoWorkEventArgs e)
        {
            ConvertAlgorithm C = new ConvertAlgorithm();

            int fileNum = lvSrtFileSelection.Items.Count;
            string[] scriptInfo = new string[0];
            string[] v4Style = new string[0];
            string events = "";
            string engStyle = "";

            ssProgressBar.Maximum = fileNum;
            ssProgressBar.Minimum = 0;
            ssProgressBar.Step = 1;
            ssProgressBar.Value = 0;

            try
            {
                if (lvSrtFileSelection.Items.Count == 0)
                {
                    throw new Exception("请选择源文件");
                }

                if (tbASSOutputFolder.Text == "")
                {
                    throw new Exception("请选择目标文件夹");
                }

                if (cbEffCfg.Text == "")
                {
                    throw new Exception("请选择特效");
                }

                ReadEffectDetail(cbEffCfg.Text, ref scriptInfo, ref v4Style, ref events, ref engStyle);
                S2AControlEnable(false);
                foreach (ListViewItem lviFile in lvSrtFileSelection.Items)
                {
                    string file = lviFile.Tag as string;
                    C.Entry(file, tbASSOutputFolder.Text, scriptInfo, v4Style, engStyle, events);
                    ssProgressBar.PerformStep();
                }
                S2AControlEnable(true);

            }

            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }