Ejemplo n.º 1
0
 private void RefreshIsAncestorLocked(TimelineItem timelineItem)
 {
     for (int index = 0; index < timelineItem.Children.Count; ++index)
     {
         TimelineItem       timelineItem1      = timelineItem.Children[index];
         Item3DTimelineItem item3DtimelineItem = timelineItem1 as Item3DTimelineItem;
         if (item3DtimelineItem != null)
         {
             item3DtimelineItem.RefreshIsLocked();
         }
         else
         {
             ElementTimelineItem elementTimelineItem = timelineItem1 as ElementTimelineItem;
             if (elementTimelineItem != null)
             {
                 elementTimelineItem.RefreshIsAncestorLocked();
             }
             else
             {
                 StyleTimelineItem styleTimelineItem = timelineItem1 as StyleTimelineItem;
                 if (styleTimelineItem != null)
                 {
                     styleTimelineItem.RefreshIsAncestorLocked();
                 }
                 else
                 {
                     this.RefreshIsAncestorLocked(timelineItem1);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        public static KeyFrameItem FindItem(double time, TimelineItem timelineItem)
        {
            KeyFrameItem keyFrameItem = (KeyFrameItem)null;

            KeyFrameItem.locationToItemTable.TryGetValue(new KeyFrameItem.KeyFrameLocation(time, timelineItem), out keyFrameItem);
            return(keyFrameItem);
        }
Ejemplo n.º 3
0
        public static int CompareToCommon(TimelineItem timelineItemA, TimelineItem timelineItemB, TimelineItemManager timelineItemManager)
        {
            int          num1       = timelineItemManager.SortByZOrder ? 1 : -1;
            TimelineItem parent     = timelineItemA.Parent;
            SceneNode    sceneNode1 = timelineItemA.SceneNode;
            SceneNode    sceneNode2 = timelineItemB.SceneNode;

            if (sceneNode1 == null || sceneNode2 == null)
            {
                return(0);
            }
            DocumentNode documentNode1 = sceneNode1.DocumentNode;
            DocumentNode documentNode2 = sceneNode2.DocumentNode;

            if (documentNode1.Parent == null)
            {
                return(documentNode2.Parent == null ? 0 : -1);
            }
            if (documentNode1.IsChild && documentNode2.IsChild)
            {
                int num2 = documentNode1.Parent.Children.IndexOf(documentNode1);
                int num3 = documentNode1.Parent.Children.IndexOf(documentNode2);
                return(num1 * (num3 - num2));
            }
            SceneNode sceneNode3 = timelineItemA.Parent.SceneNode;

            if (sceneNode3 == null)
            {
                return(0);
            }
            ZOrderComparer <SceneNode> zorderComparer = new ZOrderComparer <SceneNode>(sceneNode3);

            return(-num1 *zorderComparer.Compare(sceneNode1, sceneNode2));
        }
Ejemplo n.º 4
0
 private void RefreshIsAncestorHidden(TimelineItem timelineItem)
 {
     for (int index = 0; index < timelineItem.Children.Count; ++index)
     {
         TimelineItem       timelineItem1      = timelineItem.Children[index];
         Item3DTimelineItem item3DtimelineItem = timelineItem1 as Item3DTimelineItem;
         if (item3DtimelineItem != null)
         {
             item3DtimelineItem.RefreshIsShown();
         }
         else
         {
             ElementTimelineItem elementTimelineItem = timelineItem1 as ElementTimelineItem;
             EffectTimelineItem  effectTimelineItem  = timelineItem1 as EffectTimelineItem;
             if (elementTimelineItem != null)
             {
                 elementTimelineItem.RefreshIsAncestorHidden();
             }
             else if (effectTimelineItem != null)
             {
                 effectTimelineItem.RefreshIsAncestorHidden();
             }
             else
             {
                 this.RefreshIsAncestorHidden(timelineItem1);
             }
         }
     }
 }
Ejemplo n.º 5
0
 public override int CompareTo(TimelineItem timelineItem)
 {
     if (timelineItem is CompoundPropertyTimelineItem || timelineItem is AnimationTimelineItem)
     {
         return(string.Compare(this.DisplayName, timelineItem.DisplayName, StringComparison.CurrentCulture));
     }
     return(0);
 }
Ejemplo n.º 6
0
 public CompoundPropertyTimelineItem(TimelineItemManager timelineItemManager, PropertyReference targetProperty, TimelineItem targetTimelineItem, string displayNameOverride)
     : base(timelineItemManager)
 {
     this.targetProperty      = targetProperty;
     this.displayNameOverride = displayNameOverride;
     this.targetTimelineItem  = targetTimelineItem;
     this.targetTimelineItem.PropertyChanged += new PropertyChangedEventHandler(this.TargetTimelineItem_PropertyChanged);
 }
Ejemplo n.º 7
0
 protected override void ChildRemoved(TimelineItem child)
 {
     base.ChildRemoved(child);
     if (this.isBeingRemoved || this.Parent.Children.Count == 1)
     {
         return;
     }
     this.RemoveFromTree();
 }
Ejemplo n.º 8
0
        public override int CompareTo(TimelineItem timelineItem)
        {
            BehaviorTimelineItem behaviorTimelineItem = timelineItem as BehaviorTimelineItem;
            ElementTimelineItem  elementTimelineItem  = this.Parent as ElementTimelineItem;

            if (timelineItem is EffectTimelineItem)
            {
                return(1);
            }
            if (behaviorTimelineItem == null || elementTimelineItem == null)
            {
                return(0);
            }
            DocumentNode documentNode1 = this.ActionNode.DocumentNode;
            DocumentNode documentNode2 = behaviorTimelineItem.ActionNode.DocumentNode;
            bool         flag1         = documentNode1.Parent != null;
            bool         flag2         = documentNode2.Parent != null;

            if (flag1 && !flag2)
            {
                return(1);
            }
            if (!flag1 && flag2)
            {
                return(-1);
            }
            if (!flag1 && !flag2)
            {
                return(0);
            }
            if (documentNode1.Parent == documentNode2.Parent)
            {
                return(documentNode1.Parent.Children.IndexOf(documentNode1) - documentNode1.Parent.Children.IndexOf(documentNode2));
            }
            DocumentNode documentNode3 = (DocumentNode)documentNode1.Parent.Parent;
            DocumentNode documentNode4 = (DocumentNode)documentNode2.Parent.Parent;

            if (documentNode3.Parent == documentNode4.Parent)
            {
                return(documentNode3.Parent.Children.IndexOf(documentNode3) - documentNode4.Parent.Children.IndexOf(documentNode4));
            }
            int num1 = 0;

            for (SceneNode sceneNode = (SceneNode)this.ActionNode; sceneNode != null && !(sceneNode is SceneElement); sceneNode = sceneNode.Parent)
            {
                ++num1;
            }
            SceneNode sceneNode1 = (SceneNode)behaviorTimelineItem.ActionNode;
            int       num2       = 0;

            for (; sceneNode1 != null && !(sceneNode1 is SceneElement); sceneNode1 = sceneNode1.Parent)
            {
                ++num2;
            }
            return(num1 - num2);
        }
Ejemplo n.º 9
0
 protected override void OnRemoved()
 {
     base.OnRemoved();
     if (this.targetTimelineItem == null)
     {
         return;
     }
     this.targetTimelineItem.PropertyChanged -= new PropertyChangedEventHandler(this.TargetTimelineItem_PropertyChanged);
     this.targetTimelineItem = (TimelineItem)null;
 }
 protected override void ChildRemoved(TimelineItem child)
 {
     if (child is IKeyFramedTimelineItem)
     {
         this.DirtyKeyFrames();
     }
     else if (child is AnimationTimelineItem)
     {
         this.DirtyHasAnimation();
     }
     base.ChildRemoved(child);
 }
Ejemplo n.º 11
0
 public static MediaTimelineItem FindItem(TimelineItem parentTimelineItem, StoryboardTimelineSceneNode parentTimeline, SceneElement mediaElement)
 {
     for (int index = 0; index < parentTimelineItem.Children.Count; ++index)
     {
         MediaTimelineItem mediaTimelineItem = parentTimelineItem.Children[index] as MediaTimelineItem;
         if (mediaTimelineItem != null && mediaTimelineItem.ParentTimeline == parentTimeline && mediaTimelineItem.MediaElement == mediaElement)
         {
             return(mediaTimelineItem);
         }
     }
     return((MediaTimelineItem)null);
 }
Ejemplo n.º 12
0
        public override int CompareTo(TimelineItem item)
        {
            ChildPropertyTimelineItem propertyTimelineItem = item as ChildPropertyTimelineItem;

            if (propertyTimelineItem == null)
            {
                return(0);
            }
            int num = this.stackOrder.CompareTo(propertyTimelineItem.stackOrder);

            if (num == 0)
            {
                return(string.Compare(this.DisplayName, propertyTimelineItem.DisplayName, StringComparison.CurrentCulture));
            }
            return(num);
        }
Ejemplo n.º 13
0
 public static ScheduledTimelineItem FindItem(TimelineItem parentTimelineItem, StoryboardTimelineSceneNode parentTimeline, PropertyReference targetProperty)
 {
     if (targetProperty == null)
     {
         return((ScheduledTimelineItem)null);
     }
     foreach (TimelineItem timelineItem in (Collection <TimelineItem>)parentTimelineItem.Children)
     {
         AnimationTimelineItem animationTimelineItem = timelineItem as AnimationTimelineItem;
         if (animationTimelineItem != null && animationTimelineItem.parentTimeline == parentTimeline && animationTimelineItem.TargetProperty.Path == targetProperty.Path)
         {
             return((ScheduledTimelineItem)animationTimelineItem);
         }
         CompoundPropertyTimelineItem propertyTimelineItem = timelineItem as CompoundPropertyTimelineItem;
         if (propertyTimelineItem != null)
         {
             ScheduledTimelineItem scheduledTimelineItem = ScheduledTimelineItem.FindItem((TimelineItem)propertyTimelineItem, parentTimeline, targetProperty);
             if (scheduledTimelineItem != null)
             {
                 return(scheduledTimelineItem);
             }
         }
         BehaviorTimelineItem behaviorTimelineItem = timelineItem as BehaviorTimelineItem;
         if (behaviorTimelineItem != null)
         {
             ScheduledTimelineItem scheduledTimelineItem = ScheduledTimelineItem.FindItem((TimelineItem)behaviorTimelineItem, parentTimeline, targetProperty);
             if (scheduledTimelineItem != null)
             {
                 return(scheduledTimelineItem);
             }
         }
         EffectTimelineItem effectTimelineItem = timelineItem as EffectTimelineItem;
         if (effectTimelineItem != null)
         {
             ScheduledTimelineItem scheduledTimelineItem = ScheduledTimelineItem.FindItem((TimelineItem)effectTimelineItem, parentTimeline, targetProperty);
             if (scheduledTimelineItem != null)
             {
                 return(scheduledTimelineItem);
             }
         }
     }
     return((ScheduledTimelineItem)null);
 }
        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);
        }
Ejemplo n.º 15
0
 protected override void ChildRemoved(TimelineItem child)
 {
     base.ChildRemoved(child);
     this.IsActive = this.IsActiveCore;
 }
Ejemplo n.º 16
0
 public KeyFrameLocation(double modelTime, TimelineItem timelineItem)
 {
     this.modelTime    = modelTime;
     this.timelineItem = timelineItem;
 }
Ejemplo n.º 17
0
 public PropertyTimelineItem(TimelineItemManager timelineItemManager, TimelineItem targetTimelineItem, SceneElement targetElement, StoryboardTimelineSceneNode parentTimeline, KeyFrameAnimationSceneNode propertyAnimation)
     : base(timelineItemManager, targetElement, parentTimeline, propertyAnimation)
 {
     this.targetTimelineItem = targetTimelineItem;
     this.targetTimelineItem.PropertyChanged += new PropertyChangedEventHandler(this.TargetTimelineItem_PropertyChanged);
 }
Ejemplo n.º 18
0
 protected KeyFrameItem(double time, TimelineItem timelineItem)
 {
     this.timelineItemManager = timelineItem.TimelineItemManager;
     this.location            = new KeyFrameItem.KeyFrameLocation(time, timelineItem);
     KeyFrameItem.locationToItemTable.Add(this.location, this);
 }
Ejemplo n.º 19
0
 public CompoundKeyFrameItem(double time, TimelineItem timelineItem)
     : base(time, timelineItem)
 {
     this.childKeyFrameItems = new List <KeyFrameItem>();
     this.PropertyChanged   += new PropertyChangedEventHandler(this.CompoundKeyFrameItem_PropertyChanged);
 }
Ejemplo n.º 20
0
 public override int CompareTo(TimelineItem treeItem)
 {
     return(DependencyObjectTimelineItem.CompareToCommon((TimelineItem)this, treeItem, this.TimelineItemManager));
 }
Ejemplo n.º 21
0
 public CompoundPropertyTimelineItem(TimelineItemManager timelineItemManager, PropertyReference targetProperty, TimelineItem targetTimelineItem)
     : this(timelineItemManager, targetProperty, targetTimelineItem, (string)null)
 {
 }
Ejemplo n.º 22
0
 public override int CompareTo(TimelineItem timelineItem)
 {
     return(0);
 }
        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();
        }
Ejemplo n.º 24
0
 public override int CompareTo(TimelineItem treeItem)
 {
     return(treeItem.Equals((object)this) ? 0 : int.MinValue);
 }