/// <summary>
        /// Start tracking the provided popup.
        /// </summary>
        /// <param name="popup">Popup instance to track.</param>
        public void StartTracking(VisualPopup popup)
        {
            Debug.Assert(popup != null);
            Debug.Assert(!popup.IsDisposed);
            Debug.Assert(popup.IsHandleCreated);
            Debug.Assert(_suspended == 0);

            // The popup control must be valid
            if ((popup != null) && !popup.IsDisposed && popup.IsHandleCreated)
            {
                // Cannot start tracking when a popup menu is alive
                if (_suspended == 0)
                {
                    // If we already have a popup...
                    if (_current != null)
                    {
                        // Then stack it
                        _stack.Push(_current);
                    }
                    else
                    {
                        // Cache the currently active window
                        _activeWindow = PI.GetActiveWindow();

                        // For the first popup, we hook into message processing
                        FilterMessages(true);
                    }

                    // Store reference
                    _current = popup;
                }
            }
        }
Esempio n. 2
0
        private void RunInstantTest(int numPopups)
        {
            // make sure there are popups
            if (numPopups < 1)
            {
                throw new Exception("numPopups must be at least 1.");
            }

            // instantly create popups
            for (int i = 0; i < numPopups; ++i)
            {
                _popupStack.Push <Popup>(_testPopup);
            }

            // instantly destroy popups
            for (int i = 0; i < numPopups; ++i)
            {
                _popupStack.Pop();
            }
        }
Esempio n. 3
0
 public void NextScene(string SceneName)
 {
     if (SceneName != "Popup")
     {
         PushSceneName(Application.loadedLevelName);
         SceneManager.LoadScene(SceneName);
     }
     else
     {
         PopupStack.Push(Instantiate(Resources.Load <GameObject>("Popup"), GameObject.Find("Canvas").transform));
     }
     //Test Git
 }