예제 #1
0
        protected override void SetUpUIElementReferenceImple()
        {
            base.SetUpUIElementReferenceImple();
            IPopUp popUp = (IPopUp)GetUIElement();

            popUp.SetUpPopUpHierarchy();
        }
예제 #2
0
        public override void SetUpReference()
        {
            base.SetUpReference();
            IPopUp targetPopUp = targetPopUpAdaptor.GetPopUp();

            thisPopUpButton.SetTargetPopUp(targetPopUp);
        }
        public override void SetUpReference()
        {
            IPopUp targetPopUp = CollectTargetPopUp();

            base.SetUpReference();
            thisButton.SetPopUp(targetPopUp);
        }
예제 #4
0
        public override void SetUpReference()
        {
            base.SetUpReference();
            IPopUp popUp = howToPlayPopUpAdaptor.GetPopUp();

            thisHowToPlayCloseButton.SetHowToPlayPopUp(popUp);
        }
예제 #5
0
        }     //constructor

        //
        //

        /*
         * // defunct
         * public Header(IEngineContainer container)
         * {
         *  m_ParentCluster = container;
         *  InitializeComponent();
         *
         *  // Initialize Header - unique in each Cluster, 1-to-1 with EngineContainer.
         *  this.txtName.Text = container.EngineContainerName;
         *  m_EngineContainerID = container.EngineContainerID;
         *
         *  // Create controls (per engine) for this EngineContainer.
         *  this.SuspendLayout();
         *  List<IEngine> engineList = container.GetEngines();
         *  foreach (IEngine engine in engineList)
         *  {
         *      IEngineControl pControl = engine.GetControl();          // Get popup insert control for this engine.
         *      m_EngineControlList.Add((IEngine)pControl);              // allow "null" if the engine lacks a control,
         *      if (pControl != null)                                   // each engine has entry here, even if its null. (but why?)
         *      {   // Create a popup control
         *          PopUp1 popup = new PopUps.PopUp1(this);             // load any IPopUp object here!
         *          //popup.Title = string.Format("{0} {1}",container.EngineContainerName,engine.EngineName);
         *          popup.Title = string.Format("{0}", engine.EngineName);// Text on small, custom top blue bar.
         *          popup.Text = m_ParentCluster.EngineContainerName;	// Text on the top of Window.
         *          popup.AddControl(pControl);
         *          int engineID = ((IEngine)pControl).EngineID;
         *          m_PopUpList.TryAdd(engineID,popup);                 // look up table for processing events.
         *          //Label button = CreateMenuButton(engine);          // Create a button to get popup.
         *      }
         *      // new buttons
         *      comboBoxEngines.Items.Add(string.Format("{0}: {1}", engine.EngineID.ToString(), engine.EngineName));
         *      //comboBoxEngines.Items.Add(engine.EngineName);
         *
         *  }//next engine
         *  this.ResumeLayout(false);
         * }//constructor
         */
        //
        //
        //
        #endregion//Constructors

        #region Public Methods
        // *****************************************************************
        // ****                     Public Methods                      ****
        // *****************************************************************
        //
        //
        // ****         Process EngineEvent ()          ****
        //
        /// <summary>
        /// Called from cluster to process engine events it received from StrategyHub.
        /// </summary>
        /// <param name="eArgs"></param>
        public bool ProcessEngineEvent(EngineEventArgs eArgs)
        {
            bool          regenerateNow = false;
            List <string> popUpNames    = null;

            if (m_EngineIDToPopups.TryGetValue(eArgs.EngineID, out popUpNames))
            {
                foreach (string popUpName in popUpNames)
                {
                    IPopUp  popUp         = m_PopupList[popUpName];
                    IEngine engineControl = (IEngine)popUp.CustomControl;

                    engineControl.ProcessEvent(eArgs);
                    //if (popUpName.Contains("Pricing"))
                    //    regenerateNow = popUp.Visible || regenerateNow;
                    IsRegenerateRequired = IsRegenerateRequired || engineControl.IsUpdateRequired;
                    bool isEngineUpdateDesired = engineControl.IsUpdateRequired && popUp.Visible && (engineControl is FrontEnds.Graphs.ZGraphControl) == false;
                    //regenerateNow = engineControl.IsUpdateRequired || regenerateNow;
                    regenerateNow = isEngineUpdateDesired || regenerateNow;
                    //Form form = (Form)popUp;
                    //if (popUp.Visible && form.WindowState != FormWindowState.Minimized)
                    //{
                    //       popUp.CustomControl.Regenerate(this, null);
                    //}
                }
            }
            //IsRegenerateRequired = regenerateNow || IsRegenerateRequired;
            return(regenerateNow);
        }//ProcessEngineEvent()
