public void TestEmulateChangeText()
        {
            FormsTextBox textBox = new FormsTextBox(testDlg["textBox"]());

            textBox.EmulateChangeText("textBox");
            string textBoxText = textBox.Text;

            Assert.AreEqual("textBox", textBoxText);

            // 非同期
            app[GetType(), "ChangeTextEvent"](textBox.AppVar);
            textBox.EmulateChangeText("textBox1", new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            textBoxText = textBox.Text;
            Assert.AreEqual("textBox1", textBoxText);
        }
        public void Test()
        {
            var textBox = new FormsTextBox(_form._textBox);
            var button  = new FormsButton(_form._button);

            textBox.EmulateChangeText("abc");
            button.SetFocus();

            string err = _form._errorProvider.GetError(_form._textBox);

            Assert.AreEqual("数字じゃないよ。", err);
        }
Exemple #3
0
        private void ResetParameters(Val_Talker val_, Dictionary <string, WPFSlider> _interface)
        {
            TalkerPrimitive defaultParam = talkerDefaultParamList[val_.talkerRealName];

            AvatorParam_VREX avator = AvatorParams[ConvertNametoIndex(val_)] as AvatorParam_VREX;


            foreach (KeyValuePair <string, EffectValueInfo> val__ in defaultParam.VoiceEffects)
            {
                FormsTextBox TargetTextBox = null;
                double       value         = 0.00;
                if (val__.Key == "音量")
                {
                    TargetTextBox = avator.AvatorUI.VolumeText;
                    value         = (double)val__.Value.val;
                }
                else if (val__.Key == "話速")
                {
                    TargetTextBox = avator.AvatorUI.SpeedText;
                    value         = (double)val__.Value.val;
                }
                else if (val__.Key == "高さ")
                {
                    TargetTextBox = avator.AvatorUI.PitchText;
                    value         = (double)val__.Value.val;
                }
                else if (val__.Key == "抑揚")
                {
                    TargetTextBox = avator.AvatorUI.IntonationText;
                    value         = (double)val__.Value.val;
                }
                else
                {
                    break;
                }


                if (TargetTextBox != null)
                {
                    TargetTextBox.EmulateChangeText(string.Format("{0:0.00}", value));
                }
            }
        }
Exemple #4
0
        private void ApplyEffectParameters(Val_Talker val_, Dictionary <string, WPFSlider> _interface)
        {
            FormsTextBox     TargetTextBox = null;
            double           value         = 0.00;
            AvatorParam_VREX avator        = AvatorParams[ConvertNametoIndex(val_)] as AvatorParam_VREX;

            foreach (var effect in avator.VoiceEffects)
            {
                switch (effect.Key)
                {
                case EnumVoiceEffect.volume:
                    TargetTextBox = avator.AvatorUI.VolumeText;
                    value         = (double)val_.parametor["音量"].val_decimal;
                    break;

                case EnumVoiceEffect.speed:
                    TargetTextBox = avator.AvatorUI.SpeedText;
                    value         = (double)val_.parametor["話速"].val_decimal;
                    break;

                case EnumVoiceEffect.pitch:
                    TargetTextBox = avator.AvatorUI.PitchText;
                    value         = (double)val_.parametor["高さ"].val_decimal;
                    break;

                case EnumVoiceEffect.intonation:
                    TargetTextBox = avator.AvatorUI.IntonationText;
                    value         = (double)val_.parametor["抑揚"].val_decimal;
                    break;
                }

                if (TargetTextBox != null)
                {
                    TargetTextBox.EmulateChangeText(string.Format("{0:0.00}", value));
                }
            }
        }