Exemple #1
0
        public void Invoke_InvalidSource_ReturnsFalse()
        {
            PlaySoundAction playSoundAction = new PlaySoundAction();

            Assert.IsFalse((bool)playSoundAction.Execute(null, null),
                           "PlaySoundAction.Execute should return false with a null source path.");
        }
Exemple #2
0
        public void Invoke_AbsoluteSource_Invokes()
        {
            PlaySoundAction playSoundAction = new PlaySoundAction();

            playSoundAction.Source = "ms-appx:///foo.wav";
            bool result = (bool)playSoundAction.Execute(null, null);

            Assert.IsTrue(result);
        }
Exemple #3
0
        public void Invoke_RelativeSource_Invokes()
        {
            PlaySoundAction playSoundAction = new PlaySoundAction();

            playSoundAction.Source = "foo.wav";
            bool result = (bool)playSoundAction.Execute(null, null);

            Assert.IsTrue(result);
        }
Exemple #4
0
 private void checkBox1_Checked(object sender, RoutedEventArgs e)
 {
     trigger = new System.Windows.Interactivity.EventTrigger();
         trigger.EventName = "Click";
         PlaySoundAction beeper = new PlaySoundAction();
         beeper.Source = new Uri(@"C:\Users\Administrator\Documents\Expression\Blend 4\Projects\EmbeddedSystemsProject\EmbeddedSystemsProject\censor-beep-1.mp3", UriKind.Absolute);
         beeper.Volume = 1.0;
         trigger.Actions.Add(beeper);
         trigger.Attach(button1);
 }
Exemple #5
0
        public void Constructor_DefaultConstructor_SetsVolumeCorrectly()
        {
            PlaySoundAction playSoundAction = new PlaySoundAction();

            Assert.AreEqual(0.5, playSoundAction.Volume, "Volume should be initialized to 0.5");
        }
Exemple #6
0
    public BaseAction GetAction()
    {
        if (actionType == ActionType.Move)
        {
            return(MoveAction.Create(v31.VarianceXY(variance), b1, b2, duration, Ease.FromType(easeType), direction));
        }

        if (actionType == ActionType.HorizontalMove)
        {
            return(HMoveAction.Create(f1.Variance(variance), b1, b2, duration, Ease.FromType(easeType), direction));
        }

        if (actionType == ActionType.VerticalMove)
        {
            return(VMoveAction.Create(f1.Variance(variance), b1, b2, duration, Ease.FromType(easeType), direction));
        }

        if (actionType == ActionType.Scale)
        {
            return(ScaleAction.Create(v31.VarianceXY(variance), b1, duration, Ease.FromType(easeType), direction));
        }

        if (actionType == ActionType.Rotate)
        {
            return(RotateAction.Create(f1.Variance(variance), b1, duration, Ease.FromType(easeType), direction));
        }

        if (actionType == ActionType.Fade)
        {
            return(FadeAction.Create(f1.Variance(variance), b1, b2, duration, Ease.FromType(easeType), direction));
        }

        if (actionType == ActionType.Tint)
        {
            return(TintAction.Create(c1.RGB().Variance(variance), b1, b2, duration, Ease.FromType(easeType), direction));
        }

        if (actionType == ActionType.SetPosition)
        {
            return(SetPositionAction.Create(v31, v32, b1, b2));
        }

        if (actionType == ActionType.SetScale)
        {
            return(SetScaleAction.Create(v31, v32, b1));
        }

        if (actionType == ActionType.SetRotation)
        {
            return(SetRotationAction.Create(f1, f2));
        }

        if (actionType == ActionType.SetAlpha)
        {
            return(SetAlphaAction.Create(f1, f2, b1));
        }

        if (actionType == ActionType.SetRGB)
        {
            return(SetRGBAction.Create(c1.RGB(), c2.RGB(), b1));
        }

        if (actionType == ActionType.Delay)
        {
            return(DelayAction.Create(duration, f2));
        }

        if (actionType == ActionType.AnimatorTrigger)
        {
            return(AnimatorTriggerAction.Create(s1));
        }

        if (actionType == ActionType.PlaySound)
        {
            return(PlaySoundAction.Create(soundId, soundType, f1));
        }

        if (actionType == ActionType.CallEvent)
        {
            return(CallEventAction.Create(e1));
        }

        if (actionType == ActionType.PlayParticleSystem)
        {
            return(PlayPSAction.Create(b1));
        }

        return(null);
    }