예제 #1
0
 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;
     }
 }
예제 #2
0
 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;
     }
 }
예제 #3
0
        /// <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();
            }
        }
예제 #4
0
        /// <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();
            }
        }