Exemplo n.º 1
0
 private void FrmPosition_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (!ParentClosing)
     {
         MyParent.PositionClosedUs();
     }
 }
Exemplo n.º 2
0
 /// <summary>Activate all the fadein functions in the Starts level Variables.</summary>
 public void StartLvlFadeIn()
 {
     FadeInOutSprite[] MyFadeInOut;
     foreach (GameObject MyParent in FIParents)
     {
         if (!MyParent.activeSelf)
         {
             MyParent.SetActive(true);
         }
         MyFadeInOut = MyParent.GetComponentsInChildren <FadeInOutSprite>();
         foreach (FadeInOutSprite myFade in MyFadeInOut)
         {
             if (myFade.hidden && !myFade.shown)
             {
                 myFade.FadeIn();
             }
         }
     }
     foreach (FadeInOutSprite myFade in FIFadeScripts)
     {
         if (myFade.hidden && !myFade.shown)
         {
             myFade.FadeIn();
         }
     }
 }
Exemplo n.º 3
0
 void OnClick()
 {
     if (MyData == null)
     {
         return;
     }
     if (IsSirenItem)
     {
         //显示快捷购买妖女内丹面板
     }
     else
     {
         if (MyParent.CheckCanSelect() || MyData.IsSelect)
         {
             MyData.IsSelect = !MyData.IsSelect;
             SelectStatusIcon.ChangeSprite(IsSelect() ? 1 : 0);
             MyParent.MyParent.UpdateSkillProgressBar();
             //TraceUtil.Log("刷新进度条");
         }
         else
         {
             //MessageBox.Instance.ShowTips(3, "每次只能炼化6件装备", 1);
             MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H1_520"), 1);
             //TraceUtil.Log("选择已满");
         }
     }
 }
Exemplo n.º 4
0
        private void Set_MainContent_Part()
        {
            if (Post.content == string.Empty)
            {
                webBrowserTop.Visible = false;
                return;
            }

            StringBuilder _sb = new StringBuilder();

            _sb.Append("<font face='·L³n¥¿¶ÂÅé, Helvetica, Arial, Verdana, sans-serif'><p>[Text]</p></font>");

            string _html = _sb.ToString();

            string _content = HttpUtility.HtmlEncode(Post.content);

            _content = _content.Replace(Environment.NewLine, "<BR>");
            _content = _content.Replace("\n", "<BR>");
            _content = _content.Replace("\r", "<BR>");

            _html = _html.Replace("[Text]", _content);

            _html += MyParent.GenCommentHTML(Post);

            _html = HtmlUtility.MakeLink(_html, m_clickableURL);

            _html = "<body bgcolor=\"rgb(243, 242, 238)\">" + _html + "</body>";

            webBrowserTop.DocumentText = HtmlUtility.TrimScript(_html);
        }
Exemplo n.º 5
0
 void UpdatePanel()
 {
     if (MyParent != null && gameObject.active == true)
     {
         MyParent.Init(null);
     }
 }
