public void RemoveKeyFrameItem(double time)
        {
            KeyFrameItem keyFrameItem1 = (KeyFrameItem)null;

            foreach (KeyFrameItem keyFrameItem2 in (Collection <KeyFrameItem>) this.KeyFrameItems)
            {
                if (keyFrameItem2.IsOldTimeSet)
                {
                    if (keyFrameItem2.OldTime == time)
                    {
                        keyFrameItem1 = keyFrameItem2;
                    }
                }
                else if (keyFrameItem2.Time == time)
                {
                    keyFrameItem1 = keyFrameItem2;
                }
                if (keyFrameItem2.IsSelected)
                {
                    int num = keyFrameItem2 != keyFrameItem1 ? true : false;
                }
            }
            if (keyFrameItem1 != (KeyFrameItem)null)
            {
                keyFrameItem1.RemoveFromModel();
                this.KeyFrameItems.Remove(keyFrameItem1);
                this.OnPropertyChanged("KeyFrameItems");
            }
            this.SendTimingChangeNotifications();
        }
Example #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);
        }
Example #3
0
        public override bool Equals(object obj)
        {
            KeyFrameItem keyFrameItem = obj as KeyFrameItem;

            if (keyFrameItem != (KeyFrameItem)null)
            {
                return(object.Equals((object)keyFrameItem.location, (object)this.location));
            }
            return(false);
        }
Example #4
0
        public int CompareTo(object obj)
        {
            int          num          = 0;
            KeyFrameItem keyFrameItem = obj as KeyFrameItem;

            if (keyFrameItem != (KeyFrameItem)null && this.Time != keyFrameItem.Time)
            {
                num = this.Time > keyFrameItem.Time ? 1 : -1;
            }
            return(num);
        }
        public void MoveKeyFrameItem(double oldTime, double newTime, bool useOldTime)
        {
            KeyFrameItem keyFrameItem1 = (KeyFrameItem)null;

            foreach (KeyFrameItem keyFrameItem2 in (Collection <KeyFrameItem>) this.KeyFrameItems)
            {
                if ((useOldTime && keyFrameItem2.OldTime == oldTime || !useOldTime && keyFrameItem2.Time == oldTime) && !keyFrameItem2.SetTimeFromModel(newTime))
                {
                    keyFrameItem1 = keyFrameItem2;
                }
            }
            if (keyFrameItem1 != (KeyFrameItem)null)
            {
                this.KeyFrameItems.Remove(keyFrameItem1);
            }
            this.SendTimingChangeNotifications();
        }
        public void AddKeyFrameItem(double time)
        {
            if (!(KeyFrameItem.FindItem(time, (TimelineItem)this) == (KeyFrameItem)null))
            {
                return;
            }
            SimpleKeyFrameItem simpleKeyFrameItem = new SimpleKeyFrameItem(time, this);

            for (int index = 0; index <= this.KeyFrameItems.Count; ++index)
            {
                if (index == this.KeyFrameItems.Count || this.KeyFrameItems[index].Time > time)
                {
                    this.KeyFrameItems.Insert(index, (KeyFrameItem)simpleKeyFrameItem);
                    break;
                }
            }
            if (simpleKeyFrameItem.KeyFrameSceneNode != null && this.TimelineItemManager.ViewModel.KeyFrameSelectionSet.IsSelected(simpleKeyFrameItem.KeyFrameSceneNode))
            {
                simpleKeyFrameItem.IsSelected = true;
            }
            this.OnPropertyChanged("KeyFrameItems");
            this.SendTimingChangeNotifications();
        }
Example #7
0
 public void AddKeyFrameItem(KeyFrameItem keyFrameItem)
 {
     keyFrameItem.PropertyChanged += new PropertyChangedEventHandler(this.ChildKeyFrameItem_PropertyChanged);
     this.childKeyFrameItems.Add(keyFrameItem);
 }