private void RecursiveUpdateScheduledProperties(TimelineItem item)
        {
            ITimedTimelineItem timedTimelineItem = item as ITimedTimelineItem;

            if (item != this && timedTimelineItem != null && !timedTimelineItem.ShouldBubbleTimes)
            {
                return;
            }
            if (item.Children != null && item.Children.Count > 0)
            {
                for (int index = 0; index < item.Children.Count; ++index)
                {
                    TimelineItem timelineItem = item.Children[index];
                    if (timelineItem != null)
                    {
                        this.RecursiveUpdateScheduledProperties(timelineItem);
                    }
                }
            }
            item.CommitScheduledPropertyChanges(this.originalBegin, this.originalEnd, this.begin, this.AbsoluteClipEnd);
        }
        private void RebuildKeyFrames()
        {
            if (this.TimelineItemManager.IsInitializing)
            {
                return;
            }
            bool flag1 = false;

            if (this.keyFrameItems.Count > 0)
            {
                foreach (CompoundKeyFrameItem compoundKeyFrameItem in (Collection <KeyFrameItem>) this.keyFrameItems)
                {
                    compoundKeyFrameItem.RemoveFromModel();
                    compoundKeyFrameItem.ChildKeyFrameTimeChanged -= new EventHandler(this.CompoundKeyFrameItem_ChildKeyFrameTimeChanged);
                }
                this.keyFrameItems.Clear();
                flag1 = true;
            }
            double num1  = this.begin;
            double num2  = this.duration;
            double num3  = double.PositiveInfinity;
            double val1  = 0.0;
            bool   flag2 = false;

            if (this.Children.Count > 0)
            {
                Dictionary <double, CompoundKeyFrameItem> dictionary = (Dictionary <double, CompoundKeyFrameItem>)null;
                for (int index = 0; index < this.Children.Count; ++index)
                {
                    TimelineItem timelineItem = this.Children[index];
                    if (timelineItem != null)
                    {
                        IKeyFramedTimelineItem framedTimelineItem = timelineItem as IKeyFramedTimelineItem;
                        ITimedTimelineItem     timedTimelineItem  = timelineItem as ITimedTimelineItem;
                        if (timedTimelineItem != null && timedTimelineItem.ShouldBubbleTimes)
                        {
                            num3   = Math.Min(num3, timedTimelineItem.AbsoluteBeginTime);
                            val1   = Math.Max(val1, timedTimelineItem.AbsoluteEndTime);
                            flag2 |= timedTimelineItem.ShouldShowTimeBar;
                        }
                        if (framedTimelineItem != null && framedTimelineItem.ShouldBubbleKeyFrames)
                        {
                            if (dictionary == null)
                            {
                                dictionary = new Dictionary <double, CompoundKeyFrameItem>();
                            }
                            foreach (KeyFrameItem keyFrameItem in (Collection <KeyFrameItem>)framedTimelineItem.KeyFrameItems)
                            {
                                CompoundKeyFrameItem compoundKeyFrameItem;
                                if (dictionary.TryGetValue(keyFrameItem.Time, out compoundKeyFrameItem))
                                {
                                    compoundKeyFrameItem.AddKeyFrameItem(keyFrameItem);
                                }
                                else
                                {
                                    compoundKeyFrameItem = new CompoundKeyFrameItem(keyFrameItem.Time, (TimelineItem)this);
                                    compoundKeyFrameItem.AddKeyFrameItem(keyFrameItem);
                                    compoundKeyFrameItem.ChildKeyFrameTimeChanged += new EventHandler(this.CompoundKeyFrameItem_ChildKeyFrameTimeChanged);
                                    dictionary[keyFrameItem.Time] = compoundKeyFrameItem;
                                    num3 = Math.Min(num3, keyFrameItem.Time);
                                    val1 = Math.Max(val1, keyFrameItem.Time);
                                }
                            }
                        }
                    }
                }
                if (dictionary != null)
                {
                    List <CompoundKeyFrameItem> list = new List <CompoundKeyFrameItem>(dictionary.Count);
                    list.AddRange((IEnumerable <CompoundKeyFrameItem>)dictionary.Values);
                    list.Sort();
                    foreach (KeyFrameItem keyFrameItem in list)
                    {
                        this.keyFrameItems.Add(keyFrameItem);
                        flag1 = true;
                    }
                }
                if (this.shouldShowTimeBar != flag2)
                {
                    this.shouldShowTimeBar = flag2;
                    this.OnPropertyChanged("ShouldShowTimeBar");
                }
            }
            this.Begin    = !double.IsPositiveInfinity(num3) ? num3 : 0.0;
            this.Duration = val1 - this.begin;
            if (flag1)
            {
                this.OnPropertyChanged("KeyFrameItems");
            }
            if (this.begin != num1)
            {
                this.OnPropertyChanged("Begin");
            }
            if (this.duration != num2)
            {
                this.OnPropertyChanged("Duration");
            }
            this.KeyFramesRebuilt();
        }