public Boolean attemptPushToGUI() { if (!isGUIActive()) { if (isLoggedIn()) { if (alMessages != null) { if (alMessages.Count > 0) { String msg = (String)alMessages[0]; alMessages.RemoveAt(0); gui = new FrmUI(); gui.Left = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - gui.Width; gui.Top = 0; gui.setMessage(msg); gui.Height = 150; gui.Opacity = 0; gui.Show(); while (gui.Opacity < 1) { gui.Opacity += 0.01; gui.Refresh(); try { System.Threading.Thread.Sleep(5); } catch { } } try { for (int i = 10; i > 0; i--) { gui.setTime(i); gui.Refresh(); System.Threading.Thread.Sleep(1000); } } catch { } while (gui.Opacity > 0) { gui.Opacity -= 0.01; gui.Refresh(); try { System.Threading.Thread.Sleep(5); } catch { } } gui.Visible = false; gui.Refresh(); gui.Close(); return(true); } } } } return(false); }
public Boolean attemptPushToGUI() { if ( !isGUIActive()) { if (isLoggedIn()) { if (alMessages != null) { if (alMessages.Count > 0) { String msg = (String)alMessages[0]; alMessages.RemoveAt(0); gui = new FrmUI(); gui.Left = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - gui.Width; gui.Top = 0; gui.setMessage(msg); gui.Height = 150; gui.Opacity = 0; gui.Show(); while (gui.Opacity < 1) { gui.Opacity += 0.01; gui.Refresh(); try { System.Threading.Thread.Sleep(5); } catch { } } try { for (int i = 10; i > 0; i--) { gui.setTime(i); gui.Refresh(); System.Threading.Thread.Sleep(1000); } } catch { } while( gui.Opacity > 0 ) { gui.Opacity -= 0.01; gui.Refresh(); try { System.Threading.Thread.Sleep(5); } catch { } } gui.Visible = false; gui.Refresh(); gui.Close(); return true; } } } } return false; }