public static IBootTimeInformer Show(IServiceProvider provider) { if (!_visible) lock (_showLock) if (!_visible) { var readyEvt = new ManualResetEvent(false); var splashUIThread = new Thread( () => { _form = new SplashForm(provider); var asyncOp = AsyncHelper.CreateOperation(); _closer = () => asyncOp.Post(_form.Close); readyEvt.Set(); Application.Run(_form); }) { IsBackground = true, CurrentCulture = Thread.CurrentThread.CurrentCulture, CurrentUICulture = Thread.CurrentThread.CurrentUICulture }; splashUIThread.SetApartmentState(ApartmentState.STA); splashUIThread.Start(); readyEvt.WaitOne(); // Wait for form creation _visible = true; } return _form; }
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); }
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(); }
/// <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(); }
private static void ShowForm() { frmSplash = new SplashForm(); frmSplash.timer1.Enabled = true; frmSplash.labelVersion.Text = String.Format("Version {0}", Assembly.GetExecutingAssembly().GetName().Version.ToString()); Application.Run(frmSplash); }
public ApplicationContext(string fileName) { _form = new SplashForm(fileName); _form.Show(); _form.Disposed += (s, e) => ExitThread(); }
public MainForm(SplashForm s) { _splashForm = s; InitializeComponent(); Text = Program.AssemblyTitle; _instance = this; Load += MainForm_Load; }
public override void Initialize(SplashForm splash) { for (int i = 0; i < 100; i++) { (splash as SplashWin).Info = i + "%"; Thread.Sleep(25); } }
private static void InternalShow(object progressStepCount) { Debug.Assert(__Form == null); __Form = new SplashForm(); __Form.progressBar1.Maximum = PROGRESS_STEP_ITEM_COUNT * (int)progressStepCount; __Form.Shown += (s, e) => __FormCreatedEvent.Set(); __Form.ShowDialog(); }
public SplashForm(Image image) { instance = this; InitializeComponent(); Size = image.Size; BackgroundImage = image; }
public static SplashForm GetInstance() { if (splashform == null) { splashform = new SplashForm(); } return splashform; }
static void Main() { SplashForm mSplash = new SplashForm(); mSplash.Show(); Application.DoEvents(); MainMDI frm = new MainMDI(); frm.mSplash = mSplash; Application.Run(frm); }
private static void _ShowForm(object param) { BlockingCollection<SplashForm> queue = (BlockingCollection<SplashForm>)param; using (SplashForm splash = new SplashForm()) { queue.Add(splash); Application.Run(splash); } }
public static void Done() { if (frmSplash != null) { frmSplash.SafeClose(); splashThread = null; frmSplash = null; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); SplashForm splash = new SplashForm(ref provider); splash.ShowDialog(); DatabaseInfoForm dbInfoForm = new DatabaseInfoForm(provider); dbInfoForm.Show(dockPanel1, DockState.DockRight); }
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.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); }
public static void Hide() { if (_visible) lock (_showLock) if (_visible) { _visible = false; _closer(); _form = null; } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Settings.Load(); SplashForm splash = new SplashForm(); splash.ShowDialog(); Application.Run(new Form1()); }
public MainForm0() { this.Visible = false; InitializeComponent(); ThreadPool.QueueUserWorkItem(delegate(object state) { SplashForm splash = new SplashForm(); splash.ShowDialog(); this.Invoke(new SetVisibleDelegate(SetVisible)); }); }
static public void Show(int duration) { SplashForm.Instance = new SplashForm(); SplashForm.Instance.uxCloseTimer.Interval = duration; SplashForm.Instance.uxCloseTimer.Tick += delegate { SplashForm.Instance.Dispose(); }; SplashForm.Instance.uxCloseTimer.Start(); SplashForm.Instance.ShowDialog(); }
/// <summary> /// MainForm constructor. /// </summary> private MainForm() { SplashForm splash = new SplashForm(); splash.ShowSplashScreen(); Facade facade = Facade.GetInstance(); // Retrieve messages from inbox mailbox. facade.LoadMessageStore(Constants.Inbox, facade.GetMessageStore()); // Retrieve messages from sent item mailbox. facade.LoadMessageStore(Constants.SentItems, facade.GetMessageStoreSent()); // Retrieve messages from delete item mailbox. facade.LoadMessageStore(Constants.DeletedItems, facade.GetMessageStoreDelete()); // Retrieve messages from custom items mailbox. facade.LoadMessageStore(Constants.CustomFolders, facade.GetMessageStoreCustom()); // retrieve the messages from inbox mailbox. facade.RetrieveMessages(Constants.Inbox); // set the flag for load first message. loadFirstMessageFlag = true; // Use system fonts this.Font = SystemFonts.IconTitleFont; this._findSettings = new FindSettings(); // Designer Generated Code this.InitializeComponent(); // select the mail button. this.leftSpine1.toolStripButtonMail_Click(this, EventArgs.Empty); // closes the splash. splash.CloseSplashScreen(); // if there is no mail accounts. if (Facade.GetInstance().GetDefaultAccountInfo() == null) { SettingsReminderForm settingsReminderForm = new SettingsReminderForm(); DialogResult dr = settingsReminderForm.ShowDialog(); if (dr == DialogResult.OK) { AccountSettingsForm frm = new AccountSettingsForm(); frm.ShowDialog(); } } }
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(); }
public static void Main(String[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); splashForm = new SplashForm(); form = new MainForm(); bugCheckForm = new BugCheckForm(); if (!AppDomain.CurrentDomain.FriendlyName.EndsWith("vshost.exe")) { Application.ThreadException += new ThreadExceptionEventHandler(bugCheckForm.UIThreadExceptionHandler); //Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(bugCheckForm.UnhandledExceptionHandler); } Application.Run(form); }
// public Method to hide the SplashForm public static void Close() { if (MySplashThread == null) return; if (MySplashForm == null) return; try { MySplashForm.Invoke(new MethodInvoker(MySplashForm.Close)); } catch (Exception) { } MySplashThread = null; MySplashForm = null; }
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); }
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 void Start() { if (splash == null) { splash = new SplashForm(); //splash = new MitsarWaitForm(); isStarted = true; } if (splash.Visible==false) { splash.Show(); } Application.DoEvents(); //splash.Opacity = 1; }
public static void ShowSplash() { if (_form != null || _thread != null) return; ThreadStart ts = () => { _form = new SplashForm(); _form.Click += new EventHandler(form_Click); Application.Run(_form); }; _thread = new Thread(ts); _thread.IsBackground = true; _thread.SetApartmentState(ApartmentState.STA); _thread.Name = "SplashForm"; _thread.Start(); }
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 FormLoader(SplashForm splash) { // // Required for Windows Form Designer support // InitializeComponent(); mSplash = splash; UserAbort = false; bRunning = false; MOG_Ini loader = new MOG_Ini(LoaderConfigFile); if (loader.KeyExist("LOADER", "UpdateRun")) { UpdateAndRunCheckBox.Checked = Convert.ToBoolean(loader.GetString("LOADER", "UpdateRun")); } mMainProcess = new Thread(new ThreadStart(this.Process)); mMainProcess.Name = "FormLoader.cs::MainProcessThread"; mMainProcess.Start(); }
// public Method to hide the SplashForm static public void Close() { if (splashThread == null) { return; } if (splashForm == null) { return; } try { splashForm.Invoke(new MethodInvoker(splashForm.Close)); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } splashThread = null; splashForm = null; }
static void Main() { //高Dpi設定 if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Thread to show splash window Thread thUI = new Thread(new ThreadStart(ShowSplashWindow)) { Name = "Splash UI", Priority = ThreadPriority.Highest, IsBackground = true }; thUI.Start(); //Thread to load time-consuming resources. Thread th = new Thread(new ThreadStart(LoadResources)) { Name = "Resource Loader", Priority = ThreadPriority.Normal }; th.Start(); th.Join(); if (SplashForm != null) { SplashForm.Invoke(new MethodInvoker(delegate { SplashForm.Close(); })); } thUI.Join(); Application.Run(new Form1()); }
private static void CreateInstance(Type FormType) { if (_SplashForm == null) { lock (_obj) { object obj = FormType.InvokeMember(null, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null); _SplashForm = obj as SplashForm; _SplashForm.TopMost = true; _SplashForm.ShowInTaskbar = false; _SplashForm.BringToFront(); _SplashForm.StartPosition = FormStartPosition.CenterScreen; if (_SplashForm == null) { throw (new Exception()); } } } }
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; }
void MainFormShown(object sender, EventArgs e) { SplashForm f = new SplashForm(); f.ShowDialog(); /* Check if run by admin (to allow adding ATR into registry) */ WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); bool isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); if (isAdmin) { miATRRegistry.Enabled = true; } else { miATRRegistry.Enabled = false; } StartReaderMonitor(); }
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; }
private bool InitializeDataCollection() { LogWriter writer = LogWriter.Instance; writer.WriteToLog("Execute CollectVersionData()"); SplashForm.ChangeText("Downloading Versions, please wait..."); bool success = getAllVersionAvailable.CollectVersionData(); if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute CollectItemData()"); SplashForm.ChangeText("Downloading Items, please wait..."); success = itemsTab.CollectItemData(getAllVersionAvailable.realm.V); } if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute CollectChampionData()"); SplashForm.ChangeText("Downloading Champions, please wait..."); success = championsTab.CollectChampionData(getAllVersionAvailable.realm.V); } if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute CollectRuneData()"); SplashForm.ChangeText("Downloading Runes, please wait..."); success = runesTab.CollectRuneData(getAllVersionAvailable.realm.V); } if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute CollectMasteryData()"); SplashForm.ChangeText("Downloading Masteries, please wait..."); success = masteriesTab.CollectMasteryData(getAllVersionAvailable.realm.V); } return(success); }
public void Enrolement(String _idVisiteur) { ChangeLabelStatus("Status: Début enrolement."); SplashForm sf = new SplashForm(); sf.affiche("Enrôlement en cour..."); idVisiteur = _idVisiteur; try { DownloadXML(1); TraiterXML(); bio = new Biovein(IP, port, mdp); DownloadXML(0); TraiterXML(); /*on enrole la personne et on récupère le template*/ String template = Enroler(nom, prenom, droits, 1); if (template == "") { ChangeLabelStatus("Status:[Fin] Echec Enrôle."); sf.Close(); return; } /*enregistrement du template dans la base de donnée*/ SendDataToAdd(template, (uint)template.Length); } catch (Exception ex) { Program.LogFich.Error("[BioveinEdenManager] Enrolement() - Erreur : " + ex.ToString()); } /*Fin Enrolement*/ sf.Close(); ChangeLabelStatus("Status: Fin enrolement."); }
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); } }
public bool LoadRiotDataFromFile(string version) { bool success = true; LogWriter writer = LogWriter.Instance; writer.WriteToLog("Execute LoadRiotVersionData()"); if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute LoadRiotItemData()"); SplashForm.ChangeText("Preping Items, please wait..."); success = itemsTab.getItemsFromServer.LoadRiotItemData(version); } if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute LoadRiotChampionData()"); SplashForm.ChangeText("Preping Champions, please wait..."); success = championsTab.getChampionsFromServer.LoadRiotChampionData(version); } if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute LoadRiotRuneData()"); SplashForm.ChangeText("Preping Runes, please wait..."); success = runesTab.getRunesFromServer.LoadRiotRuneData(version); } if (success) { writer = LogWriter.Instance; writer.WriteToLog("Execute LoadRiotMasteryData()"); SplashForm.ChangeText("Preping Masteries, please wait..."); success = masteriesTab.getMasteriesFromServer.LoadRiotMasteryData(version); } return(success); }
/// <summary> /// Executed when a version is selected in the dropdown. Loads the version selected /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void barButtonItemVersionList_ItemClick(object sender, ItemClickEventArgs e) { SplashForm.ShowSplashScreen(); bool success = false; string selName = ""; string selection = ""; try { BarManager barManager = sender as BarManager; selection = barManager.PressedLink.Item.Caption; selName = barManager.PressedLink.Item.Name; success = form1.LoadRiotDataFromFile(selName); if (!success) { success = form1.DataCollection(selName); } } catch (Exception ex) { XtraMessageBox.Show(ex.ToString()); } if (success) { //Performs the update to all tabes form1.UpdateFormWithData(false); //Won't recreate the version drop down list ClearSelectionsFromOldVersion(); //Update dropdown dropDownButtonRiotVersion.Text = selection; } SplashForm.CloseForm(); }
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(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //show splash Thread splashThread = new Thread(new ThreadStart( delegate { splashForm = new SplashForm(); Application.Run(splashForm); } )); splashThread.SetApartmentState(ApartmentState.STA); splashThread.Start(); //run form - time taking operation HomeForm homeForm = new HomeForm(); homeForm.Load += new EventHandler(HomeForm_Load); homeForm.Show(); Application.Run(); }
/// <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(); } } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); bool controlTest = false; if (controlTest) { Application.Run(new Forms.TestForm()); return; } // Вывод сплэша загрузки SplashForm.Label = SharedStrings.AppStartupState; SplashForm.Open(); // Регистрация обработчиков иконок SplashForm.Label = SharedStrings.AppPreviewRegisterState; Preview.Register(); // Регистрация редакторов SplashForm.Label = SharedStrings.AppEditorRegisterState; Editor.Register(); // Установка драйвера файловой системы FileSystem.Driver = new ProjectFileDriver(); // Регистрация всех мыслимых и немыслимых хвостов у формы Forms.CallbackManager.RegisterAll(); // Запуск формы SplashForm.Label = SharedStrings.AppCreatingUIState; Application.Run(new Forms.Common.MainForm()); }
private void btnCancel_Click(object sender, EventArgs e) { SplashForm.Close(); }
private void cboCurrentSystem_SelectedIndexChanged(object sender, EventArgs e) { SplashForm.StartSplash(); LoadSildeBar(); SplashForm.CloseSplash(); }
// 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); } }
private static void Main(string[] ps) { if (ps.Length <= 1) { SplashForm.ShowSplash(11); SplashForm.StepDone(); InitializeUtils.Initialize(Assembly.GetExecutingAssembly()); SplashForm.StepDone(); ErrorDialog.Initialize(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SplashForm.StepDone(); var mainForm = Forms.Main = new MainForm(); SplashForm.StepDone(); var docPanel = mainForm.DockingPanel; SplashForm.StepDone(); Forms.ManifestBrowser = new ManifestBrowser(docPanel); SplashForm.StepDone(); Forms.PropertyEditor = new PropertyEditor(docPanel); SplashForm.StepDone(); Forms.CourseExplorer = new CourseExplorer(docPanel); SplashForm.StepDone(); Forms.CourseDesigner = new CourseDesigner(docPanel); SplashForm.StepDone(); if (ps.Length == 1) { mainForm.OpenCourse(ps[0], true); } SplashForm.StepDone(); Application.Run(mainForm); } else { InitializeUtils.Initialize(Assembly.GetExecutingAssembly()); AllocOrAttachConsole(); if (ps[0].Equals("--upgrade", StringComparison.InvariantCultureIgnoreCase)) { for (var i = 1; i < ps.Length; i++) { var dirName = Path.GetDirectoryName(ps[i]); var fileMask = Path.GetFileName(ps[i]); var files = Directory.GetFiles(dirName, fileMask); foreach (var file in files) { try { Console.Write("Upgrading '{0}'... ", file); if (Course.Course.OpenZipPackage(file)) { Course.Course.SaveToZipPackage(file); } else { Console.WriteLine("ERROR ON OPENNING"); } Console.WriteLine("[DONE]"); } catch (Exception e) { Console.WriteLine("[ERROR]"); Console.WriteLine(e.Message); } } } } FreeConsole(); } }
public ApplicationWindow() { SplashForm.Show(500); InitializeComponent(); }
public MainForm(SplashForm splash) { _splash = splash; InitializeComponent(); }
// internally used as a thread function - showing the form and // starting the messageloop for it static void ShowThread() { splashForm = new SplashForm(BackImages[(new Random()).Next(BackImages.Length - 1)], null, rotatePicture); Application.Run(splashForm); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!File.Exists(@".\splash.png")) { //Assembly assem = this.GetType().Assembly; Assembly assem = System.Reflection.Assembly.GetEntryAssembly(); Stream stream = assem.GetManifestResourceStream("ATEYieldRateStatisticSystem.Resources.Splash.png"); System.Drawing.Image.FromStream(stream).Save("splash.png"); } SplashForm.StartSplash(@".\splash.png", Color.FromArgb(128, 128, 128)); //Application.Run (new SplashForm()); // simulating operations at startup ' if (!p.checkFolder()) { MessageBox.Show("Create app folder fail,program will exit.", "Create Folder Fail", MessageBoxButtons.OK, MessageBoxIcon.Stop); System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } if (!File.Exists(@".\IrisSkin4.dll")) { if (!downloadIrisSkin4()) { System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } } if (!File.Exists(@".\System.Data.SQLite.dll")) { if (!downloadSqliteDll()) { System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } } if (!File.Exists(@".\SQLite.Interop.dll")) { if (!downloadSqliteInterop()) { System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } } if (!File.Exists(@".\MySql.Data.dll")) { if (!downloadMySqlData()) { System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } } if (!p.checkDB(p.LocalDB)) { System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } if (!File.Exists(p.AppFolder + @"\MacOS.ssk")) { if (!downloadSkin()) { System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } } //MessageBox.Show(p.AppStart.ToString()); //check ini file if (!File.Exists(p.iniFilePath)) { p.createIniFile(p.iniFilePath); } p.readIniValue(p.iniFilePath);//exits,read ini file p.autoSelectConnstring(); //create mysql db string result = ""; if (!p.createDB(p.connstringNoDB, out result)) { if (p.AppStart == p.AppStartModel.ATEClient) { MessageBox.Show(result + ",the data will record in the local db."); } if (p.AppStart == p.AppStartModel.YRServer) { MessageBox.Show(result + "the program will exit..."); System.Threading.Thread.Sleep(1000); SplashForm.CloseSplash(); Environment.Exit(0); } } else { if (!p.createMysqlTable(p.connString, out result)) { MessageBox.Show(result); } } System.Threading.Thread.Sleep(1000); // close the splash screen' SplashForm.CloseSplash(); //創建桌面快捷方式 //Shortcut.Shortcut.CreateShortcut(Shortcut.Shortcut.GetDeskDir() + "\\ATEYieldRateStatisticSystem.lnk",Application.StartupPath + @"\\ATEYieldRateStatisticSystem", Shortcut.Shortcut.GetDeskDir(), "ATEYieldRateStatisticSystem", AppDomain.CurrentDomain.BaseDirectory + "favicon.ico"); Shortcut.Shortcut.CreateDesktopShortcut(Application.StartupPath + "\\ATEYieldRateStatisticSystem.lnk", "ATEYieldRateStatisticSystem"); //創建開機啟動 //UICmd("正在读取 全局用户开始菜单启动文件夹"); p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "正在读取 全局用户开始菜单启动文件夹"); string commonStartup = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup); // UICmd("CommonStartup:" + commonStartup); if (ShortcutTool.Create(commonStartup, AppName, AppFile)) { p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 全局用户开始菜单启动 成功"); } else { p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 全局用户开始菜单启动 失败"); } p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "正在读取 当前用户开始菜单启动文件夹"); string startup = Environment.GetFolderPath(Environment.SpecialFolder.Startup); //UICmd("Startup:" + startup); p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "Startup:" + startup); if (ShortcutTool.Create(startup, AppName, AppFile)) { //UICmd("添加 当前用户开始菜单启动 成功"); p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 当前用户开始菜单启动 成功"); } else { //UICmd("添加 当前用户开始菜单启动 失败"); p.saveLog(DateTime.Now.ToString("HH:mm:ss") + "->" + "添加 当前用户开始菜单启动 失败"); } if (p.AppStart == p.AppStartModel.ATEClient) { Application.Run(new frmATEClient()); } else if (p.AppStart == p.AppStartModel.YRServer) { //Application.Run(new frmYRMonitor()); Application.Run(new frmYROverAll()); } //Application.Run(new frmQueryFR()); //Application.Run(new frmFTYR()); //Application.Run(new frmYRbyLine()); else { Application.Run(new frmMain()); } }
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 }
static void ShowThread() { MySplashForm = new SplashForm(); MySplashForm.StatusInfo = text; Application.Run(MySplashForm); }
/// <summary> /// 显示启动界面线程函数 /// </summary> private static void ShowSplashForm() { m_splashForm = new SplashForm(); Application.Run(m_splashForm); }
protected override void OnCreateSplashScreen() { SplashScreen = new SplashForm(); }
static private void ShowForm(string txt) { splashForm = new SplashForm(); splashForm.label1.Text = txt; Application.Run(splashForm); }
public MyApplicationContext() { splashForm = new SplashForm(); base.MainForm = splashForm; }