Ejemplo n.º 1
0
        public void Begin(IProcessRunner processRunner, IActorRepository repository)
        {
            _clock.Reset();
            Double duration = TimeSpan.FromMilliseconds(0).TotalMilliseconds;

            foreach (var child in Children)
            {
                Actor target = null;

                if (!String.IsNullOrEmpty(child.TargetName))
                    target = repository.GetActorByName(child.TargetName);
                else if (child.TargetActor != null)
                    target = child.TargetActor;
                else
                    throw new Exception("A storyboard child was found that did not specify an actor name or actor.");

                var targetProperty = child.TargetProperty;
                child.Timeline.SetActor(target);
                child.Timeline.ApplyAnimationClock(_clock);
                child.Timeline.BeginAnimation(targetProperty);
                duration = Math.Max(child.Timeline.GetNaturalDuration().TotalMilliseconds, duration);
            }

            processRunner.ScheduleProcess(new AnimationClockController(_clock, TimeSpan.FromMilliseconds(duration)));
        }
Ejemplo n.º 2
0
        public void Begin(IProcessRunner processRunner)
        {
            _clock.Reset();
            Double duration = TimeSpan.FromMilliseconds(0).TotalMilliseconds;

            foreach (var child in Children)
            {
                Actor target = child.TargetActor;

                var targetProperty = child.TargetProperty;
                child.Timeline.SetActor(target);
                child.Timeline.ApplyAnimationClock(_clock);
                child.Timeline.BeginAnimation(targetProperty);
                duration = Math.Max(child.Timeline.GetNaturalDuration().TotalMilliseconds, duration);
            }

            processRunner.ScheduleProcess(new AnimationClockController(_clock, TimeSpan.FromMilliseconds(duration)));
        }
Ejemplo n.º 3
0
        public AnimationClockController Begin(IProcessRunner processRunner, Actor target)
        {
            _clock.Reset();
            Double duration = TimeSpan.FromMilliseconds(0).TotalMilliseconds;

            foreach (var child in Children)
            {
                var targetProperty = child.TargetProperty;
                child.Timeline.SetActor(target);
                child.Timeline.ApplyAnimationClock(_clock);
                child.Timeline.BeginAnimation(targetProperty);
                duration = Math.Max(child.Timeline.GetNaturalDuration().TotalMilliseconds, duration);
            }

            var controller = new AnimationClockController(_clock, TimeSpan.FromMilliseconds(duration), ShouldAutoRepeat);

            processRunner.ScheduleProcess(controller);

            return controller;
        }