Exemplo n.º 6
0
    public static string CreateJson(GameObject obj, string jsonDataName, string ParentPath)
    {
        //  My_UIEditorToos.InitProgress(obj.transform.GetChildCount());

        JsonData jd = new JsonData();
        JsonData RootpositionJson  = new JsonData();
        JsonData RootsizeDeltaJson = new JsonData();
        JsonData jd2 = new JsonData();
        int      i   = 0;

        foreach (Transform item in obj.transform)
        {
            JsonData tmp           = new JsonData();
            JsonData TransformJson = new JsonData();
            JsonData positionJson  = new JsonData();
            JsonData sizeDeltaJson = new JsonData();
            i++;
            tmp["PrefabName"]  = item.name;
            positionJson["x"]  = item.GetComponent <RectTransform>().localPosition.x;
            positionJson["y"]  = item.GetComponent <RectTransform>().localPosition.y;
            positionJson["z"]  = item.GetComponent <RectTransform>().localPosition.z;
            sizeDeltaJson["w"] = item.GetComponent <RectTransform>().sizeDelta.x;
            sizeDeltaJson["h"] = item.GetComponent <RectTransform>().sizeDelta.y;
            tmp["position"]    = positionJson;
            tmp["sizeDelta"]   = sizeDeltaJson;
            if (item.GetComponent <UIAnimation>() != null)
            {
                tmp["AnimationType"] = item.GetComponent <UIAnimation>().AnimationType;
                tmp["ScriptType"]    = item.GetComponent <UIAnimation>().ScriptType;
                tmp["Direction"]     = item.GetComponent <UIAnimation>().direction.ToString();
            }
            if (item.GetComponent <SUIButton>() != null)
            {
                string s = item.GetComponent <SUIButton>().m_ButtonMsg.ToString();
                tmp["ButtonEvent"] = "" + s;
            }
            else
            {
                tmp["ButtonEvent"] = "";
            }
            jd2.Add(tmp);
            //  My_UIEditorToos.Progress();
            MyParent.make(item.gameObject, "Assets/Resources/UI/" + ParentPath + "/" + item.name + ".prefab");
        }
        RootpositionJson["x"]  = obj.GetComponent <RectTransform>().localPosition.x;
        RootpositionJson["y"]  = obj.GetComponent <RectTransform>().localPosition.y;
        RootpositionJson["z"]  = obj.GetComponent <RectTransform>().localPosition.z;
        RootsizeDeltaJson["w"] = obj.GetComponent <RectTransform>().sizeDelta.x;
        RootsizeDeltaJson["h"] = obj.GetComponent <RectTransform>().sizeDelta.y;
        jd["parentURL"]        = ParentPath;
        jd["Name"]             = obj.name;
        jd["position"]         = RootpositionJson;
        jd["sizeDelta"]        = RootsizeDeltaJson;
        jd["Child"]            = jd2;
        Debug.Log(jd.ToJson());
        string filepath = Application.dataPath + "/Resources";

        My_UIEditorToos.CreateFile(filepath, jsonDataName, jd);
        return(filepath);
    }
Exemplo n.º 7
0
 void OnClick()
 {
     if (IsLock)
     {
         return;
     }
     SoundManager.Instance.PlaySoundEffect("Sound_Button_EctypeTabChoice");
     MyParent.OnMyChildItemClick(this);
 }
Exemplo n.º 8
0
 private void BackButton_Click(object sender, EventArgs e)
 {
     if (MyParent != null)
     {
         MyParent.Show();
     }
     DialogResult = DialogResult.OK;
     Close();
 }
Exemplo n.º 9
0
    static void Main(string[] args)
    {
        var      childBuilder = new DataBuilderChild().WithId(1).WithDescription("Child");
        MyParent parent       = childBuilder;
        MyChild  child        = childBuilder;

        Console.WriteLine(@"Parent With Id {0}", parent.Id);
        Console.WriteLine(@"Child With Id {0} and Desciprtion - {1}", child.Id, child.Description);
        Console.ReadKey();
    }
Exemplo n.º 10
0
 void SelectTitleBtn(object obj)
 {
     CurrentSelectEctypeContaienrData = obj as EctypeContainerData;
     MyParent.curSelectEasyEctypeID   = EsyEctypeContainerData.lEctypeContainerID;
     //TitleBtn_Esy.spriteSwithList.ApplyAllItem(P=>P.ChangeSprite(CurrentSelectEctypeContaienrData == EsyEctypeContainerData?2:1));
     if (DiffEctypeContainerData != null && !MyParent.EctypeIDIsLock(DiffEctypeContainerData.lEctypeContainerID))
     {
         //TitleBtn_Diff.spriteSwithList.ApplyAllItem(P=>P.ChangeSprite(CurrentSelectEctypeContaienrData == DiffEctypeContainerData?2:1));
     }
     UpdateLabel();
 }
Exemplo n.º 11
0
 void OnClickEvent(bool withSFX)
 {
     if (IsLock)
     {
         return;
     }
     if (withSFX)
     {
         SoundManager.Instance.PlaySoundEffect("Sound_Button_EctypeChoice");
     }
     MyParent.OnEctypeContainerItemClick(this);
 }
