Ejemplo n.º 1
0
        public void ProcessFiles(IEnumerable <CompositFile> files)
        {
            string statusText = "Processing files for selected apk and jar files";
            string caption    = "Select processing options for selected apk and jar files";

            if (files == null)
            {
                if (solutionExplorer.SelectedProject == null)
                {
                    return;
                }
                statusText = "Processing files for all included apk and jar files";
                caption    = "Select processing options for all included apk and jar files";
                files      = solutionExplorer.SelectedProject.GetCompositFiles().Where(x => x.IsIncluded);
            }
            var optionsForm = new ProcessOptionsForm(caption);

            if (optionsForm.ShowDialog(this) == DialogResult.Cancel || optionsForm.NoOptionsSelected)
            {
                return;
            }

            toolStripStatusText.Text = statusText;
            ShowProgressBarAndCancel();

            var worker = new BackgroundFileHandler(WorkerCompletedCallback);

            worker.SetFileHandlers(ProcessHandlerFactory.CreateFileHandlers(optionsForm.ProcessingOptions, _solution.Properties));

            AddBackGroundWorker(worker);
            worker.Start(files);
        }
Ejemplo n.º 2
0
        public void ProcessFiles(IEnumerable <CompositFile> files, ProcessingOptions processingOptions)
        {
            if (files == null)
            {
                if (solutionExplorer.SelectedProject == null)
                {
                    return;
                }
                files = solutionExplorer.SelectedProject.GetCompositFiles().Where(x => x.IsIncluded);
            }

            toolStripStatusText.Text = "Processing files...";
            ShowProgressBarAndCancel();

            var worker = new BackgroundFileHandler(WorkerCompletedCallback);

            worker.SetFileHandlers(ProcessHandlerFactory.CreateFileHandlers(processingOptions, _solution.Properties));

            AddBackGroundWorker(worker);
            worker.Start(files);
        }