void Ex02()
        {
            When("the edit is completed", () => EditContent.CompleteEdit());
            AssertEditing(false);

            AssertEventRaised(false, false, false);
        }
Beispiel #2
0
        void Ex02()
        {
            When("the edit is canceled", () => EditContent.CancelEdit());
            AssertEditing(false);

            AssertEventRaised(false, false, false);
        }
        void Ex01()
        {
            When("the edit is started", () => DisplayContent.StartEdit());
            AssertEditing(true);

            When("the edit is completed", () => EditContent.CompleteEdit());
            AssertEditing(false);

            AssertEventRaised(true, true, false);
        }
Beispiel #4
0
        //####  Button EventHandler

        private void buttonAdd_Click(object sender, EventArgs e)
        {
            EditContent editC = new EditContent(this);

            editC.newLogin();
            DialogResult edited = editC.ShowDialog();

            if (edited == DialogResult.OK)
            {
                LoginObject newLog = editC.TmpLogObject;
                editLV.addItem(lViewLogs, newLog);

                if (newLog.Fav)
                {
                    editLV.addItem(lViewFavorites, newLog);
                }

                //add to xml file
                xml.saveLoginObjects();
            }
        }
 void Ex02()
 {
     When("the edit is canceled", () => EditContent.CancelEdit());
     Then("the EditCompleted event should not be raised", () => !EditCompletedRaised);
     Then("the EditCanceled event should be raised", () => EditCanceledRaised);
 }
Beispiel #6
0
    public void Init(List <GameObject> models, List <GameObject> btnModels)
    {
        //Debug.Log("Model->Init.");
        ModelNumDic = new Dictionary <int, Content>();
        Content    cont;
        GameObject obj;

        for (int i = 0; i < models.Count; i++)
        {
            //Debug.Log(i + " == null " + (models[i] == null));
            obj = Instantiate(models[i], models[i].transform.position, models[i].transform.rotation) as GameObject;

            cont = obj.GetComponent <Content>();
            if (cont != null)
            {
                switch (modelType)
                {
                case ModelType.Cover:
                    break;

                case ModelType.Page:
                    break;

                case ModelType.Catalogue:
                    (cont as Catalogue).PageTab = PageTab;
                    break;
                }
                if (cont is EditCoverContent)
                {
                    EditCoverContent conte = cont as EditCoverContent;
                    conte.oPicButtonPrefab = oPicButtonPrefab;
                    conte.fPageWidth       = fPageWidth;
                    conte.fPageHeight      = fPageHeight;
                }
                else if (cont is EditContent)
                {
                    EditContent conte = cont as EditContent;
                    conte.oPicButtonPrefab = oPicButtonPrefab;
                    conte.oPicButtonPrefab = oPicButtonPrefab;
                    conte.fPageWidth       = fPageWidth;
                    conte.fPageHeight      = fPageHeight;
                }
                Debug.Log(":-=>" + cont.ModleNum);

                ModelNumDic.Add(cont.ModleNum, cont);
            }
            else
            {
                Exception ex = new Exception("Model:获取的Content脚本为空!");
                throw ex;
            }
        }

        transform.DetachChildren();
        if (TestCode)
        {
            for (int i = 0; i < Contents.Count; i++)
            {
                Contents[i].gameObject.transform.parent = transform;
                Contents[i].Init();
                RectTransform recf = Contents[i].gameObject.GetComponent <RectTransform>();
                recf.offsetMin  = Vector2.zero;
                recf.offsetMax  = Vector2.zero;
                recf.localScale = Vector3.one;
            }
        }
        else
        {
            foreach (Content con in ModelNumDic.Values)
            {
                con.gameObject.transform.parent = transform;
                con.Init();
                RectTransform recf = con.gameObject.GetComponent <RectTransform>();
                recf.offsetMin  = Vector2.zero;
                recf.offsetMax  = Vector2.zero;
                recf.localScale = Vector3.one;
            }
        }

        if (PageTabPar != null)
        {
            PageTabPar.transform.parent = transform;
            RectTransform rect = PageTabPar.GetComponent <RectTransform>();
            rect.anchorMin = Vector2.zero;
            rect.anchorMax = Vector2.one;
            rect.offsetMin = Vector2.zero;
            rect.offsetMax = Vector2.zero;
        }

        CreateModelBtn(btnModels);
    }