Esempio n. 1
0
        internal static string GetOptString(BwArgs args)
        {
            var opt = "";

            if (args.SkipSystemUpdate)
            {
                opt += "nosystemupdate=true ";
            }
            if (args.GenerateFileList)
            {
                opt += "genfilelist=true ";
            }
            if (args.GenerateSfv)
            {
                opt += "gensfv=true ";
            }
            if (args.DeleteIsoOnCompletion)
            {
                opt += "deleteisooncompletion=true ";
            }
            if (args.UseFtp)
            {
                opt += "useftp=true";
                opt += " ftphost=" + args.FtpSettings.Host;
                opt += " ftpport=" + args.FtpSettings.Port;
                opt += " ftpuser="******" ftppass="******" ftppath=" + args.FtpSettings.Path;
                opt += " ftpmode=" + args.FtpSettings.DataConnectionType;
            }
            return(opt.Trim());
        }
Esempio n. 2
0
        private void AddQueueItem(bool resetTarget)
        {
            if (string.IsNullOrEmpty(srcbox.Text))
            {
                return;
            }
            var viewitem = new ListViewItem(_id.ToString(CultureInfo.InvariantCulture));

            viewitem.SubItems.Add(srcbox.Text);
            var target = targetbox.Text;

            if (!resetTarget && !string.IsNullOrEmpty(target))
            {
                target = Path.Combine(target, Path.GetFileNameWithoutExtension(srcbox.Text));
            }
            if (string.IsNullOrEmpty(target) && !ftpbox.Checked)
            {
                target = string.Format("{0}\\{1}", Path.GetDirectoryName(srcbox.Text), Path.GetFileNameWithoutExtension(srcbox.Text));
            }
            else if (target.IndexOf(':') > 0 || string.IsNullOrEmpty(target))
            {
                target = Path.GetFileNameWithoutExtension(srcbox.Text);
            }
            viewitem.SubItems.Add(target);
            var queueitem = new BwArgs {
                Source                = srcbox.Text,
                Target                = target,
                SkipSystemUpdate      = skipsysbox.Checked,
                GenerateFileList      = genfilelistbox.Checked,
                UseFtp                = ftpbox.Checked,
                FtpSettings           = FtpSettings,
                GenerateSfv           = gensfvbox.Checked,
                DeleteIsoOnCompletion = delIsobox.Checked
            };
            var opt = Program.GetOptString(queueitem);

            viewitem.SubItems.Add(opt);
            queview.Items.Add(viewitem);
            _queDict.Add(_id, queueitem);
            _id++;

            if (resetTarget)
            {
                targetbox.Text = "";
            }
            srcbox.Text        = "";
            processbtn.Enabled = true;
        }
Esempio n. 3
0
        private void ExtractbtnClick(object sender, EventArgs e)
        {
            SetBusyState();
            bw.RunWorkerCompleted += SingleExtractCompleted;
            bw.DoWork             += SingleExtractDoWork;
            _eta.Reset();
            var bwargs = new BwArgs {
                Source                = srcbox.Text,
                Target                = targetbox.Text,
                SkipSystemUpdate      = skipsysbox.Checked,
                GenerateFileList      = genfilelistbox.Checked,
                DeleteIsoOnCompletion = delIsobox.Checked,
                UseFtp                = ftpbox.Checked,
                FtpSettings           = FtpSettings,
                GenerateSfv           = gensfvbox.Checked
            };

            if (bwargs.UseFtp && (bwargs.Target.IndexOf(':') > 0 || string.IsNullOrEmpty(bwargs.Target)))
            {
                bwargs.Target = Path.GetFileNameWithoutExtension(srcbox.Text);
            }
            bw.RunWorkerAsync(bwargs);
        }