예제 #6
0
        public void AddChildPopUp(IPopUp childPopUp)
        {
            List <IPopUp> resultList = new List <IPopUp>(thisChildrenPopUp);

            resultList.Add(childPopUp);
            thisChildrenPopUp = resultList.ToArray();
        }
예제 #7
0
        protected override IPopUp FindProximateParentPopUp()
        {
            IPopUp parentPopUp = Substitute.For <IPopUp>();
            IPopUp nullPopUp   = null;

            parentPopUp.GetProximateParentPopUp().Returns(nullPopUp);
            return(parentPopUp);
        }
예제 #8
0
        protected override void SetUpUIElementReferenceImple()
        {
            base.SetUpUIElementReferenceImple();
            IPopUp       popUp       = (IPopUp)targetPopUpAdaptor.GetUIElement();
            IPopUpButton popUpButton = (IPopUpButton)GetUIElement();

            popUpButton.SetTargetPopUp(popUp);
        }
예제 #9
0
 public void AddPop(string name, IPopUp popup)
 {
     if (_popupToStringInScene.ContainsKey(name))
     {
         _popupToStringInScene.Remove(name);
     }
     _popupToStringInScene.Add(name, popup);
 }
예제 #10
0
 public Widget(ProjectObject projectWidget, IPopUp widgetPopUp, IDialog dialog)
 {
     _projectWidget = projectWidget ?? throw new
                            NullReferenceException("ProjectWidget is null");
     this._widgetPopUp = widgetPopUp;
     this.dialog       = dialog ?? throw new NullReferenceException("Dialog is null");
     this.dialog.SetProjectObject(_projectWidget);
     DesignWidget();
 }
예제 #11
0
 public HighScoresPage(Game1 game)
 {
     this.game        = game;
     highScoresLabel  = SpriteFactory.Instance.HighScoresSprite(new Vector2((game.Dimensions.X - 68) / 2, 10));
     highScoresScreen = SpriteFactory.Instance.HighScreenSprite(new Vector2());
     top3             = SpriteFactory.Instance.Top3Sprite(new Vector2());
     popUpDisplayed   = false;
     warning          = new ClearConfirmPopUp(game);
 }
예제 #12
0
    public void HideShownChildPopUpsRecursively_ChildIsActivated_ChildIsShown_CallsItInSequence()
    {
        IPopUpConstArg arg   = CreateMockArg();
        TestPopUp      popUp = new TestPopUp(arg);

        popUp.SetUpPopUpHierarchy();

        List <IPopUp> calledChildrent = new List <IPopUp>();

        for (int i = 0; i < 3; i++)
        {
            IPopUp childPopUp = Substitute.For <IPopUp>();
            childPopUp.IsActivated().Returns(true);
            childPopUp.IsShown().Returns(true);
            popUp.RegisterProximateChildPopUp(childPopUp);
            calledChildrent.Add(childPopUp);
        }
        List <IPopUp> notCalledChildren = new List <IPopUp>();

        for (int i = 0; i < 3; i++)
        {
            IPopUp childPopUp = Substitute.For <IPopUp>();
            childPopUp.IsActivated().Returns(false);
            childPopUp.IsShown().Returns(true);
            popUp.RegisterProximateChildPopUp(childPopUp);
            notCalledChildren.Add(childPopUp);
        }
        List <IPopUp> notCalledChildren2 = new List <IPopUp>();

        for (int i = 0; i < 3; i++)
        {
            IPopUp childPopUp = Substitute.For <IPopUp>();
            childPopUp.IsActivated().Returns(true);
            childPopUp.IsShown().Returns(false);
            popUp.RegisterProximateChildPopUp(childPopUp);
            notCalledChildren2.Add(childPopUp);
        }

        popUp.HideShownChildPopUpsRecursively();

        foreach (IPopUp childPopUp in calledChildrent)
        {
            childPopUp.Received(1).Hide(false);
            childPopUp.Received(1).HideShownChildPopUpsRecursively();
        }
        foreach (IPopUp childPopUp in notCalledChildren)
        {
            childPopUp.DidNotReceive().Hide(false);
            childPopUp.DidNotReceive().HideShownChildPopUpsRecursively();
        }
        foreach (IPopUp childPopUp in notCalledChildren2)
        {
            childPopUp.DidNotReceive().Hide(false);
            childPopUp.DidNotReceive().HideShownChildPopUpsRecursively();
        }
    }
예제 #13
0
        public void AddToQueue(IPopUp popUp)
        {
            popUpControllers.Enqueue(popUp);
            popUp.OnClose += PopUp_OnClose;

            if (popUpControllers.Count == 1)
            {
                MoveNext();
            }
        }
예제 #14
0
        public override void SetUpReference()
        {
            base.SetUpReference();
            IPopUp popUp = howToPlayPopUpAdaptor.GetPopUp();

            thisHowToPlayButton.SetHowToPlayPopUp(popUp);
            IUIElementGroupScroller scroller = (IUIElementGroupScroller)howToPlayScrollerAdaptor.GetUIElement();

            thisHowToPlayButton.SetHowToPlayScroller(scroller);
        }
