日期:2009-06-09  浏览次数:20490 次

you know, splash screen is to prepare the application initializing, not to wait for a few seconds. So using timer is a wrong way.

using System;
using System.Reflection;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Resources;

using Core.Util;
using Core.Properties;
using Core.AddIns.Codons;
using Core.AddIns;

namespace SharpDevelop {
    
    /// <summary>
    /// This Class is the NCvs main class, it starts the program.
    /// </summary>
    public class SharpDevelopMain
    {
        public static string[] CommandLineArgs;
        
        class SplashScreen : Form
        {
            public SplashScreen()
            {
                TopMost         = true;
                FormBorderStyle = FormBorderStyle.None;
                StartPosition   = FormStartPosition.CenterScreen;
                
                ResourceManager resources = new ResourceManager("IconResources", Assembly.GetCallingAssembly());
                Bitmap bitmap = (Bitmap)resources.GetObject("SplashScreen");
                Size = bitmap.Size;
                BackgroundImage = bitmap;
            }
        }
        
        /// <summary>
        /// Starts the core of SharpDevelop.
        /// </summary>
        [STAThread()]
        public static void Main(string[] args)
        {
            CommandLineArgs = args;
            
            SplashScreen splashScreen = new SplashScreen();
            splashScreen.Show();
            try {
                GlobalProperties.LoadProperties();
            } catch (PropertyFileLoadException) {
         &