/// <summary>
        /// Removes a DoubleKeyFrame from the collection.
        /// </summary>
        public void Remove(DoubleKeyFrame keyFrame)
        {
            WritePreamble();

            if (_keyFrames.Contains(keyFrame))
            {
                OnFreezablePropertyChanged(keyFrame, null);
                _keyFrames.Remove(keyFrame);

                WritePostscript();
            }
        }
Example #2
0
        protected virtual void AddChild(object child)
        {
            DoubleKeyFrame keyFrame = child as DoubleKeyFrame;

            if (keyFrame != null)
            {
                KeyFrames.Add(keyFrame);
            }
            else
            {
                throw new ArgumentException(SR.Get(SRID.Animation_ChildMustBeKeyFrame), "child");
            }
        }
        /// <summary>
        /// Inserts a DoubleKeyFrame into a specific location in the collection.
        /// </summary>
        public void Insert(int index, DoubleKeyFrame keyFrame)
        {
            if (keyFrame == null)
            {
                throw new ArgumentNullException("keyFrame");
            }

            WritePreamble();

            OnFreezablePropertyChanged(null, keyFrame);
            _keyFrames.Insert(index, keyFrame);

            WritePostscript();
        }
Example #4
0
        private TimeSpan GetKeyFrameTime(DoubleKeyFrame keyFrame, TimeSpan keyFramesDuration)
        {
            if (keyFrame.KeyTime.HasTimeSpan)
            {
                return(keyFrame.KeyTime.TimeSpan);
            }

            if (keyFrame.KeyTime.HasPercent)
            {
                return(keyFramesDuration.Scale(keyFrame.KeyTime.Percent));
            }

            throw new Granular.Exception("KeyTime of type \"{0}\" is not supported", keyFrame.KeyTime.Type);
        }
        /// <summary>
        /// Adds a DoubleKeyFrame to the collection.
        /// </summary>
        public int Add(DoubleKeyFrame keyFrame)
        {
            if (keyFrame == null)
            {
                throw new ArgumentNullException("keyFrame");
            }

            WritePreamble();

            OnFreezablePropertyChanged(null, keyFrame);
            _keyFrames.Add(keyFrame);

            WritePostscript();

            return(_keyFrames.Count - 1);
        }
        /// <summary>
        /// Implementation of <see cref="System.Windows.Freezable.CloneCore(System.Windows.Freezable)">Freezable.CloneCore</see>.
        /// </summary>
        protected override void CloneCore(Freezable sourceFreezable)
        {
            DoubleKeyFrameCollection sourceCollection = (DoubleKeyFrameCollection)sourceFreezable;

            base.CloneCore(sourceFreezable);

            int count = sourceCollection._keyFrames.Count;

            _keyFrames = new List <DoubleKeyFrame>(count);

            for (int i = 0; i < count; i++)
            {
                DoubleKeyFrame keyFrame = (DoubleKeyFrame)sourceCollection._keyFrames[i].Clone();
                _keyFrames.Add(keyFrame);
                OnFreezablePropertyChanged(null, keyFrame);
            }
        }
 public void Insert(int index, DoubleKeyFrame keyFrame)
 {
 }
        /// <summary>
        /// Returns the index of a given DoubleKeyFrame in the collection. 
        /// </summary>
        public int IndexOf(DoubleKeyFrame keyFrame)
        {
            ReadPreamble();

            return _keyFrames.IndexOf(keyFrame);
        }
        /// <summary>
        /// Returns the index of a given DoubleKeyFrame in the collection.
        /// </summary>
        public int IndexOf(DoubleKeyFrame keyFrame)
        {
            ReadPreamble();

            return(_keyFrames.IndexOf(keyFrame));
        }
 public void Remove(DoubleKeyFrame keyFrame)
 {
 }
 public int Add(DoubleKeyFrame keyFrame)
 {
     throw new NotImplementedException();
 }
 public bool Contains(DoubleKeyFrame keyFrame)
 {
   return default(bool);
 }
	public int Add (DoubleKeyFrame keyFrame)
	{
		throw new NotImplementedException ();
	}
 public void Insert(int index, DoubleKeyFrame keyFrame)
 {
     throw new NotImplementedException();
 }
	public void Insert (int index, DoubleKeyFrame keyFrame)
	{
		throw new NotImplementedException ();
	}
	public void Remove (DoubleKeyFrame keyFrame)
	{
		throw new NotImplementedException ();
	}
 public bool Contains(DoubleKeyFrame keyFrame)
 {
     return(default(bool));
 }
 public int Add(DoubleKeyFrame keyFrame)
 {
     return(default(int));
 }
 public void Remove(DoubleKeyFrame keyFrame)
 {
 }
