// default stuff public static void Splash() { var s = new SplashForm(); s.Show(); s.Update(); // force paint }
public FormMain() { SplashForm.Show(); InitializeComponent(); this.Size = new Size(730, 410); Thread.Sleep(500); }
/// <summary> /// Create and Show Splash Form</summary> public static void ShowForm(Type type, string resourcePath) { if (theInstance != null) return; theInstance = new SplashForm(type, resourcePath.ToString()); theInstance.Show(); Application.DoEvents(); }
/// <summary> /// handles the normal splash screen /// </summary> private void ShowNormalSplash() { _frm = new SplashForm { TopMost = _alwaysOnTop }; _frm.Location = new Point(CurrentDisplay.Bounds.X + CurrentDisplay.Bounds.Width / 2 - _frm.Size.Width / 2, CurrentDisplay.Bounds.Y + CurrentDisplay.Bounds.Height / 2 - _frm.Size.Height / 2); _frm.SetVersion(Version); _frm.Show(); _frm.Update(); _frm.FadeIn(); string oldInfo = null; // run until stop of splash screen is requested while (!_stopRequested) { if (oldInfo != _info) { _frm.SetInformation(_info); oldInfo = _info; } Thread.Sleep(10); } _frm.FadeOut(); _frm.Close(); _frm = null; }
private void DispatcherView_Load(object sender, EventArgs e) { Hide(); HidePanels(true); //hide all panels on start GetandFillOders(); //splash bool done = false; ThreadPool.QueueUserWorkItem((x) => { using (var splashForm = new SplashForm()) { splashForm.Show(); while (!done) Application.DoEvents(); splashForm.Close(); } }); Thread.Sleep(2000); // Emulate hardwork done = true; Show(); //timer thread Thread t = new Thread(new ThreadStart(TimerInvoker)); t.IsBackground = true; t.Start(); }
static void Main() { Application.EnableVisualStyles(); Application.DoEvents(); CustomExceptionHandler eh = new CustomExceptionHandler(); Application.ThreadException += new ThreadExceptionEventHandler(eh.OnThreadException); SplashForm splash = new SplashForm() ; try { splash.Show(); } catch (Exception) { } Thread.Sleep(4000); splash.Close() ; frm = new MainForm() ; Application.Run(frm); }
public ApplicationContext(string fileName) { _form = new SplashForm(fileName); _form.Show(); _form.Disposed += (s, e) => ExitThread(); }
static void Main() { SplashForm mSplash = new SplashForm(); mSplash.Show(); Application.DoEvents(); MainMDI frm = new MainMDI(); frm.mSplash = mSplash; Application.Run(frm); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SplashForm frmSplash = new SplashForm(); frmSplash.Show(); Application.Run(new MainForm(frmSplash)); }
static void Main(string[] args) { #if false using (FileStream fsi = new FileStream(@"C:\Users\Wiley\Desktop\Zippy.log", FileMode.Open, FileAccess.Read)) { Int64 OriginalLength = fsi.Length; Int64 Start = 3 * OriginalLength / 4; fsi.Seek(Start, SeekOrigin.Begin); using (FileStream fso = new FileStream(@"C:\Users\Wiley\Desktop\Zippy2.log", FileMode.Create, FileAccess.ReadWrite)) { byte[] buffer = new byte [4096]; for (; ;) { int Count = fsi.Read(buffer, 0, buffer.Length); if (Count <= 0) { break; } fso.Write(buffer, 0, Count); } } } MessageBox.Show("Done"); #endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { System.Threading.Thread.CurrentThread.Name = "Main Thread"; // Change to the application's directory so that we can find the DLLs we need. string AppFolder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); Directory.SetCurrentDirectory(AppFolder); if (args.Length > 0 && args[0].ToLowerInvariant() == "/tray") { Application.Run(new MainForm(true)); } else { Splash = new SplashForm(); Splash.Show(); Application.DoEvents(); Application.Run(new MainForm(false)); } } catch (Exception ex) { #if DEBUG MessageBox.Show("An application-level error has occurred: \n" + ex.ToString()); #endif } }
private static SplashForm splash;// = new SplashForm(); internal static void Launch() { Application.CurrentCulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); splash = new SplashForm(); splash.Show(); Timer timer = new Timer(); //Configure this timer to restart each second ( 1000 millis) timer.Interval = 1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); //splash.Refresh(); //Application.DoEvents(); Application.DoEvents(); MainModule.Initialize("data"); splash.SetLoadProgress(50); splash.Refresh(); Application.DoEvents(); UpdaterHelper.UpdateInfo info; info = UpdaterHelper.CheckFromUpdates(); Application.DoEvents(); if (info.UpdateAvailable) { UpdateForm updateForm; updateForm = new UpdateForm(info); updateForm.ShowDialog(); Application.DoEvents(); } splash.SetLoadProgress(60); splash.Refresh(); Application.DoEvents(); IconsManager.Initialize(); Application.DoEvents(); MainForm main = new MainForm(); //if (runSingleInstance) //{ // main.HandleCreated += new EventHandler(main_HandleCreated); //} GC.Collect(); timer.Stop(); timer.Close(); splash.SetLoadProgress(100); splash.Refresh(); Application.DoEvents(); splash.Close(); splash = null; Application.DoEvents(); Application.Run(main); } //Launch
static void Main() { Application.EnableVisualStyles(); //样式设置 Application.SetCompatibleTextRenderingDefault(false); //样式设置 SplashForm sp = new SplashForm(); //启动窗体 sp.Show(); //显示启动窗体 context = new ApplicationContext(); context.Tag = sp; Application.Idle += new EventHandler(Application_Idle); //注册程序运行空闲去执行主程序窗体相应初始化代码 Application.Run(context); }
static void Main() { try { var a = ExcelService.GetTableFromClipboard(); // File.Delete(@"h:\Mana\mana-schedule\mana-schedule\ManaSchedule\bin\Debug\mana.sdf"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //using (var s = new TestForm()) //{ // s.ShowDialog(); //} _splash = new SplashForm(); _splash.Show(); App.LogSplash = new Action <string>((f) => { try { if (_splash == null) { return; } if (_splash.LogLabel.InvokeRequired) { _splash.LogLabel.Invoke(new MethodInvoker(() => { _splash.LogLabel.Text = f; })); } else { _splash.LogLabel.Text = f; } } catch (Exception) { } }); App.Init(); App.AdminMode = false; Application.Idle += Application_Idle; Application.Run(App.MainForm); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
static void Main() { ThreadExceptionHandler handler = new ThreadExceptionHandler(); Application.ThreadException += new ThreadExceptionEventHandler(handler.Application_ThreadException); Application.SetCompatibleTextRenderingDefault(false); SplashForm splash = new SplashForm(); splash.Show(); splash.Refresh(); Application.EnableVisualStyles(); Application.Run(new Form1(splash)); }
static void Main() { Application.SetCompatibleTextRenderingDefault(false); _splash = new SplashForm(); _splash.Show(); _splash.Refresh(); Application.EnableVisualStyles(); MainForm mainForm = new MainForm(); mainForm.Load += new EventHandler(mainForm_Load); Application.Run(mainForm); }
private async Task StartAsync() { using var splashForm = new SplashForm(); splashForm.Show(); var mainForm = new MainForm(DIContainer.ComputerRepository); mainForm.FormClosed += (s, e) => Application.ExitThread(); mainForm.Shown += (s, e) => splashForm.Close(); await mainForm.InitializeAsync(); mainForm.Show(); }
public static void Run(SplashForm splash, MainForm form) { splash.CreateAction += (s, e) => { form.Initialize(splash); }; form.Load += (s, e) => { splash.Close(); }; splash.Show(); while (!splash.Done) Application.DoEvents(); //Application.Run(form); form.Show(); while (form.Created) Application.DoEvents(); }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // load current culture, en-US or zh-CN // make be can change to configalbe later. Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; // load resource files MainForm.LocRM = new ResourceManager("WinApt.Client.WinAptStrings", typeof(MainForm).Assembly); SplashForm mySplash = new SplashForm(); bool exitFlag = false; mySplash.Show(); try { //when the fisrt time run this program, exception("new") throws mySplash.InitApp(); } catch (Exception e) { //build new config file. if (e.Message == "new") { ChoseForm myChoseForm = new ChoseForm(); myChoseForm.ShowDialog(mySplash); if (myChoseForm.DialogResult == DialogResult.OK) { myChoseForm.Config(); mySplash.InitApp(); } myChoseForm.Close(); } else { MessageBox.Show(e.Message); exitFlag = true; } } finally { mySplash.Close(); } if (exitFlag) { return; } Application.Run(new MainForm()); }
public static void ShowSplashScreen() { //Ick, DoEvents! But we were having problems with CloseSplashScreen being called //before ShowSplashScreen - this hack was found at //http://stackoverflow.com/questions/48916/multi-threaded-splash-screen-in-c/48946#48946 using (SplashForm splashForm = new SplashForm()) { splashForm.Show(); while (_showSplash) { Application.DoEvents(); } splashForm.Close(); } }
static void Main() { /* MessageBox.Show("当前CAD文件中不包含路线信息,请检查。", "注意"); IAoInitialize ao = null; try { if (!RuntimeManager.Bind(ProductCode.Engine)) { if (!RuntimeManager.Bind(ProductCode.Desktop)) { MessageBox.Show("unable to bind to arcgis runtime.application will be shut down"); return; } } ao = new AoInitializeClass(); ao.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "注意"); } var form2 = LoowooTech.Traffic.TForms.TestSuite.TestCase2(); Application.Run(form2); if(ao != null) ao.Shutdown(); return;*/ if (!RuntimeManager.Bind(ProductCode.Engine)) { if (!RuntimeManager.Bind(ProductCode.Desktop)) { MessageBox.Show("unable to bind to arcgis runtime.application will be shut down"); return; } } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var splash = new SplashForm(); splash.Show(); var form = new MainForm(); splash.Form = form; form.Splash = splash; Application.Run(form); }
public static void ShowSplash() { if (_splashForm == null) { _splashForm = new SplashForm(); _splashForm.blueLoaderBar1.StartAnimation(); } _splashForm.TopMost = true; _splashForm.Show(); lock (SplashForm.locker) { WaitPlease = false; } Application.Run(_splashForm); }
/// <summary> /// handles the normal splash screen /// </summary> private void ShowNormalSplash() { frm = new SplashForm(); frm.SetVersion(Version); frm.Show(); frm.Update(); frm.FadeIn(); string oldInfo = null; while (!stopRequested && (frm.Focused || _overlaidForm != null)) //run until stop of splashscreen is requested { if (AllowWindowOverlayRequested) { // Allow other Windows to Overlay the splashscreen lock (_overlaidFormClosingLock) { if (_overlaidForm != null && _overlaidForm.Visible) // prepare everything to let the Outdated skin message appear { if (frm.Focused) { frm.TopMost = false; _overlaidForm.TopMost = true; _overlaidForm.BringToFront(); Cursor.Show(); } } else { AllowWindowOverlayRequested = false; frm.TopMost = true; frm.BringToFront(); Cursor.Hide(); } } } if (oldInfo != info) { frm.SetInformation(info); oldInfo = info; } Thread.Sleep(25); //Application.DoEvents(); } frm.FadeOut(); frm.Close(); //closes, and disposes the form frm = null; }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // load current culture, en-US or zh-CN // make be can change to configalbe later. Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; // load resource files MainForm.LocRM = new ResourceManager("WinApt.Client.WinAptStrings", typeof(MainForm).Assembly); SplashForm mySplash = new SplashForm(); bool exitFlag = false; mySplash.Show(); try { //when the fisrt time run this program, exception("new") throws mySplash.InitApp(); } catch (Exception e) { //build new config file. if (e.Message == "new") { ChoseForm myChoseForm = new ChoseForm(); myChoseForm.ShowDialog(mySplash); if (myChoseForm.DialogResult == DialogResult.OK) { myChoseForm.Config(); mySplash.InitApp(); } myChoseForm.Close(); } else { MessageBox.Show(e.Message); exitFlag = true; } } finally { mySplash.Close(); } if (exitFlag) return; Application.Run(new MainForm()); }
public LeagueManager() { dbEngine = new DBEngine(); Form frm = new SplashForm(); Cursor = Cursors.WaitCursor; frm.Show(); frm.Update(); System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch() ; watch.Start(); league = dbEngine.LoadLeague3(1); watch.Stop(); MessageBox.Show(watch.Elapsed.ToString()); InitializeComponent(); frm.Hide(); Cursor = Cursors.Default; //InitializeComponent(); DockPanel dockPanel = new DockPanel(); dockPanel.Dock = DockStyle.Fill; dockPanel.BackColor = Color.Beige; Controls.Add(dockPanel); dockPanel.BringToFront(); leagueForm = new LeagueListForm(); leagueForm.ShowHint = DockState.Document; leagueForm.Show(dockPanel); playerForm = new PlayerListForm(); playerForm.ShowHint = DockState.Document; playerForm.Show(dockPanel); teamForm = new TeamListForm(); teamForm.ShowHint = DockState.Document; teamForm.Show(dockPanel); }
public static void Start() { SplashForm splashForm = new SplashForm(); try { Global.SplashForm = splashForm; splashForm.Show(); UIHelper.LoadSavedDataFromJsonFiles(); splashForm.Close(); } catch (Exception e) { Console.WriteLine(e.Message); Helper.Log(e.Message, "LoadingSavedData"); } Application.Run(new ETLParent()); }
static void Main() { // Old .net versions //Application.SetHighDpiMode(HighDpiMode.SystemAware); //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); // new in .net 6 ApplicationConfiguration.Initialize(); ApplicationContext applicationContext = new ApplicationContext(); Store appStore = new Store(new FactoryViewsWinForms()); #region Splash SplashForm splashForm = new SplashForm(appStore); splashForm.Show(); Application.DoEvents(); #endregion LoadAppStore(appStore); #region Demo & lab // applicationContext.MainForm = new LabForm(appStore); #endregion #region Normal start var knoteManagment = new KNoteManagmentComponent(appStore); knoteManagment.Run(); applicationContext.MainForm = (Form)knoteManagment.View; #endregion splashForm.Close(); Application.Run(applicationContext); }
static void Main(string[] args) { if (args.Length > 0) { if (args[0].ToLower() == "-rmvptr") { for (int i = 1; i < args.Length; i++) { try { if (File.Exists(Application.StartupPath + @"\\" + args[i])) { File.Delete(Application.StartupPath + @"\\" + args[i]); } } catch { /* this isn't critical, just convenient */ } } } } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SplashForm splashForm = new SplashForm(); splashForm.Show(); while (!UserExitCalled) { Application.DoEvents(); Thread.Sleep(1); } if (m_TrayIcon != null) { m_TrayIcon.Icon = null; m_TrayIcon.Visible = false; m_TrayIcon.Dispose(); GC.Collect(); } }
public void Start(IBundleContext context) { var splashForm = new SplashForm(Resources.Splashscreen); splashForm.Show(); context.AddService(typeof(IWPFUIElementAdapter), new WPFUIElementAdapter()); var layoutView = new ShellLayoutView(); context.AddService <IWorkspace>(layoutView.Workspace); context.AddService(layoutView.CreateShellLayoutViewProxy()); var form = new ShellForm(); context.AddService <Form>(form); form.ShowLayoutIvew(layoutView); form.Activated += (sender, e) => splashForm.Close(); }
/// <summary> /// Starts the actual splash screen. /// </summary> /// <remarks> /// This method is started in a background thread by the <see cref="Run"/> method.</remarks> private void DoRun() { string oldInfo = null; frm = new SplashForm(); frm.SetVersion(Version); frm.Show(); frm.Update(); frm.FadeIn(); while (!stopRequested && (frm.Focused || _allowOverlay)) //run until stop of splashscreen is requested { if (_allowOverlay == true && _hintForm != null) // Allow other Windows to Overlay the splashscreen { if (_hintForm.Visible) // prepare everything to let the Outdated skin message appear { if (frm.Focused) { frm.TopMost = false; _hintForm.TopMost = true; _hintForm.BringToFront(); } } else { _allowOverlay = false; frm.TopMost = true; frm.BringToFront(); } } if (oldInfo != info) { frm.SetInformation(info); oldInfo = info; } Thread.Sleep(25); } frm.FadeOut(); frm.Close(); //closes, and disposes the form frm = null; }
public Form1(SplashForm splashForm, string[] args) { var str = (string)null; try { str = "InitializePlatformSpecificObjects"; InitializePlatformSpecificObjects(); this.args = args; AllowDrop = true; DragEnter += new DragEventHandler(Form1_DragEnter); DragDrop += new DragEventHandler(Form1_DragDrop); mainThreadTaskQueue = new Queue <Form1.MainThreadTask>(); Form1.debugLogger.Add("Form1() Constructor", "Constructor for the main Form.", DebugLogger.LogType.Secondary); ExceptionForm.form1 = this; str = "splashForm.Show"; this.splashForm = splashForm; splashForm.Show(); str = "InitializeComponent"; InitializeComponent(); settingsManager = new SettingsManager(FileAssociations); Form1.debugLogger.Add("Form1() Constructor", "SettingsManager created.", DebugLogger.LogType.Secondary); timer1 = new System.Windows.Forms.Timer { Interval = 16 }; timer1.Tick += new EventHandler(on_timerTick); timer1.Start(); MouseWheel += new MouseEventHandler(Form1_MouseWheel); fps_lock_watch = new Stopwatch(); fps_frame_counter = new Stopwatch(); } catch (Exception ex) { var extra_info = str; ExceptionForm.ShowExceptionForm(ex, extra_info); } }
private void OpenForexPlatformBeta_Load(object sender, EventArgs e) { //_controlAutomationManager = new ApplicationControlAutomationManager(this); //_controlAutomationManager.RegisterControlHandler(typeof(Control), new HelpHandler()); this.Visible = false; SplashForm splash = new SplashForm(); splash.StartPosition = FormStartPosition.CenterScreen; splash.Show(); splash.Refresh(); combinedContainerControl.ClearControls(); combinedContainerControl.ImageList = this.imageList; combinedContainerControl.SelectedTabbedControlChangedEvent += new CombinedContainerControl.ControlUpdateDelegate(combinedContainerControl_FocusedControlChangedEvent); Platform platform = new Platform("DefaultPlatform"); if (LoadPlatform(platform) == false) {// Failed to load the platform. this.Close(); } else { // Precreate all controls before showing anything, to evade unpleasant flickering on startup. this.CreateControl(); Application.DoEvents(); this.Visible = true; this.WindowState = FormWindowState.Maximized; } splash.Hide(); statusStripToolStripMenuItem.Checked = statusStripMain.Visible; toolStripMenuItemFullDiagnosticsMode.Enabled = platform.Settings.DeveloperMode; }
/// <summary> /// startup the GUI layer, forcing a value for 'useWindowsXPThemes' environment variable. /// </summary> /// <param name = "useWindowsXPThemes"></param> internal void init(bool useWindowsXPThemes, String startupImageFileName) { if (useWindowsXPThemes && Utils.IsXPStylesActive()) { Application.EnableVisualStyles(); } filter = new Filter(); Console.ConsoleWindow.getInstance(); base.init(); if (!String.IsNullOrEmpty(startupImageFileName)) { Image startupImage = ImageLoader.GetImage(startupImageFileName); if (startupImage != null) { startupScreen = new SplashForm(startupImage); startupScreen.Show(); startupScreen.Activate(); } } }
private void ReleaseDatelabel_DoubleClick(object sender, EventArgs e) { SplashForm sf = new SplashForm(); sf.Owner = this; sf.Show(); }
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) ; } } }
internal static void Launch() { Application.CurrentCulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); splash = new SplashForm(); splash.Show(); Timer timer = new Timer(); //Configure this timer to restart each second ( 1000 millis) timer.Interval = 1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); //splash.Refresh(); //Application.DoEvents(); Application.DoEvents(); MainModule.Initialize("data"); splash.SetLoadProgress(50); splash.Refresh(); Application.DoEvents(); UpdaterHelper.UpdateInfo info; info = UpdaterHelper.CheckFromUpdates(); Application.DoEvents(); if (info.UpdateAvailable) { UpdateForm updateForm; updateForm = new UpdateForm(info); updateForm.ShowDialog(); Application.DoEvents(); } splash.SetLoadProgress(60); splash.Refresh(); Application.DoEvents(); IconsManager.Initialize(); Application.DoEvents(); MainForm main = new MainForm(); //if (runSingleInstance) //{ // main.HandleCreated += new EventHandler(main_HandleCreated); //} GC.Collect(); timer.Stop(); timer.Close(); splash.SetLoadProgress(100); splash.Refresh(); Application.DoEvents(); splash.Close(); splash = null; Application.DoEvents(); Application.Run(main); }
static void Main() { if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); XDocument xdoc = null; try { xdoc = XDocument.Load("http://13.230.62.42/quras/update/update.xml"); } catch { } if (xdoc != null) { Version version = Assembly.GetExecutingAssembly().GetName().Version; Version minimum = Version.Parse(xdoc.Element("update").Attribute("minimum").Value); if (version < minimum) { using (UpdateWindow dialog = new UpdateWindow(xdoc)) { dialog.ShowDialog(); if (dialog.DialogResult != DialogResult.Cancel) { return; } } } } SplashForm splash = new SplashForm(); splash.Show(); Application.DoEvents(); int zkSnarksKeyStatus = Global.Utils.CheckZKSnarksKeyStatus(); splash.Hide(); if (zkSnarksKeyStatus != 0) { using (DownloadKeyForm dialog = new DownloadKeyForm(zkSnarksKeyStatus)) { dialog.ShowDialog(); if (dialog.DialogResult == DialogResult.Cancel) { return; } } } Form startForm; startForm = new WelcomeForm(); /* * if (Settings.Default.LastWalletPath.Length == 0) * { * startForm = new WelcomeForm(); * } * else * { * startForm = new RestoreWalletForm(); * } */ FormManager.GetInstance().Push(startForm); if (File.Exists(Constant.PEER_STATE_PATH)) { using (FileStream fs = new FileStream(Constant.PEER_STATE_PATH, FileMode.Open, FileAccess.Read, FileShare.Read)) { LocalNode.LoadState(fs); } } using (Blockchain.RegisterBlockchain(new LevelDBBlockchain("chain"))) using (Constant.LocalNode = new LocalNode()) { Constant.LocalNode.UpnpEnabled = true; Application.Run(startForm); } using (FileStream fs = new FileStream(Constant.PEER_STATE_PATH, FileMode.Create, FileAccess.Write, FileShare.None)) { LocalNode.SaveState(fs); } }
private void ConnectServer() { Thread t = new Thread(new ThreadStart(ViewerConfig.ConfigureServer)); t.Start(); SplashForm sf = new SplashForm("connect to servers..."); sf.Show(); DateTime startTime = DateTime.Now; while (t.IsAlive == true) { if (DateTime.Now.Subtract(startTime).TotalSeconds >= 6) { t.Abort(); break; } sf.Update(); Thread.Sleep(100); } sf.Close(); }
private void Run(string[] args) { if (args.Length > 0 && args[0] == LaunchAppRestartOption) { Console.WriteLine("Restart, wait for 200ms"); Thread.Sleep(200); args = args.Skip(1).ToArray(); } using (launcherApp = new LauncherApp()) { launcherApp.DialogAvailable += launcherApp_DialogAvailable; launcherApp.UnhandledException += (sender, exception) => ShowUnhandledException(exception); var evt = new ManualResetEvent(false); var splashThread = new Thread( () => { splashscreen = new SplashForm(); splashscreen.Initialize(launcherApp); splashscreen.Show(); launcherApp.MainWindowHandle = splashscreen.Handle; evt.Set(); Application.Run(splashscreen); splashscreen = null; }); splashThread.Start(); evt.WaitOne(); launcherApp.ProgressAvailable += launcherApp_ProgressAvailable; launcherApp.LogAvailable += launcherApp_LogAvailable; var runningForm = splashscreen; launcherApp.Running += (sender, eventArgs) => SafeWindowClose(runningForm); var result = launcherApp.Run(args); // Make sure the splashscreen is closed in case of an error if (result != 0) { runningForm.ExitOnUserClose = false; SafeWindowClose(runningForm); } // Reopen the SplashForm if we are still downloading files if (launcherApp.IsDownloading) { isPostDownloading = true; launcherApp.DownloadFinished += launcherApp_DownloadFinished; splashscreen = new SplashForm(); splashscreen.Initialize(launcherApp, "Downloading new version"); splashscreen.Show(); Application.Run(splashscreen); splashscreen = null; } } launcherApp = null; // Relaunch this application if necessary if (relaunchThisProcess) { var newArgs = new List<string>() { LaunchAppRestartOption }; newArgs.AddRange(args); var startInfo = new ProcessStartInfo(typeof(Program).Assembly.Location) { Arguments = string.Join(" ", newArgs), WorkingDirectory = Environment.CurrentDirectory, UseShellExecute = true }; Process.Start(startInfo); } }
private void MainForm_Load(object sender, EventArgs e) { bool splash_screen_done = false; try { SplashForm splash_form = new SplashForm(); ThreadPool.QueueUserWorkItem(delegate { using (splash_form) { splash_form.Show(); while (!splash_screen_done) { Application.DoEvents(); } splash_form.Close(); } }, null); splash_form.Version += " - " + Globals.SHORT_VERSION; InitializeControls(); splash_form.Information = "Initializing server ..."; if ((Globals.EDITION == Edition.Grammar) || (Globals.EDITION == Edition.Research)) { splash_form.Information = "Loading grammar information ..."; } splash_form.Progress = 30; Thread.Sleep(100); LoadApplicationFolders(); string machine = "local"; string username = "******"; string password = "******"; string numerology_system_name = null; numerology_system_name = LoadNumerologySystemName(); m_client = new Client(machine, username, password, numerology_system_name); if (m_client != null) { splash_form.Information = "Loading research methods ..."; LoadResearchMethods(); splash_form.Progress = 35; Thread.Sleep(100); splash_form.Information = "Loading translations ..."; PopulateTranslatorsCheckedListBox(); PopulateTranslatorComboBox(); splash_form.Progress = 40; Thread.Sleep(100); splash_form.Information = "Loading tafseers ..."; PopulateTafseerComboBox(); splash_form.Progress = 55; Thread.Sleep(100); splash_form.Information = "Loading recitations ..."; PopulateRecitationsCheckedListBox(); PopulateReciterComboBox(); splash_form.Progress = 60; Thread.Sleep(100); // must be done before LoadApplicationSettings splash_form.Information = "Loading user bookmarks ..."; m_client.LoadBookmarks(); UpdateBookmarkHistoryButtons(); splash_form.Progress = 70; Thread.Sleep(100); splash_form.Information = "Loading application settings ..."; LoadApplicationSettings(); splash_form.Progress = 80; Thread.Sleep(100); splash_form.Information = "Loading numerology systems ..."; PopulateNumerologySystemComboBox(); NumerologySystemComboBox.SelectedIndexChanged -= new EventHandler(NumerologySystemComboBox_SelectedIndexChanged); NumerologySystemComboBox.SelectedItem = numerology_system_name; if (m_client.NumerologySystem != null) { UpdateKeyboard(m_client.NumerologySystem.TextMode); GoldenRatioOrderLabel.Visible = true; GoldenRatioScopeLabel.Visible = true; } NumerologySystemComboBox.SelectedIndexChanged += new EventHandler(NumerologySystemComboBox_SelectedIndexChanged); splash_form.Progress = 85; Thread.Sleep(100); splash_form.Information = "Loading browse history ..."; m_client.LoadHistoryItems(); UpdateBrowseHistoryButtons(); splash_form.Progress = 90; Thread.Sleep(100); splash_form.Information = "Loading help messages ..."; if (m_client.HelpMessages != null) { if (m_client.HelpMessages.Count > 0) { HelpMessageLabel.Text = m_client.HelpMessages[0]; } } splash_form.Progress = 95; Thread.Sleep(100); splash_form.Information = "Generating prime numbers ..."; UpdateFindByTextControls(); splash_form.Progress = 100; Thread.Sleep(100); if (ReciterComboBox.SelectedItem != null) { RecitationGroupBox.Text = ReciterComboBox.SelectedItem.ToString(); } ToolTip.SetToolTip(PlayerVolumeTrackBar, "Volume " + (m_audio_volume / (1000 / PlayerVolumeTrackBar.Maximum)).ToString() + "%"); PopulateChapterSortComboBox(); RefreshCurrentNumerologySystem(); UpdateObjectListView(); FavoriteNumerologySystemButton.Visible = (numerology_system_name != NumerologySystem.FAVORITE_NUMERORLOGY_SYSTEM); SaveAsFavoriteNumerologySystemLabel.Visible = (numerology_system_name != NumerologySystem.FAVORITE_NUMERORLOGY_SYSTEM); RestoreFavoriteNumerologySystemLabel.Visible = (NumerologySystem.FAVORITE_NUMERORLOGY_SYSTEM != NumerologySystem.PRIMALOGY_NUMERORLOGY_SYSTEM); // prepare before Shown this.ClientSplitContainer.SplitterDistance = m_information_box_top; this.TabControl.SelectedIndex = m_information_page_index; switch (Chapter.PinTheKey) { case null: PinTheKeyCheckBox.CheckState = CheckState.Indeterminate; break; case false: PinTheKeyCheckBox.CheckState = CheckState.Unchecked; break; case true: PinTheKeyCheckBox.CheckState = CheckState.Checked; break; } ApplyLoadedWordWrapSettings(); // must be before DisplaySelection for Verse.IncludeNumber to take effect DisplaySelection(false); GrammarTextBox.Text = GRAMMAR_EDITION_INSTRUCTION; this.Activate(); // bring to foreground } } catch { // silence exception } finally { splash_screen_done = true; Thread.Sleep(100); // prevent race-condition to allow splashform.Close() } }
static void Main() { Application.SetCompatibleTextRenderingDefault(false); SplashForm s = new SplashForm(); s.Show(); Application.Run(new MainForm(s)); }
public ApplicationWindow() { SplashForm.Show(500); InitializeComponent(); }
private static void Main() { try { Application.EnableVisualStyles(); Application.DoEvents(); SplashForm splashForm = new SplashForm(); splashForm.Show(); splashForm.Refresh(); MainForm mainForm = new MainForm(splashForm); Application.Run(mainForm); } catch (Exception ex) { Messenger.ShowError(ex); } }
static void Main(string[] args) { if (args.Length > 0) { PreInitializeComponents(); //estraggo i parametri nel singleton ProgramParameters ParamCreator creator = new ParamCreator(args); creator.Create(); //adesso in base al tipo di comando (apro un rendoconto esistente o ne creo uno nuovo) //eseguo if (ProgramParameters.Instance.Command == "1") { //RendicontoService r = new RendicontoService(); //r.LoadRendiconto(ProgramParameters.Instance.FileToOpen); //string saldi = r.RetrievePatternSaldiFinaliStatoPatrimoniale(); //apro il rendiconto saltando lo splash screen e il form per la scelta di quele operazione eseguire //IBilancioFormView frm = new FrmBilancio(ProgramParameters.Instance.FileToOpen); Application.Run(new FrmBilancio(ProgramParameters.Instance.FileToOpen)); } else { // a questo punto si tratta di capire cosa si vuole creare: //un rendiconto feneal (provinciale o regionale) o un rendiconto rlst //devo pertanto verificare il rendiconto type: if (ProgramParameters.Instance.RendicontoType == "1") //feneal provinciale { RendicontoHeaderDTO dto = new RendicontoHeaderDTO(); dto.Anno = Convert.ToInt32(ProgramParameters.Instance.Year); dto.Proprietario = "Feneal provinciale"; dto.FileName = ProgramParameters.Instance.FilenameToCreate; dto.Provincia = ProgramParameters.Instance.Provincia; dto.Regione = ProgramParameters.Instance.Regione; dto.IsRegionale = false; dto.SenderTag = "FENEAL"; dto.FolderPath = ProgramParameters.Instance.PathToCreate; //creo il rendiconto RendicontoService r = new RendicontoService(); string rendicontoPath = r.CreateNewRendiconto(dto); //carico il rendiconto r.LoadRendiconto(rendicontoPath); //imposto il saldo iniziale r.SetSaldiInizialiStatoPatrimonialeFromPattern(ProgramParameters.Instance.Saldi); r.Save(); //visualizzo il rendiconto Application.Run(new FrmBilancio(rendicontoPath)); } else if (ProgramParameters.Instance.RendicontoType == "2") //regionale { RendicontoHeaderDTO dto = new RendicontoHeaderDTO(); dto.Anno = Convert.ToInt32(ProgramParameters.Instance.Year); dto.Proprietario = "Feneal regionale"; dto.FileName = ProgramParameters.Instance.FilenameToCreate; dto.Provincia = ProgramParameters.Instance.Provincia; dto.Regione = ProgramParameters.Instance.Regione; dto.IsRegionale = true; dto.SenderTag = "FENEAL"; dto.FolderPath = ProgramParameters.Instance.PathToCreate; //creo il rendiconto RendicontoService r = new RendicontoService(); string rendicontoPath = r.CreateNewRendiconto(dto); //carico il rendiconto r.LoadRendiconto(rendicontoPath); //imposto il saldo iniziale r.SetSaldiInizialiStatoPatrimonialeFromPattern(ProgramParameters.Instance.Saldi); r.Save(); //visualizzo il rendiconto Application.Run(new FrmBilancio(rendicontoPath)); } else //rlst { string template = CreteFreeTemplatePath(Properties.Settings.Default.FileFreeTemplate); string pathRoSave = ProgramParameters.Instance.PathToCreate; RendicontoService r = new RendicontoService(); string rendicontoPath = r.CreateNewRendiconto(template, pathRoSave, ProgramParameters.Instance.FilenameToCreate); //carico il rendiconto r.LoadRendiconto(rendicontoPath); RendicontoHeaderDTO dto = new RendicontoHeaderDTO(); dto.Anno = Convert.ToInt32(ProgramParameters.Instance.Year); dto.Proprietario = "Feneal RLST"; dto.Provincia = ProgramParameters.Instance.Provincia; dto.Regione = ProgramParameters.Instance.Regione; r.RendicontoSendableTag = "RLST"; r.RendicontoHeader = dto; //imposto il saldo iniziale r.SetSaldiInizialiStatoPatrimonialeFromPattern(ProgramParameters.Instance.Saldi); r.Save(); //visualizzo il rendiconto Application.Run(new FrmBilancio(rendicontoPath)); } //creazione di un rendiconto da un template //string bilancioPath = _service.CreateNewRendiconto(template, p); //(percorso template e percorso dove salvare il file) // //dopo aver caricato il bilancio // _service.LoadRendiconto(bilancioPath); //RendicontoHeaderDTO dto = new RendicontoHeaderDTO(); // dto.Anno = _view.SelectedYear; // dto.Proprietario= _view.SelectedProprietario; // dto.Provincia = _view.SelectedProvince; // dto.Regione = _view.SelectedRegion; // _service.RendicontoHeader = dto; // _service.Save(); } return; } AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DevexpressInitializzation(); if (Properties.Settings.Default.IsFeneal && Properties.Settings.Default.IsRlst) { XtraMessageBox.Show("Proprietà RLST e Feneal non ammissibili"); return; } // Initialize custom applicantion context because first the Splash form // will start on the main UI thread and then the form will be replaced // by the main form. _Context = new ApplicationContext(); Application.Idle += new EventHandler(Application_Idle); // Show the splash screen _Splash = new SplashForm(); _Splash.Show(); Application.DoEvents(); // Start main UI thread with the splash screen Application.Run(_Context); //Application.Run(new BilancioFenealgest.UI.UIComponents .Form1()); //inizializzo il servizio geografico //GeoLocationFacade.InitializeInstance(new GeoHandlerClass()); //GeoHandlerProvider.Instance.Geo = GeoLocationFacade.Instance(); }
private static void Main(string[] args) { #if !DEBUG try { #endif Application.ApplicationExit += (s, e) => Properties.Settings.Default.Save(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Environment.CurrentDirectory = ApplicationDirectory; Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture; //Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fr"); //Don't start application if arguments/files were being handled (except --open) if (HandleArguments(args)) { return; } //Check if application is running already if (!Mutex.WaitOne(TimeSpan.Zero, true)) { //Send broadcast to show the window of the current instance. NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero); return; } using (var splash = new SplashForm()) { splash.Show(); splash.SetStatus("Creating folders..."); CreateFolders(); splash.SetStatus("Retrieving OS Version..."); _ = OperatingSystemVersions.CurrentVersion; splash.SetStatus("Loading extensions..."); Loader.LoadExtensions(); splash.SetStatus("Loading backups..."); LoadBackups(); splash.SetStatus("Initializing pages..."); InitializePages(); #if DEBUG splash.SetStatus("Unlocking debug page..."); Pages.Add(new DebugPage()); #endif splash.Hide(); } using (var main = new MainForm()) { Application.Run(main); } #if !DEBUG } catch (Exception ex) { SendCrashReport(ex); throw; } #endif }
public void doSplash() { SplashForm splash = new SplashForm(); splash.Show(); Application.Run(); }
public MainForm() { instance = this; //NeoAxis initialization EngineApp.ConfigName = "user:Configs/WinFormsMultiViewAppExample.config"; if( !WinFormsAppWorld.InitWithoutCreation( new MultiViewAppEngineApp( EngineApp.ApplicationTypes.Simulation ), "user:Logs/WinFormsMultiViewAppExample.log", true, null, null, null, null ) ) { Close(); return; } EngineApp.Instance.Config.RegisterClassParameters( typeof( MainForm ) ); //print information logs to the Output panel. Log.Handlers.InfoHandler += delegate( string text, ref bool dumpToLogFile ) { if( outputForm != null ) outputForm.Print( text ); }; //show splash screen if( showSplashScreenAtStartup && !Debugger.IsAttached ) { Image image = WinFormsMultiViewAppExample.Properties.Resources.ApplicationSplash; SplashForm splashForm = new SplashForm( image ); splashForm.Show(); } InitializeComponent(); //restore window state if( showMaximized ) { Screen screen = Screen.FromControl( this ); if( screen.Primary ) WindowState = FormWindowState.Maximized; } else { Size = new Size( startWindowSize.X, startWindowSize.Y ); } SuspendLayout(); dockPanel = new DockPanel(); dockPanel.Visible = false; dockPanel.Parent = this; dockPanel.Dock = DockStyle.Fill; dockPanel.Name = "dockPanel"; dockPanel.BringToFront(); //create dock forms entityTypesForm = new EntityTypesForm(); dockForms.Add( entityTypesForm ); propertiesForm = new PropertiesForm(); dockForms.Add( propertiesForm ); outputForm = new OutputForm(); dockForms.Add( outputForm ); example3DViewForm = new Example3DViewForm(); dockForms.Add( example3DViewForm ); menuStrip.Visible = false; toolStripGeneral.Visible = false; ResumeLayout(); }
// pas dispo avec le compact framework // [STAThread] static void Main() { try { splash = new SplashForm(); splash.Show(); splash.Label = "Connexion à la base..."; splash.Label = "Vérification des versions..."; if (!CheckVersion()) { throw new Exception("Erreur de version"); } splash.Label = "Création de la fenêtre principale..."; mainform = new Repertoire(); System.Threading.Thread splashClose = new System.Threading.Thread(new System.Threading.ThreadStart(CloseSplash)); splashClose.Start(); System.Windows.Forms.Application.Run(mainform); } catch (SqlCeException e) { SqlCeErrorCollection errorCollection = e.Errors; StringBuilder bld = new StringBuilder(); Exception inner = e.InnerException; if (null != inner) { MessageBox.Show("Inner Exception: " + inner.ToString()); } foreach (SqlCeError err in errorCollection) { bld.Append("\n Error Code: " + err.HResult.ToString("X", CultureInfo.CurrentCulture)); bld.Append("\n Message : " + err.Message); bld.Append("\n Minor Err.: " + err.NativeError); bld.Append("\n Source : " + err.Source); foreach (int numPar in err.NumericErrorParameters) { if (0 != numPar) { bld.Append("\n Num. Par. : " + numPar); } } foreach (string errPar in err.ErrorParameters) { if (errPar.Length > 0) { bld.Append("\n Err. Par. : " + errPar); } } MessageBox.Show(bld.ToString()); bld.Remove(0, bld.Length); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static SplashForm CreateAndShowForm(bool useOwner, bool allowCancel) { SplashForm result = new SplashForm(); if (useOwner) { int n = Application.OpenForms.Count - 1; Form owner = Application.OpenForms[n]; owner.Invoke(new MethodInvoker(() => { result.Owner = owner; WinAPI.EnableWindow(owner.Handle, false); result.Show(owner); })); } else result.Show(); result.buttonAdv1.Enabled = allowCancel; return result; }
private static void Main(string[] args) { #if !DEBUG try { #endif Application.ApplicationExit += (s, e) => Properties.Settings.Default.Save(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Environment.CurrentDirectory = ApplicationDirectory; Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("fr"); //forces french translations to be used //Don't start application if arguments/files were being handled (except --open) if (HandleArguments(args)) { return; } //Check if application is running already if (!Mutex.WaitOne(TimeSpan.Zero, true)) { //Send broadcast to show the window of the current instance. NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero); return; } #region Splash Screen Code using (var splash = new SplashForm()) { splash.Show(); splash.SetStatus(Properties.Strings.Splash_Folders); splash.statusBar.Value = 20; CreateFolders(); splash.SetStatus(Properties.Strings.Splash_DetectOS); _ = OperatingSystemVersions.CurrentVersion; splash.statusBar.Value = 40; splash.SetStatus(Properties.Strings.Splash_Extensions); Loader.LoadExtensions(); splash.statusBar.Value = 60; splash.SetStatus(Properties.Strings.Splash_Backups); LoadBackups(); splash.statusBar.Value = 80; splash.SetStatus(Properties.Strings.Splash_Pages); InitializePages(); splash.statusBar.Value = 100; #if DEBUG splash.SetStatus(Properties.Strings.Splash_Debug); Pages.Add(new DebugPage()); #endif splash.Hide(); } #endregion Splash Screen Code using (var main = new MainForm()) { System.Media.SoundPlayer player = new System.Media.SoundPlayer(Properties.Resources.test); //this loads in the startup sound player.Play(); //it plays said sound Application.Run(main); } #if !DEBUG } catch (Exception ex) { SendCrashReport(ex); throw; } #endif }