示例#1
0
 static void Application_Idle(object sender, EventArgs e)
 {
     Application.Idle -= Application_Idle;
     System.Threading.Thread.Sleep(1000);
     _splash.Dispose();
     _splash = null;
 }
示例#2
0
 void MainForm_Load(object sender, EventArgs e)
 {
     if (_splashForm != null)
     {
         _splashForm.Close();
         _splashForm.Dispose();
     }
     WindowState = FormWindowState.Maximized;
 }
示例#3
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (spx != null)
     {
         spx.Dispose();
     }
     this.Show();
 }
示例#4
0
 private static void CloseSplash()
 {
     if (splash == null)
     {
         return;
     }
     splash.Invoke(new EventHandler(splash.KillMe));
     splash.Dispose();
     splash = null;
 }
示例#5
0
 static void HomeForm_Load(object sender, EventArgs e)
 {
     //close splash
     if (splashForm == null)
     {
         return;
     }
     splashForm.Invoke(new Action(splashForm.Close));
     splashForm.Dispose();
     splashForm = null;
 }
示例#6
0
 private static void MainForm_LoadCompleted(object sender, EventArgs e)
 {
     if (SplashForm == null || SplashForm.Disposing || SplashForm.IsDisposed)
     {
         return;
     }
     SplashForm.Invoke(new Action(() => { SplashForm.Close(); }));
     SplashForm.Dispose();
     SplashForm = null;
     MainForm.Activate();
 }
示例#7
0
 private void AboutBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         if (m_splash_form != null)
         {
             m_splash_form.Close();
             m_splash_form.Dispose();
             m_splash_form = null;
         }
         this.Close();
     }
 }
示例#8
0
        private void SplashTestButton_Click(object sender, EventArgs e)
        {
            Program.IsProgramReady = false;
            Task SplashTask = Task.Run(() =>
            {
                SplashForm SF = new SplashForm(10);
                SF.ShowDialog();
                SF.Dispose();
            });

            Thread.Sleep(9999);
            Program.IsProgramReady = true;
        }
示例#9
0
    private static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Form mainFormInstance = null;
        var  splash           = new SplashForm <MainForm>();

        splash.MainFormLoaded +=
            (s, e) =>
        {
            mainFormInstance = e;
            splash.Dispose();
        };
        Application.Run(splash);
        Application.Run(mainFormInstance);
    }
示例#10
0
    public void RunApplication()
    {
        // This will show the splash screen
        ThreadPool.QueueUserWorkItem(new WaitCallback(MessageLoopThread));

        // This will perform any miscellaneous loading functions
        splashForm.PerformLoadingFunctions();
        if (!CheckLicensing())
        {
            ShowErrorMessage();
            Application.Exit();
            return;
        }
        // Now load the main form
        mainForm = new MainForm();
        // We're done loading!  Swap out our objects
        base.MainForm = mainForm;
        // Close our splash screen
        splashForm.Close();
        splashForm.Dispose();
        splashForm = null;
    }
示例#11
0
        static void MainFormLoad(object sender, EventArgs e)
        {
            if (SplashScreen != null)
            {
                SplashScreen.Invoke(new Action(SplashScreen.Close));
                SplashScreen.Dispose();
            }

            MainForm form = (MainForm)sender;

            form.BringToFront();
            form.Activate();

            if (Arguments.Setwindow)
            {
                form.Left   = Arguments.Position_x;
                form.Top    = Arguments.Position_y;
                form.Width  = Arguments.Size_w;
                form.Height = Arguments.Size_h;

                form.WindowState = (FormWindowState)Arguments.Window_s;
            }
        }
示例#12
0
		private void SharpClientForm_Load(object sender, System.EventArgs e)
		{	
			
			try
			{

				psStatusBar.Panels[0].Icon=this.Icon;  
				psStatusBar.Panels[0].Text="Welcome to ProfileSharp. The .NET Code, Performance and Memory Profiler by SoftProdigy.";
				Application.DoEvents();  
				splashForm=new SplashForm();
				splashForm.Show();  
				Application.DoEvents(); 		
				this.Cursor =Cursors.WaitCursor ;
				Application.DoEvents(); 
				
				try
				{
					Configurator.RestoreDefaultConfiguration();
				}
				catch{}			
											
				try
				{
					FunctionImporter.DeleteCache("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Application.StartupPath+@"\SharpBase.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;",true); 
				}
				catch{}
				try
				{
					ObjectImporter.DeleteCache("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Application.StartupPath+@"\SharpBase.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;",true); 
				}
				catch{}				
				Application.DoEvents();  
				if(CanCompact())
				{
					CompactDB(); 
				}
				System.Threading.Thread.Sleep(3000);   
				
			}
			catch
			{
				if(splashForm!=null)
				{
					try
					{
						splashForm.Close();
						splashForm.Dispose();
						splashForm=null;
						Application.DoEvents();  
					}
					catch{}
				}				
			}
			finally
			{			
				this.Cursor=Cursors.Arrow ;  
				SharpClientForm.scInstance.AddStackControlTab("Profiler-Options","Profiler-Options",12,SharpClient.UI.Docking.State.DockLeft,"Choose an option","Profile desktop application.||Profile windows service.||Profile ASP.NET||Profile COM+ application.||Open performance results.||Open memory results.||Compare two memory snapshots.||Report a bug.||Suggest a feature.||Ask for a customization.||View help file.||ProfileSharp license agreement.||Check for updates.||About us.","\nPlease choose an action to perform\nwith ProfileSharp." ,-1,true,false);
				
				if(splashForm!=null)
				{
					try
					{
						splashForm.Close();
						splashForm.Dispose();
						splashForm=null;
						Application.DoEvents();  
					}
					catch{}
				}
 
			}
			/////////Auto Attach Start Thread
			Application.DoEvents();  
			profileeThread = new System.Threading.Thread(new System.Threading.ThreadStart(refreshProcessView));
			profileeThread.Start();

			//////////////////
		
			if (SharpClientForm.arguments!=null &&   SharpClientForm.arguments.Length>0)
			{
				try
				{
					foreach (string fileName in SharpClientForm.arguments)
					{
						Application.DoEvents();
						if(fileName.ToLower().EndsWith(".oxml"))
						{							
							SharpClientTabPage objectTab=new SharpClientTabPage("Loading...",fileName ); 				
							objectTab.Dock =DockStyle.Fill ;
							this.sharpClientMDITab.TabPages.Add(objectTab); 
							this.sharpClientMDITab.SelectedTab =objectTab ;
							objectTab.Show();   
						}
						else if(fileName.ToLower().EndsWith(".fxml"))
						{
							SharpClientTabPage functionTab=new SharpClientTabPage("Loading...",fileName  ); 				
							functionTab.Dock =DockStyle.Fill ;
							this.sharpClientMDITab.TabPages.Add(functionTab); 
							this.sharpClientMDITab.SelectedTab =functionTab ;
							functionTab.Show(); 
						}
						Application.DoEvents();
						break;//we only want to open 1 file at a time.

					}
				}										
				catch(Exception except)
				{					
					MessageBox.Show("ProfileSharp was unable to open one or more files specified.\n"+except.Message,"Error!",MessageBoxButtons.OK,MessageBoxIcon.Error)   ;
				}			

			}
			
		}
 static void mainForm_Load(object sender, EventArgs e)
 {
     _splash.Dispose();
 }
示例#14
0
 private void ShowSplash()
 {
     // show/hide splash screen
     SplashForm splashForm = new SplashForm();
     try
     {
         splashForm.ShowDialog();
     }
     finally
     {
         splashForm.Dispose();
     }
 }