public static void Close() { if (_SplashThread == null || _SplashForm == null) return; try { _SplashForm.Invoke(new System.Windows.Forms.MethodInvoker(_SplashForm.Close)); } catch (Exception) { } _SplashThread = null; _SplashForm = null; }
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()); } } } }
/// <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; }
public void ActionDestroy() { if (!IsVisible) return; spx.Dispose(); spx = null; IsVisible = false; if (AutoHide) { MainForm.Show(); MainForm.BringToFront(); } }
void Create() { if (spx!=null) { spx.Dispose(); spx = null; } spx = new SplashForm(); spx.StartPosition = FormStartPosition.CenterScreen; spx.Closed += Event_Splash_Hide; spx.Size = ClientSize; spx.BackgroundImage = BackgroundImage; }
void IDisposable.Dispose() { if (this.spx!=null) { spx.Dispose(); spx = null; BackgroundImage.Dispose(); BackgroundImage = null; } }
public static void StartSplash(bool showProgress, bool supportCancellation, string text, Action action) { if (f == null) { sp = new SplashControl(); sp.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(SplashControl_ProgressChanged); sp.Dock = DockStyle.Fill; f = new SplashForm(); f.ClientSize = sp.Size; f.Controls.Add(sp); } sp.progressBarX1.Value = 0; sp.ShowProgress = showProgress; sp.SupportCancellation = supportCancellation; sp.Text = text; sp.backgroundWorker1.RunWorkerAsync(action); f.ShowDialog(); if (sp.innerException != null) throw sp.innerException; }
public static void SetProgressParams(int min, int max,bool showProgressBarPercent) { if (f == null) { sp = new SplashControl(); sp.Dock = DockStyle.Fill; f = new SplashForm(); f.ClientSize = sp.Size; f.Controls.Add(sp); } sp.progressBarX1.Minimum = min; sp.progressBarX1.Maximum = max; sp.progressBarX1.TextVisible = showProgressBarPercent; }
/// <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; }
public Editor() { #if TRIAL var form = new SplashForm(); form.ShowDialog(); #endif Load += new EventHandler(Editor_Load); InitializeComponent(); SetupEvents(); SetupTimer(); SetupBrowser(); SetupFontComboBox(); SetupFontSizeComboBox(); boldButton.CheckedChanged += delegate { if (BoldChanged != null) BoldChanged(); }; italicButton.CheckedChanged += delegate { if (ItalicChanged != null) ItalicChanged(); }; underlineButton.CheckedChanged += delegate { if (UnderlineChanged != null) UnderlineChanged(); }; orderedListButton.CheckedChanged += delegate { if (OrderedListChanged != null) OrderedListChanged(); }; unorderedListButton.CheckedChanged += delegate { if (UnorderedListChanged != null) UnorderedListChanged(); }; justifyLeftButton.CheckedChanged += delegate { if (JustifyLeftChanged != null) JustifyLeftChanged(); }; justifyCenterButton.CheckedChanged += delegate { if (JustifyCenterChanged != null) JustifyCenterChanged(); }; justifyRightButton.CheckedChanged += delegate { if (JustifyRightChanged != null) JustifyRightChanged(); }; justifyFullButton.CheckedChanged += delegate { if (JustifyFullChanged != null) JustifyFullChanged(); }; linkButton.CheckedChanged += delegate { if (IsLinkChanged != null) IsLinkChanged(); }; }
/// <summary> /// Called when the timer fires to synchronize the format buttons /// with the text editor current selection. /// SetupKeyListener if necessary. /// Set bold, italic, underline and link buttons as based on editor state. /// Synchronize the font combo box and the font size combo box. /// Finally, fire the Tick event to allow external components to synchronize /// their state with the editor. /// </summary> /// <param name="sender">the sender</param> /// <param name="e">EventArgs</param> private void timer_Tick(object sender, EventArgs e) { if (!init_timer) { ParentForm.FormClosed += new FormClosedEventHandler(ParentForm_FormClosed); init_timer = true; lastSplash = DateTime.Now; } // don't process until browser is in ready state. if (ReadyState != ReadyState.Complete) return; #if TRIAL if (DateTime.Now.Subtract(lastSplash).TotalMinutes > 10) { lastSplash = DateTime.Now; var dlg = new SplashForm(); dlg.ShowDialog(); } #endif SetupKeyListener(); boldButton.Checked = IsBold(); italicButton.Checked = IsItalic(); underlineButton.Checked = IsUnderline(); orderedListButton.Checked = IsOrderedList(); unorderedListButton.Checked = IsUnorderedList(); justifyLeftButton.Checked = IsJustifyLeft(); justifyCenterButton.Checked = IsJustifyCenter(); justifyRightButton.Checked = IsJustifyRight(); justifyFullButton.Checked = IsJustifyFull(); linkButton.Enabled = CanInsertLink(); UpdateFontComboBox(); UpdateFontSizeComboBox(); UpdateImageSizes(); if (Tick != null) Tick(); }
/// <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; }