private void AboutBox1_Load(object sender, EventArgs e) { textBox1.Select(0, 0); if (File.Exists("banner.jpg")) { try { this.pictureBox1.Image = new Bitmap("banner.jpg"); } catch (Exception ex) { ExceptionBox.ExceptionForm tmp = new ExceptionBox.ExceptionForm(ref ex); tmp.ShowDialog(this); } } else { this.pictureBox1.BorderStyle = BorderStyle.FixedSingle; } }
/// <summary> /// Create archives based on specifications passed and internal state /// </summary> void Create(string zipFileName, ArrayList fileSpecs, ref ToolStripProgressBar ProgressBar) { if (Path.GetExtension(zipFileName).Length == 0) { zipFileName = Path.ChangeExtension(zipFileName, ".zip"); } try { using (ZipFile zf = ZipFile.Create(zipFileName)) { zf.BeginUpdate(); activeZipFile_ = zf; foreach (string spec in fileSpecs) { // This can fail with wildcards in spec... string path = Path.GetDirectoryName(Path.GetFullPath(spec)); string fileSpec = Path.GetFileName(spec); zf.NameTransform = new ZipNameTransform(Settings.Global.Properties["POLPath"]); FileSystemScanner scanner = new FileSystemScanner(fileSpec); scanner.ProcessFile = new ProcessFileHandler(ProcessFile); scanner.Scan(path, false); ProgressBar.PerformStep(); } zf.CommitUpdate(); ProgressBar.PerformStep(); } } catch (Exception ex) { ExceptionBox.ExceptionForm tmp = new ExceptionBox.ExceptionForm(ref ex); tmp.ShowDialog(); } }