Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/19/09 15:11:36 (15 years ago)
Author:
abeham
Message:

wrapping close method to possibly solve #183

Location:
trunk/sources/HeuristicLab
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab/SplashScreen.Designer.cs

    r595 r2439  
    214214      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
    215215      this.TopMost = true;
    216       this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SplashScreen_FormClosing);
    217216      this.panel.ResumeLayout(false);
    218217      ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
  • trunk/sources/HeuristicLab/SplashScreen.cs

    r596 r2439  
    102102      }
    103103      SetInfoText(info);
    104       Application.DoEvents();
    105104    }
    106105
     
    126125        } else {
    127126          Opacity = 0;
    128           Close();
     127          CloseSplashScreen();
    129128        }
    130129      }
    131130    }
    132131
    133     private void SplashScreen_FormClosing(object sender, FormClosingEventArgs e) {
    134       PluginManager.Manager.Action -= new PluginManagerActionEventHandler(this.Manager_Action);
     132    private void closeButton_Click(object sender, EventArgs e) {
     133      lock(bigLock) {
     134        if(fadeTimer != null) fadeTimer.Stop();
     135        CloseSplashScreen();
     136      }
    135137    }
    136138
    137     private void closeButton_Click(object sender, EventArgs e) {
    138       lock(bigLock) {
     139    private void CloseSplashScreen() {
     140      if (!closing) { // just close once
    139141        closing = true;
    140         if(fadeTimer != null) fadeTimer.Stop();
    141         Close();
     142        PluginManager.Manager.Action -= new PluginManagerActionEventHandler(this.Manager_Action); // remove event before calling close
     143        Application.DoEvents(); // work up all existing events
     144        Close(); // close
    142145      }
    143146    }
Note: See TracChangeset for help on using the changeset viewer.