Пример #1
0
        public void CancelSchedule(GrgStoryboard argStoryboard)
        {
            Debug.Assert(null != argStoryboard);
            if (null == argStoryboard)
            {
                throw new ArgumentNullException("argStoryboard");
            }

            lock ( m_storyboardLock )
            {
                int total = m_listStoryboard.Count;
                for (int i = 0; i < total; ++i)
                {
                    if (m_listStoryboard[i].Name.Equals(argStoryboard.Name, StringComparison.Ordinal))
                    {
                        m_listStoryboard.RemoveAt(i);
                        break;
                    }
                }

                if (m_listStoryboard.Count == 0 &&
                    m_storyboardTimer.IsEnabled)
                {
                    m_storyboardTimer.Stop();
                }
            }
        }
Пример #2
0
        private GrgStoryboard FindStoryBoard(GrgStoryboard argStoryboard)
        {
            Debug.Assert(null != argStoryboard);
            foreach (var board in m_listStoryboard)
            {
                if (board.Name.Equals(argStoryboard.Name, StringComparison.Ordinal))
                {
                    return(board);
                }
            }

            return(null);
        }
Пример #3
0
        private static TimelineBase CreateSlideShowTimelineFrame(GrgStoryboard argBoard,
                                                                 XmlNode argNode)
        {
            Debug.Assert(null != argBoard && null != argNode);

            SlideshowTimelineFrame slideshow = new SlideshowTimelineFrame(argBoard);

            if (!slideshow.Open(argNode))
            {
                slideshow = null;
                return(null);
            }

            return(slideshow);
        }
Пример #4
0
        private static TimelineBase CreateMediaTimeline(GrgStoryboard argBoard,
                                                        XmlNode argNode)
        {
            Debug.Assert(null != argNode && null != argBoard);

            MediaTimeline media = new MediaTimeline(argBoard);

            if (!media.Open(argNode))
            {
                media = null;
                return(null);
            }

            return(media);
        }
Пример #5
0
        public void ScheduleStoryboard(GrgStoryboard argStoryboard)
        {
            Debug.Assert(null != argStoryboard);
            if (null == argStoryboard)
            {
                throw new ArgumentNullException("argStoryboard");
            }

            lock ( m_storyboardLock )
            {
                GrgStoryboard existBoard = FindStoryBoard(argStoryboard);
                if (null != existBoard)
                {
                    return;
                }

                m_listStoryboard.Add(argStoryboard);
                if (!m_storyboardTimer.IsEnabled)
                {
                    m_storyboardTimer.Start();
                }
            }
        }