Exemple #1
0
        private void Play()
        {
            if (Children != null && Children.Count > 0)
            {
                for (int i = 0; i < Children.Count; i++)
                {
                    ITimeline child = Children[i];

                    DisposeChildRegistrations(child);

                    _runningChildren++;
                    child.RegisterListener(this);

                    child.Begin();
                }
            }
            else
            {
                Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // No children, so we complete immediately
                    State = TimelineState.Stopped;
                    OnCompleted();
                });
            }
        }
Exemple #2
0
        private void Play()
        {
            if (Children != null && Children.Count > 0)
            {
                for (int i = 0; i < Children.Count; i++)
                {
                    ITimeline child = Children[i];

                    DisposeChildRegistrations(child);

                    _runningChildren++;
                    child.Completed += Child_Completed;
                    child.Failed    += Child_Failed;

                    _childrenSubscriptions.Add(
                        child,
                        Disposable.Create(() => {
                        child.Completed -= Child_Completed;
                        child.Failed    -= Child_Failed;
                    })
                        );

                    child.Begin();
                }
            }
            else
            {
                Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    // No children, so we complete immediately
                    State = TimelineState.Stopped;
                    OnCompleted();
                });
            }
        }