Example #20
0
        /// <summary>
        /// Inserts a DoubleKeyFrame into a specific location in the collection. 
        /// </summary>
        public void Insert(int index, DoubleKeyFrame keyFrame)
        {
            if (keyFrame == null)
            {
                throw new ArgumentNullException("keyFrame");
            }

            WritePreamble();

            OnFreezablePropertyChanged(null, keyFrame);
            _keyFrames.Insert(index, keyFrame);

            WritePostscript();
        }
	public bool Contains (DoubleKeyFrame keyFrame)
	{
		throw new NotImplementedException ();
	}
Example #22
0
        /// <summary>
        /// Removes a DoubleKeyFrame from the collection.
        /// </summary>
        public void Remove(DoubleKeyFrame keyFrame)
        {
            WritePreamble();

            if (_keyFrames.Contains(keyFrame))
            {
                OnFreezablePropertyChanged(keyFrame, null);
                _keyFrames.Remove(keyFrame);

                WritePostscript();
            }
        }
	public void CopyTo (DoubleKeyFrame[] array, int index)
	{
		throw new NotImplementedException ();
	}
 public void Remove(DoubleKeyFrame keyFrame)
 {
     throw new NotImplementedException();
 }
 public void CopyTo(DoubleKeyFrame[] array, int index)
 {
 }
 public bool Contains(DoubleKeyFrame keyFrame)
 {
     throw new NotImplementedException();
 }
 public void Insert(int index, DoubleKeyFrame keyFrame)
 {
 }
        /// <summary>
        /// Returns true of the collection contains the given DoubleKeyFrame.
        /// </summary>
        public bool Contains(DoubleKeyFrame keyFrame)
        {
            ReadPreamble();

            return(_keyFrames.Contains(keyFrame));
        }
Example #29
0
        /// <summary>
        /// Adds a DoubleKeyFrame to the collection.
        /// </summary>
        public int Add(DoubleKeyFrame keyFrame)
        {
            if (keyFrame == null)
            {
                throw new ArgumentNullException("keyFrame");
            }

            WritePreamble();

            OnFreezablePropertyChanged(null, keyFrame);
            _keyFrames.Add(keyFrame);

            WritePostscript();

            return _keyFrames.Count - 1;
        }
 public int Add(DoubleKeyFrame keyFrame)
 {
   return default(int);
 }
Example #31
0
        /// <summary>
        /// Returns true of the collection contains the given DoubleKeyFrame.
        /// </summary>
        public bool Contains(DoubleKeyFrame keyFrame)
        {
            ReadPreamble();

            return _keyFrames.Contains(keyFrame);
        }
        /// <summary>
        /// Updates the is expanded state.
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.contentContainer = this.GetTemplateChild(CollapsibleContentControl.ElementContentContainerName) as FrameworkElement;
            if (this.contentContainer != null)
            {
                this.resizeStoryboard = this.contentContainer.Resources[CollapsibleContentControl.ElementResizeStoryboardName] as Storyboard;
                if (this.resizeStoryboard != null && this.resizeStoryboard.Children.Count == 1)
                {
                    this.resizeHeightKeyFrame = (this.resizeStoryboard.Children[0] as DoubleAnimationUsingKeyFrames).KeyFrames[0];
                    if (this.resizeHeightKeyFrame != null)
                    {
                        this.defaultKeyTime = this.resizeHeightKeyFrame.KeyTime;
                    }
                }
            }

            this.contentPresenter = this.GetTemplateChild(CollapsibleContentControl.ElementContentPresenterName) as ContentPresenter;
            if (this.contentPresenter != null)
            {
                this.contentPresenter.SizeChanged += new SizeChangedEventHandler(this.ContentPresenter_SizeChanged);
            }

            this.UpdateExpandedState(false);
        }
 public int IndexOf(DoubleKeyFrame keyFrame)
 {
     return(default(int));
 }
Example #34
0
        /// <summary>
        /// Copies all of the DoubleKeyFrames in the collection to an
        /// array of DoubleKeyFrames.
        /// </summary>
        public void CopyTo(DoubleKeyFrame[] array, int index)
        {
            ReadPreamble();

            _keyFrames.CopyTo(array, index);
        }
 public int IndexOf(DoubleKeyFrame keyFrame)
 {
   return default(int);
 }