예제 #15
0
 public void InitializePageMethods()
 {
     _iPopUp                     = new PopUp(_driver);
     _iBasePageObjects           = new BasePageObjects();
     _iBasePageObjects.Driver    = _driver;
     _iBasePageObjects.PageTitle = "Lowe's Canada: Home Improvement, Appliances, Tools, Bathroom, Kitchen";
     _iBasePageObjects.PageUrl   = "https://www.lowes.ca";
     _iBasePageObjects.Wait      = new WebDriverWait(_driver, TimeSpan.FromMinutes(2));
     Homepage                    = new HomePage(_iPopUp, _iBasePageObjects);
 }
예제 #16
0
        }//RegenerateNow()

        //
        #endregion//Public Methods


        #region Private Methods
        // *****************************************************************
        // ****                     Private Methods                     ****
        // *****************************************************************
        //
        //
        // ****         CreateMenuButton            ****
        //
        /// <summary>
        /// This creates and places a small click-able label used as a menu entry
        /// to have access to a paritcular engine parameter control panel.
        /// </summary>

        /*
         * private Label CreateMenuButton(IEngine engine)
         * {
         *  Label label = new System.Windows.Forms.Label();
         *
         *  label.Anchor = System.Windows.Forms.AnchorStyles.Right;
         *  label.BackColor = System.Drawing.Color.Transparent;
         *  label.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
         *  //label.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
         *  label.Font = new System.Drawing.Font("Segoe Condensed", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
         *  //this.bParameter.Font = new System.Drawing.Font("Wingdings", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2)));
         *  label.ForeColor = System.Drawing.Color.LightGray;
         *
         *  label.Margin = new System.Windows.Forms.Padding(0);
         *  label.Name = engine.EngineID.ToString();                // use button name to get associated popup!
         *  label.Size = new System.Drawing.Size(20, 20);
         *  label.TabIndex = 2;
         *  label.Text = engine.EngineName.Substring(0, 1);          //
         *  label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
         *  label.Click += new System.EventHandler(MenuButton_Click);
         *  this.Controls.Add(label);
         *
         *  // location
         *  label.Location = new System.Drawing.Point(m_NextMenuButtonLoc.X, m_NextMenuButtonLoc.Y);
         *  m_NextMenuButtonLoc = new System.Drawing.Point(m_NextMenuButtonLoc.X - label.Width, m_NextMenuButtonLoc.Y);
         *
         *  // Exit
         *  return label;
         * }//CreateMenuButton()
         */
        //
        //
        // *****************************************************
        // ****             Close All PopUps                ****
        // *****************************************************
        private void CloseAllPopUps(IPopUp exceptThisPopUp)
        {
            foreach (IPopUp popUp in m_PopupList.Values)
            {
                if (!popUp.Equals(exceptThisPopUp))
                {
                    popUp.Visible = false;
                }
            }
        }//CloseAllPopUps
예제 #17
0
    public void IsAncestorOf_Child_ReturnsTrue()
    {
        IPopUpConstArg arg        = CreateMockArg();
        TestPopUp      popUp      = new TestPopUp(arg);
        IPopUp         childPopUp = Substitute.For <IPopUp>();

        childPopUp.GetProximateParentPopUp().Returns(popUp);

        Assert.That(popUp.IsAncestorOf(childPopUp), Is.True);
    }
        public override void SetUpReference()
        {
            base.SetUpReference();
            IGameplayWidget widget = gameplayWidgetAdaptor.GetGameplayWidget();

            thisQuitButton.SetGameplayWidget(widget);

            IPopUp popUp = pauseMenuPopUpAdaptor.GetPopUp();

            thisQuitButton.SetPauseMenuPopUp(popUp);
        }
예제 #19
0
        void PopUp_OnClose(object sender, EventArgs e)
        {
            IPopUp iSender = sender as IPopUp;

            iSender.OnClose -= PopUp_OnClose;

            var old = popUpControllers.Dequeue();

            Assert.AreEqual(iSender, old);

            MoveNext();
        }
예제 #20
0
    public void RegisterPopUp_CallsPopUpToRegisterShowHidden()
    {
        IPopUp           popUpToRegister = Substitute.For <IPopUp>();
        IUIElement       rootUIElement   = Substitute.For <IUIElement>();
        TestPopUpManager popUpManager    = new TestPopUpManager();

        popUpManager.SetRootUIElement(rootUIElement);

        popUpManager.RegisterPopUp(popUpToRegister);

        popUpToRegister.Received(1).ShowHiddenProximateParentPopUpRecursively();
    }
