setNameMethod() public méthode

public setNameMethod ( String pNameMethod ) : void
pNameMethod String
Résultat void
        private void CreateMethodBtn(XsollaSavedPaymentMethod pMethod)
        {
            // Create object
            GameObject methodBtn = Instantiate(Resources.Load("Prefabs/SimpleView/_PaymentFormElements/SavedMethodBtn")) as GameObject;

            methodBtn.transform.SetParent(methodsGrid.transform);
            SavedMethodBtnController controller = methodBtn.GetComponent <SavedMethodBtnController>();

            listBtns.Add(controller);
            // Set method
            controller.setMethod(pMethod);
            // Set name
            controller.setNameMethod(pMethod.GetName());
            // Set Type
            controller.setNameType(pMethod.GetPsName());
            // Set icon
            imageLoader.LoadImage(controller._iconMethod, pMethod.GetImageUrl());
            // Set BtnList
            controller._btnMethod.onClick.AddListener(() => onMethodClick(controller.getMethod()));
        }
Exemple #2
0
        public void initScreen(XsollaUtils pUtils, XsollaSavedPaymentMethods pMethods, Action pAddPaymentMethod, bool pAddState)
        {
            mUtilsLink        = pUtils;
            mActionAddPayment = pAddPaymentMethod;

            if (pMethods != null)
            {
                mListMethods = pMethods;
            }
            else
            {
                GetSavedMethod(pAddState, true);
                return;
            }

            if (mListBtnsObjs == null)
            {
                mListBtnsObjs = new ArrayList();
            }
            else
            {
                mListBtnsObjs.Clear();
            }

            mTitle.text            = pUtils.GetTranslations().Get("payment_account_page_title");
            mInformationTitle.text = pUtils.GetTranslations().Get("payment_account_add_title");
            mInformation.text      = pUtils.GetTranslations().Get("payment_account_add_info");
            mContinueLink.text     = pUtils.GetTranslations().Get("payment_account_back_button");
            mCanceltext.text       = pUtils.GetTranslations().Get("cancel");
            mCloseNotify.onClick.AddListener(CloseStatus);

            Button continueBtn = mContinueLink.GetComponent <Button>();

            continueBtn.onClick.RemoveAllListeners();
            continueBtn.onClick.AddListener(() =>
            {
                Destroy(this.gameObject);
                mOnClose();
            });
            Text textBtn = mBtnAddPaymentObj.GetComponentInChildren <Text>();

            textBtn.text = pUtils.GetTranslations().Get("payment_account_add_button");

            // clear btn Grid
            for (int i = 0; i < mBtnGrid.transform.childCount; i++)
            {
                Destroy(mBtnGrid.transform.GetChild(i).gameObject);
            }

            if (mListMethods.GetCount() == 0)
            {
                mContainer.SetActive(false);
                mDelPanelMethod.SetActive(false);
                mReplacePanelMethod.SetActive(false);
                mInfoPanel.SetActive(true);

                Button btnAddPayment = mBtnAddPaymentObj.GetComponent <Button>();
                btnAddPayment.onClick.RemoveAllListeners();
                btnAddPayment.onClick.AddListener(() => { CloseStatus(); mActionAddPayment(); });
            }
            else
            {
                mInfoPanel.SetActive(false);
                mDelPanelMethod.SetActive(false);
                mReplacePanelMethod.SetActive(false);
                mContainer.SetActive(true);
                foreach (XsollaSavedPaymentMethod item in mListMethods.GetItemList())
                {
                    // Create prefab on btn saved method, set parent and set controller on them
                    GameObject methodBtn = Instantiate(Resources.Load("Prefabs/SimpleView/_PaymentFormElements/SavedMethodBtnNew")) as GameObject;
                    methodBtn.transform.SetParent(mBtnGrid.transform);

                    // Add objects btn on list
                    mListBtnsObjs.Add(methodBtn);

                    SavedMethodBtnController controller = methodBtn.GetComponent <SavedMethodBtnController>();

                    // Activated btn delete
                    controller.setDeleteBtn(true);
                    controller.setMethodBtn(false);
                    controller.setDeleteBtnName(pUtils.GetTranslations().Get("delete_payment_account_button"));

                    // Set btn property
                    // Set method
                    controller.setMethod(item);
                    // Set name
                    controller.setNameMethod(item.GetName());
                    // Set Type
                    controller.setNameType(item.GetPsName());
                    // Set icon
                    mImgLoader.LoadImage(controller._iconMethod, item.GetImageUrl());
                    // Set BtnDelAction
                    controller.getBtnDelete().onClick.AddListener(() => { CloseStatus(); onClickDeletePaymentMethod(controller); });
                }

                // Add button "Add payment metnod"
                GameObject objAddMethodClone = Instantiate <GameObject>(mBtnAddPaymentObj);
                objAddMethodClone.transform.SetParent(mBtnGrid.transform);
                //set onclickListener
                Button btnAddMethod = objAddMethodClone.GetComponent <Button>();
                btnAddMethod.onClick.RemoveAllListeners();
                btnAddMethod.onClick.AddListener(() => { CloseStatus(); mActionAddPayment(); });
            }
        }