private ProgressMonitorForm(bool closeWhenDone)
        {
            if (This != null)
            {
                // duplicate for this instance stays true, so that all functions are disabled
                // and the form will be closed on load.
                duplicate  = true;
                this.Load += new System.EventHandler(this.ProgressMonitorForm_Load);
            }
            else
            {
                This            = this;
                duplicate       = false;
                inRebuild       = true;
                m_closeWhenDone = closeWhenDone;
                formUpDateTime  = DateTime.Now;

                InitializeComponent();
#if !DEBUG
                keepFinishedCheckBox.Visible = false;
#endif
                RebuildProgressBars();

                ProgressMonitor.Display = this;
                Project.setDlgIcon(this);
            }
        }
 private void ProgressMonitorForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (!duplicate)
     {
         ProgressMonitor.Display = null;
         doRebuild = false;
         This      = null;
     }
 }
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (!duplicate)
     {
         ProgressMonitor.Display = null;
         doRebuild = false;
         This      = null;
     }
     if (disposing)
     {
         if (components != null)
         {
             components.Dispose();
         }
     }
     base.Dispose(disposing);
 }
        private ProgressMonitorForm(bool closeWhenDone)
        {
            if(This != null)
            {
                // duplicate for this instance stays true, so that all functions are disabled
                // and the form will be closed on load.
                duplicate = true;
                this.Load += new System.EventHandler(this.ProgressMonitorForm_Load);
            }
            else
            {
                This = this;
                duplicate = false;
                inRebuild = true;
                m_closeWhenDone = closeWhenDone;
                formUpDateTime = DateTime.Now;

                InitializeComponent();
            #if !DEBUG
                keepFinishedCheckBox.Visible = false;
            #endif
                RebuildProgressBars();

                ProgressMonitor.Display = this;
                Project.setDlgIcon(this);
            }
        }
 private void ProgressMonitorForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if(!duplicate)
     {
         ProgressMonitor.Display = null;
         doRebuild = false;
         This = null;
     }
 }
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 protected override void Dispose( bool disposing )
 {
     if(!duplicate)
     {
         ProgressMonitor.Display = null;
         doRebuild = false;
         This = null;
     }
     if( disposing )
     {
         if(components != null)
         {
             components.Dispose();
         }
     }
     base.Dispose( disposing );
 }