예제 #21
0
 public PopUpStateEngineConstArg(
     IUISystemProcessFactory processFactory,
     IPopUp popUp,
     IPopUpManager popUpManager,
     PopUpMode popUpMode
     )
 {
     thisProcessFactory = processFactory;
     thisPopUp          = popUp;
     thisPopUpManager   = popUpManager;
     thisPopUpMode      = popUpMode;
 }
예제 #22
0
    public void UnregiterPopUp_CallsPopUpToUnregHideShow()
    {
        IUIElement       rootUIElement = Substitute.For <IUIElement>();
        TestPopUpManager popUpManager  = new TestPopUpManager();

        popUpManager.SetRootUIElement(rootUIElement);
        IPopUp popUpToUnreg = Substitute.For <IPopUp>();

        popUpManager.UnregisterPopUp(popUpToUnreg);

        popUpToUnreg.Received(1).HideShownChildPopUpsRecursively();
    }
        public void TogglePopUp()
        {
            IPopUp popUp = (IPopUp)popUpAdaptor.GetUIElement();

            if (popUp.IsShown())
            {
                popUp.Hide(false);
            }
            else
            {
                popUp.Show(true);
            }
        }
예제 #24
0
    public void RegisterPopUp_ActivePopUpNull_CallsRootUIEPopUpDisableRecursively()
    {
        IUIElement       rootUIE         = Substitute.For <IUIElement>();
        IPopUp           popUpToRegister = Substitute.For <IPopUp>();
        TestPopUpManager popUpManager    = new TestPopUpManager();

        popUpManager.SetRootUIElement(rootUIE);
        popUpManager.SetActivePopUp_Test(null);

        popUpManager.RegisterPopUp(popUpToRegister);

        rootUIE.Received(1).PopUpDisableRecursivelyDownTo(popUpToRegister);
    }
예제 #25
0
    public void RegisterPopUp_SetsActivePopUp()
    {
        IUIElement       rootUIE      = Substitute.For <IUIElement>();
        TestPopUpManager popUpManager = new TestPopUpManager();

        popUpManager.SetRootUIElement(rootUIE);
        IPopUp popUpToRegister = Substitute.For <IPopUp>();

        popUpManager.RegisterPopUp(popUpToRegister);

        IPopUp actual = popUpManager.GetActivePopUp_Test();

        Assert.That(actual, Is.SameAs(popUpToRegister));
    }
 void DisableOthers(IPopUp disablingPopUp)
 {
     if (thisActivePopUp == null)
     {
         thisRootUIElement.PopUpDisableRecursivelyDownTo(disablingPopUp);
     }
     else
     {
         if (disablingPopUp.IsAncestorOf(thisActivePopUp))
         {
             return;
         }
         thisActivePopUp.PopUpDisableRecursivelyDownTo(disablingPopUp);
     }
 }
예제 #27
0
        IWidget CreateButton()
        {
            IPopUp popup  = null;
            var    button = new Button(UIStyle, "Get Ice Cream!")
            {
                OnActionPerformed = (s, a) =>
                {
                    popup?.Close();
                    popup = Screen?.PopUpManager?.ShowConfirmDialog(new Point(600, 250), UIStyle, "Oh noes!",
                                                                    "It melted already. Sorry.");
                }
            };

            return(button);
        }
예제 #28
0
    public void ShowHiddenProximateParentPopUpRecursively_ProxParNotNull_ProxParIsHidden_CallsItInSequence()
    {
        IPopUpConstArg arg   = CreateMockArg();
        TestPopUp      popUp = new TestPopUp(arg);

        popUp.SetUpPopUpHierarchy();
        IPopUp parentPopUp = popUp.GetProximateParentPopUp();

        parentPopUp.IsHidden().Returns(true);

        popUp.ShowHiddenProximateParentPopUpRecursively();

        parentPopUp.Received(1).Show(false);
        parentPopUp.Received(1).ShowHiddenProximateParentPopUpRecursively();
    }
        public override void SetUpReference()
        {
            base.SetUpReference();
            IPopUpManager manager = CreatePopUpMnager();

            thisPopUp.SetPopUpManager(manager);

            IPopUp parentPopUp = FindProximateParentTypedUIElement <IPopUp>();

            thisPopUp.SetParentPopUp(parentPopUp);
            if (parentPopUp != null)
            {
                parentPopUp.AddChildPopUp(thisPopUp);
            }
        }
        void ReverseDisableOthers(IPopUp enablingPopUp)
        {
            IPopUp parentPopUp = enablingPopUp.GetParentPopUp();

            if (parentPopUp != null)
            {
                parentPopUp.ReversePopUpDisableRecursively();
                RegisterPopUp(parentPopUp);
            }
            else
            {
                thisRootUIElement.ReversePopUpDisableRecursively();
                ClearActivePopUp();
            }
        }