Ejemplo n.º 1
0
        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            // Make button text editable in on-page edit mode
            ButtonLink.ApplyEditAttributes <ButtonBlock>(b => b.ButtonText);

            DataBind();
        }
Ejemplo n.º 2
0
 public static void UpdateButtonLink(this ButtonLink btnLink, ButtonLinkViewModel btnLinkVm)
 {
     btnLink.ID         = btnLinkVm.ID;
     btnLink.Type       = btnLinkVm.Type;
     btnLink.Title      = btnLinkVm.Title;
     btnLink.Url        = btnLinkVm.Url;
     btnLink.SizeHeight = btnLinkVm.SizeHeight;
     btnLink.Index      = btnLinkVm.Index;
 }
Ejemplo n.º 3
0
    void UpdatePanel()
    {
        //turn to list
        TextMeshProUGUI[] textBoxes;
        textBoxes = copyPanel.transform.GetChild(0).transform.GetComponentsInChildren <TextMeshProUGUI>();
        for (int i = 0; i < textBoxes.Length; i++)
        {
            if (textBoxes[i].gameObject.name == "Title")
            {
                textBoxes[i].SetText(title);
            }
            else if (textBoxes[i].gameObject.name == "Description")
            {
                if (itemUpgradeSection == "Production")
                {
                    textBoxes[i].SetText(description + "\n" + "Social: " + social + "\n" + "Environmental: " + environmental + "\n" + "Recycling Percent: " + productionQuantity + "%");
                }
                else
                {
                    textBoxes[i].SetText(description + "\n" + "Social: " + social + "\n" + "Environmental: " + environmental);
                }
            }
        }

        TextMeshProUGUI altdescPanel = copyPanel.transform.GetChild(1).transform.GetComponentInChildren <TextMeshProUGUI>();

        if (altdescPanel.gameObject.name == "altDesc")
        {
            altdescPanel.SetText(altDescription);
        }

        // Button[] buttons;
        buttons = copyPanel.transform.GetChild(0).transform.GetComponentsInChildren <Button>();
        for (int i = 0; i < buttons.Length; i++)
        {
            if (buttons[i].gameObject.name == "Purchase")
            {
                TextMeshProUGUI purchaseText = buttons[i].gameObject.transform.GetChild(0).GetComponent <TextMeshProUGUI>();
                purchaseText.SetText("Purchase for £" + cost + "K");
            }
        }

        TextMeshProUGUI[] predicted = copyPanel.transform.GetChild(2).transform.GetComponentsInChildren <TextMeshProUGUI>();

        for (int i = 0; i < predicted.Length; i++)
        {
            if (predicted[i].name == "Stats")
            {
                predicted[i].SetText("Cash: £" + (gameManager.money - cost * upgradeNumber) + "K" + "\n" + "Social: " + (gameManager.social + (social * upgradeNumber)) + "\n" + "Environmental: " + (gameManager.environment + (environmental * upgradeNumber)) + "\n");
            }
        }
        ButtonLink calcProductNo = copyPanel.transform.GetChild(0).transform.GetChild(5).GetComponent <ButtonLink>();

        calcProductNo.GetupgradeLink(this);
    }
        public void WhenButtonLinkInvoked_ThenViewModelIsUpdated(string key, string value)
        {
            var values = new Dictionary <string, string>()
            {
                { key, value }
            };

            var component = new ButtonLink();

            component.ViewComponentContext = ViewComponentTestHelper.GetViewComponentContext();

            ViewViewComponentResult result = component.Invoke(values) as ViewViewComponentResult;
            LinkModel resultModel          = (LinkModel)result.ViewData.Model;

            //Assert
            value.Should().Be(ViewComponentTestHelper.GetPropertyValue(resultModel, key));
        }
Ejemplo n.º 5
0
 public void ApplyTo(ButtonLink applyTo)
 {
     applyTo.Url       = Url;
     applyTo.EventName = EventName;
     applyTo.SendEvent = SendEvent;
 }
 public ButtonLink AddButtonLink(ButtonLink btnLink)
 {
     return(_buttonLinkRepository.Add(btnLink));
 }