private void MenuProjectCompareToItemClick(object sender, EventArgs e) { var menuItem = sender as ToolStripMenuItem; if (menuItem == null) { return; } var item = menuItem.Tag as CompositFile; if (item == null) { return; } var selected = SelectedNode.ProjectItem as CompositFile; if (selected == null) { return; } var worker = new BackgroundFileHandler(WorkerCompletedCallback); worker.SetFileHandlers(new IFileHandler[] { new BackupFilesHandler(), new BaksmaliHandler(_solution.Properties), new DecodeHandler(_solution.Properties) }); worker.Start(new[] { item, selected }); }
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); }
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); }
private void MenuMainBuildBuildClick(object sender, EventArgs e) { bool error = false; try { toolStripStatusText.Text = "Building update.zip"; ShowProgressBarAndCancel(); _solution.PauseFileSystemWatchers(); var worker = new BackgroundFileHandler(UpdateZipCompletedCallback); _updateZipHandler = new UpdateZipHandler(_solution.Properties); worker.AddFileHandler(_updateZipHandler); AddBackGroundWorker(worker); worker.Start(_solution.GetBuildFiles()); } catch (Exception ex) { error = true; MessageEngine.ShowError(ex); } finally { if (error) { HideProgressBarAndCancel(); _solution.ResumeFileSystemWatchers(); if (_updateZipHandler != null) { _updateZipHandler.DeleteZipFile(); _updateZipHandler.Dispose(); _updateZipHandler = null; } } } }