Exemplo n.º 12
0
 private void SendPureText()
 {
     if (MyParent.pureTextBox.Text.Trim().Equals(string.Empty))
     {
         MessageBox.Show(I18n.L.T("TextEmpty"), "Waveface", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         if (DoRealPost(""))
         {
             MyParent.SetDialogResult_Yes_AndClose();
         }
     }
 }
Exemplo n.º 13
0
        private void AddTransaction()
        {
            // Create the object and update the database.
            Transaction t = new Transaction();

            ModelService.AddTransaction(TheAccount, t);

            // Create the VM object and update the app/UI.
            Transaction_VM tvm = new Transaction_VM();

            tvm.TheTransaction = t;
            MyTransactions.Add(tvm);

            MyParent.NotifyNumXacts();
        }
Exemplo n.º 14
0
 public void AddPhoto()
 {
     if (openFileDialog.ShowDialog() == DialogResult.OK)
     {
         AddFileToImageListView(openFileDialog.FileNames, false);
     }
     else
     {
         if (imageListView.Items.Count == 0)
         {
             MyParent.toPureText_Mode();
             return;
         }
     }
 }
Exemplo n.º 15
0
 private void BtnLoadOrStart_Click(object sender, EventArgs e)
 {
     if (btnLoadOrStart.Text == "Cut Part")
     {
         MyParent.MenuPartFileLoad_Click(sender, e);
     }
     else if (btnLoadOrStart.Text == "Start")
     {
         if (MyParent.LoadSBProgram(FileLoader.partFilename))
         {
             FileLoader.Close();
             MyParent.RunSBProgram();
         }
     }
 }
Exemplo n.º 16
0
        void SendGoodsOperateSophisticationToSever()
        {
            int shortcutItemid = CommonDefineManager.Instance.CommonDefineFile._dataTable.ShortcutItem_PassiveSkill;
            var shopData       = ShopDataManager.Instance.GetShopData(shortcutItemid);
            var containerData  = ContainerInfomanager.Instance.itemFielArrayInfo.FirstOrDefault(P => P.LocalItemData._goodID == shopData.GoodsID);

            if (containerData == null)
            {
                UIEventManager.Instance.TriggerUIEvent(UIEventType.QuickPurchase, shortcutItemid);
            }
            else
            {
                MyParent.SendResetPassiveSkillToSever(SelectItem);
            }
            Close();
        }
Exemplo n.º 17
0
        public void DeleteTransaction()
        {
            if (SelectedTransaction != null)
            {
                ModelService.DeleteTransaction(SelectedTransaction.TheTransaction);
                MyTransactions.Remove(SelectedTransaction);
                // TODO: Move the selection to the next/previous item in the list.
                SelectedTransaction = null;

                CalculateCashBalance();
                PopulatePositions();
                MyParent.NotifyNumXacts();
                RaisePropertyChanged("Value");
                RaisePropertyChanged("TheAccount");
            }
        }
Exemplo n.º 18
0
        private void RemoveAllAndReturnToParent()
        {
            if (imageListView.Items.Count == 0)
            {
                MyParent.toPureText_Mode();
                return;
            }

            DialogResult _dr = MessageBox.Show(I18n.L.T("RemoveAllFiles"), "Waveface", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (_dr == DialogResult.Yes)
            {
                imageListView.Items.Clear();

                MyParent.toPureText_Mode();
            }
        }
Exemplo n.º 19
0
        public void Test_ChildElementPropagation()
        {
            int validInteger   = 120;
            int invalidInteger = 1000;

            MyParent myParent = new MyParent();

            myParent.MyChild = new MyChild(invalidInteger);

            BusinessObjectValidationResult businessObjectValidationResult = BusinessObjectManager.Validate(myParent);

            Assert.AreEqual(ValidationStatus.NotAllPropertiesValid, businessObjectValidationResult.ValidationStatus);
            Trace.WriteLine(businessObjectValidationResult.ToString(TextFormat.ASCII));



            myParent.MyChild = new MyChild(validInteger);
            businessObjectValidationResult = BusinessObjectManager.Validate(myParent);
            Assert.AreEqual(ValidationStatus.Valid, businessObjectValidationResult.ValidationStatus);
            Trace.WriteLine(businessObjectValidationResult.ToString(TextFormat.ASCII));



            myParent.MyChildList = new List <MyChild>();
            myParent.MyChildList.Add(new MyChild(validInteger));
            myParent.MyChildList.Add(new MyChild(validInteger));
            myParent.MyChildList.Add(new MyChild(validInteger));

            businessObjectValidationResult = BusinessObjectManager.Validate(myParent);
            Assert.AreEqual(ValidationStatus.Valid, businessObjectValidationResult.ValidationStatus);
            Trace.WriteLine(businessObjectValidationResult.ToString(TextFormat.ASCII));



            myParent.MyChildList = new List <MyChild>();
            myParent.MyChildList.Add(new MyChild(validInteger));
            myParent.MyChildList.Add(new MyChild(invalidInteger));
            myParent.MyChildList.Add(new MyChild(invalidInteger));

            businessObjectValidationResult = BusinessObjectManager.Validate(myParent);
            Assert.AreEqual(ValidationStatus.NotAllPropertiesValid, businessObjectValidationResult.ValidationStatus);

            Trace.WriteLine(businessObjectValidationResult.ToString(TextFormat.ASCII));
        }
Exemplo n.º 20
0
        private void btnBatchPost_Click(object sender, EventArgs e)
        {
            if (!Main.Current.CheckNetworkStatus())
            {
                return;
            }

            if (imageListView.Items.Count == 0)
            {
                SendPureText();
                return;
            }

            long _storagesUsage = CheckStoragesUsage();

            if (_storagesUsage == long.MinValue)
            {
                MessageBox.Show(I18n.L.T("SystemError"), "Waveface", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                return;
            }

            if (_storagesUsage < 0)
            {
                MessageBox.Show(string.Format(I18n.L.T("PhotoStorageQuotaExceeded"), m_month_total_objects), "Waveface", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return;
            }

            NewPostItem _newPostItem = new NewPostItem();

            _newPostItem.PostType    = PostType.Photo;
            _newPostItem.Text        = StringUtility.RichTextBox_ReplaceNewline(MyParent.pureTextBox.Text);
            _newPostItem.ResizeRatio = toolStripComboBoxResize.Text;
            _newPostItem.OrgPostTime = DateTime.Now;

            foreach (ImageListViewItem _vi in imageListView.Items)
            {
                _newPostItem.Files.Add(_vi.FileName);
            }

            MyParent.NewPostItem = _newPostItem;
            MyParent.SetDialogResult_OK_AndClose();
        }
Exemplo n.º 21
0
        /// <summary> Button listener for entire panel, will determin actions based on the sender
        /// </summary>
        /// <param name="sender">the button that was pressed</param>
        /// <param name="e">Click event</param>
        public void button_click(object sender, EventArgs e)
        {
            Button b = (Button)sender;

            if (b.Name != "back")
            {
                if (b.Name == "blueWin")
                {
                    Winner = BlueTeam;
                    updateTeams(BlueTeam, RedTeam);
                }
                else
                {
                    Winner = RedTeam;
                    updateTeams(RedTeam, BlueTeam);
                }
                State = MatchState.VictorFound;

                //If either team wins, check to see if its the last game
                if (isFinalsMatch || Name == "tourneyMatchUp14")
                {
                    MyParent.declareWinner(Winner);
                }
                else
                {
                    NextMatch.addTeamToMatchUp(Winner);
                }

                //else revert
            }
            else
            {
                if (NextMatch != null)
                {
                    NextMatch.removeTeamFromMatchUp(Winner);
                }
                undoCompletion();
                Winner = null;
                State  = MatchState.NoVictor;
            }
            recentlyModified = true;
            redrawComponents();
        }
Exemplo n.º 22
0
        void OnOperateArtificeBtnClick(object obj)
        {
            var selectItemList = GetSelectItemList();

            if (MyParent.CheckIsFullLevel(MyParent.SelectItemData))
            {
                MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H1_526"), 1);
                return;
            }
            if (selectItemList.Count == 0)
            {
                //MessageBox.Instance.ShowTips(3, "请选择炼化装备", 1);
                MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H1_521"), 1);
            }
            else
            {
                //弹出炼化确认界面
                OperateArtificeMessagePanel.TweenShow(selectItemList, this);
            }
        }
Exemplo n.º 23
0
 /// <summary>Activate all the fadeout functions in the Exit level Variables.</summary>
 public void ExitFadeOutLvl()
 {
     FadeInOutSprite[] MyFadeInOut;
     foreach (GameObject MyParent in FIParents)
     {
         MyFadeInOut = MyParent.GetComponentsInChildren <FadeInOutSprite>();
         foreach (FadeInOutSprite myFade in MyFadeInOut)
         {
             if (!myFade.hidden && myFade.shown)
             {
                 myFade.FadeOut();
             }
         }
     }
     foreach (FadeInOutSprite myFade in FIFadeScripts)
     {
         if (!myFade.hidden && myFade.shown)
         {
             myFade.FadeOut();
         }
     }
 }
Exemplo n.º 24
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            if (!Main.Current.CheckNetworkStatus())
            {
                return;
            }

            RichTextPostForm _dlg = new RichTextPostForm();

            _dlg.MyParent = this;

            DialogResult _dr = _dlg.ShowDialog();

            switch (_dr)
            {
            case DialogResult.Yes:
                MyParent.SetDialogResult_Yes_AndClose();
                break;

            case DialogResult.OK:
                MyParent.SetDialogResult_OK_AndClose();
                break;
            }
        }
Exemplo n.º 25
0
 public void OnMyBtnClick(ItemData selectData)
 {
     MyFashionButtonList.ApplyAllItem(C => C.SetMySelectStatus(selectData));
     MyParent.SelectFashion(selectData);
 }
 protected void SetDataBuilder(MyParent myParent)
 {
     this.myParent = myParent;
 }
        public void Inferrence()
        {
            // hide
            var client = TestClient.GetInMemoryClient(c => c.DisableDirectStreaming().PrettyJson());
            var infer  = client.Infer;
            var parent = new MyParent {
                Id = 1337, MyJoinField = JoinField.Root <MyParent>()
            };

            infer.Routing(parent).Should().Be("1337");

            var child = new MyChild {
                Id = 1338, MyJoinField = JoinField.Link <MyChild>(parentId: "1337")
            };

            infer.Routing(child).Should().Be("1337");

            child = new MyChild {
                Id = 1339, MyJoinField = JoinField.Link <MyChild, MyParent>(parent)
            };
            infer.Routing(child).Should().Be("1337");

            /**
             * here we index `parent` and rather than fishing out the parent id by inspecting `parent` we just pass the instance
             * to `Routing` which can infer the correct routing key based on the JoinField property on the instance
             */
            var indexResponse = client.Index(parent, i => i.Routing(Routing.From(parent)));

            indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");

            /**
             * The same goes for when we index a child, we can pass the instance directly to `Routing` and NEST will use the parent id
             * already specified on `child`. Here we use the static import `using static Nest.Infer` and it's `Route()` static method to
             * create an instance of `Routing`
             */
            indexResponse = client.Index(child, i => i.Routing(Route(child)));
            indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");

            /** Wouldn't be handy if NEST does this automatically? It does! */
            indexResponse = client.IndexDocument(child);
            indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");

            /** You can always override the default inferred routing though */
            indexResponse = client.Index(child, i => i.Routing("explicit"));
            indexResponse.ApiCall.Uri.Query.Should().Contain("routing=explicit");

            indexResponse = client.Index(child, i => i.Routing(null));
            indexResponse.ApiCall.Uri.Query.Should().NotContain("routing");

            /**
             * This works for both the fluent and object initializer syntax
             */

            var indexRequest = new IndexRequest <MyChild>(child);

            indexResponse = client.Index(indexRequest);
            indexResponse.ApiCall.Uri.Query.Should().Contain("routing=1337");

            /**
             * Its important to note that the routing is resolved at request time, not instantation time
             * here we update the `child`'s `JoinField` after already creating the index request for `child`
             */
            child.MyJoinField = JoinField.Link <MyChild>(parentId: "something-else");
            indexResponse     = client.Index(indexRequest);
            indexResponse.ApiCall.Uri.Query.Should().Contain("routing=something-else");
        }
        /**
         * ==== Indexing parents or children
         *
         * Now that we have our join field mapping set up on the index we can proceed to index parent and child documents.
         */

        [U] public void Indexing()
        {
            // hide
            var client = TestClient.GetInMemoryClient(c => c.DisableDirectStreaming().PrettyJson());

            /**
             * To mark a document with the relation name of the parent `MyParent` all of the following three ways are equivalent.
             *
             * In the first we explicitly call `JoinField.Root` to mark this document as the root of a parent child relationship namely
             * that of `MyParent`. In the following examples we rely on implicit conversion from `string` and `Type` to do the same.
             */
            var parentDocument = new MyParent
            {
                Id             = 1,
                ParentProperty = "a parent prop",
                MyJoinField    = JoinField.Root <MyParent>()
            };

            parentDocument = new MyParent
            {
                Id             = 1,
                ParentProperty = "a parent prop",
                MyJoinField    = typeof(MyParent)              // <1> this lets the join data type know this is a root document of type `myparent`
            };
            parentDocument = new MyParent
            {
                Id             = 1,
                ParentProperty = "a parent prop",
                MyJoinField    = "myparent"              // <1> this lets the join data type know this is a root document of type `myparent`
            };
            var indexParent = client.IndexDocument <MyDocument>(parentDocument);
            //json
            var expected = new
            {
                id             = 1,
                parentProperty = "a parent prop",
                myJoinField    = "myparent"
            };

            Expect(expected).FromRequest(indexParent);

            /**
             * Linking the child document to its parent follows a similar pattern.
             * Here we create a link by inferring the id from our parent instance `parentDocument`
             */
            var indexChild = client.IndexDocument <MyDocument>(new MyChild
            {
                MyJoinField = JoinField.Link <MyChild, MyParent>(parentDocument)
            });

            /**
             * or here we are simply stating this document is of type `mychild` and should be linked
             * to parent id 1 from `parentDocument`.
             */
            indexChild = client.IndexDocument <MyDocument>(new MyChild
            {
                Id          = 2,
                MyJoinField = JoinField.Link <MyChild>(1)
            });
            //json
            var childJson = new
            {
                id          = 2,
                myJoinField = new
                {
                    name   = "mychild",
                    parent = "1"
                }
            };

            Expect(childJson).FromRequest(indexChild);

            /**
             * The mapping already links `myparent` as the parent type so we only need to suply the parent id.
             * In fact there are many ways to create join field:
             */

            Expect("myparent").WhenSerializing(JoinField.Root(typeof(MyParent)));
            Expect("myparent").WhenSerializing(JoinField.Root(Relation <MyParent>()));
            Expect("myparent").WhenSerializing(JoinField.Root <MyParent>());
            Expect("myparent").WhenSerializing(JoinField.Root("myparent"));

            var childLink = new { name = "mychild", parent = "1" };

            Expect(childLink).WhenSerializing(JoinField.Link <MyChild>(1));
            Expect(childLink).WhenSerializing(JoinField.Link <MyChild, MyParent>(parentDocument));
            Expect(childLink).WhenSerializing(JoinField.Link("mychild", 1));
            Expect(childLink).WhenSerializing(JoinField.Link(typeof(MyChild), 1));
        }
Exemplo n.º 29
0
 private void SetReady(string message)
 {
     MyParent.SetReadyLabel(message);
 }
Exemplo n.º 30
0
 void OnClick()
 {
     SoundManager.Instance.PlaySoundEffect("Sound_Button_Avatar_Change");
     MyParent.OnMyBtnClick(MyItemData);
 }