Inheritance: Tibialyzer.SimpleNotification
Ejemplo n.º 1
0
 public static void CloseSuspendedWindow()
 {
     lock (suspendedLock) {
         if (window != null) {
             window.Close();
             window = null;
         }
     }
 }
Ejemplo n.º 2
0
        public static void ShowSuspendedWindow(bool alwaysShow = false)
        {
            lock (suspendedLock) {
                if (window != null)
                {
                    window.Close();
                    window = null;
                }
                Screen  screen;
                Process tibia_process = ProcessManager.GetTibiaProcess();
                if (tibia_process == null)
                {
                    screen = Screen.FromControl(MainForm.mainForm);
                }
                else
                {
                    screen = Screen.FromHandle(tibia_process.MainWindowHandle);
                }
                window = new AutoHotkeySuspendedMode(alwaysShow);
                int position_x = 0, position_y = 0;

                int suspendedX = SettingsManager.getSettingInt("SuspendedNotificationXOffset");
                int suspendedY = SettingsManager.getSettingInt("SuspendedNotificationYOffset");

                int xOffset = suspendedX < 0 ? 10 : suspendedX;
                int yOffset = suspendedY < 0 ? 10 : suspendedY;
                int anchor  = SettingsManager.getSettingInt("SuspendedNotificationAnchor");
                switch (anchor)
                {
                case 3:
                    position_x = screen.WorkingArea.Right - xOffset - window.Width;
                    position_y = screen.WorkingArea.Bottom - yOffset - window.Height;
                    break;

                case 2:
                    position_x = screen.WorkingArea.Left + xOffset;
                    position_y = screen.WorkingArea.Bottom - yOffset - window.Height;
                    break;

                case 0:
                    position_x = screen.WorkingArea.Left + xOffset;
                    position_y = screen.WorkingArea.Top + yOffset;
                    break;

                default:
                    position_x = screen.WorkingArea.Right - xOffset - window.Width;
                    position_y = screen.WorkingArea.Top + yOffset;
                    break;
                }

                window.StartPosition = FormStartPosition.Manual;
                window.SetDesktopLocation(position_x, position_y);
                window.TopMost = true;
                window.Show();
            }
        }
Ejemplo n.º 3
0
 public static void CloseSuspendedWindow()
 {
     lock (suspendedLock) {
         if (window != null)
         {
             window.Close();
             window = null;
         }
     }
 }
Ejemplo n.º 4
0
        public static void ShowSuspendedWindow(bool alwaysShow = false)
        {
            lock (suspendedLock) {
                if (window != null) {
                    window.Close();
                    window = null;
                }
                Screen screen;
                Process tibia_process = ProcessManager.GetTibiaProcess();
                if (tibia_process == null) {
                    screen = Screen.FromControl(MainForm.mainForm);
                } else {
                    screen = Screen.FromHandle(tibia_process.MainWindowHandle);
                }
                window = new AutoHotkeySuspendedMode(alwaysShow);
                int position_x = 0, position_y = 0;

                int suspendedX = SettingsManager.getSettingInt("SuspendedNotificationXOffset");
                int suspendedY = SettingsManager.getSettingInt("SuspendedNotificationYOffset");

                int xOffset = suspendedX < 0 ? 10 : suspendedX;
                int yOffset = suspendedY < 0 ? 10 : suspendedY;
                int anchor = SettingsManager.getSettingInt("SuspendedNotificationAnchor");
                switch (anchor) {
                    case 3:
                        position_x = screen.WorkingArea.Right - xOffset - window.Width;
                        position_y = screen.WorkingArea.Bottom - yOffset - window.Height;
                        break;
                    case 2:
                        position_x = screen.WorkingArea.Left + xOffset;
                        position_y = screen.WorkingArea.Bottom - yOffset - window.Height;
                        break;
                    case 0:
                        position_x = screen.WorkingArea.Left + xOffset;
                        position_y = screen.WorkingArea.Top + yOffset;
                        break;
                    default:
                        position_x = screen.WorkingArea.Right - xOffset - window.Width;
                        position_y = screen.WorkingArea.Top + yOffset;
                        break;
                }

                window.StartPosition = FormStartPosition.Manual;
                window.SetDesktopLocation(position_x, position_y);
                window.TopMost = true;
                window.Show();
            }
        }
Ejemplo n.º 5
0
        private void CloseSuspendedWindow()
        {
            lock (suspendedLock) {
                if (window != null && !window.IsDisposed) {
                    try {
                        window.Close();
                    } catch {

                    }
                    window = null;
                }
            }
        }