Example #1
0
        /// <summary>
        /// Gets the keyframes in the given animation and stores them in a map
        /// </summary>
        /// <param name="dakeys">Animation containg keyframes</param>
        /// <param name="isOpacityAnim">Flag to indicate whether
        ///   the animation targets the opacity or the translate transform</param>
        private void ProcessDoubleAnimationWithKeys(DoubleAnimationUsingKeyFrames dakeys, bool isOpacityAnim = false)
        {
            // Get all the keyframes in the instance.
            for (int i = 0; i < dakeys.KeyFrames.Count; i++)
            {
                DoubleKeyFrame frame = dakeys.KeyFrames[i];

                Dictionary <int, KeyFrameDetails> targetMap = null;

                if (isOpacityAnim)
                {
                    targetMap = opKeyFrameMap;
                }
                else
                {
                    targetMap = keyFrameMap;
                }

                if (!targetMap.ContainsKey(i))
                {
                    targetMap[i] = new KeyFrameDetails()
                    {
                        KeyFrames = new List <DoubleKeyFrame>()
                    };
                }

                // Update the keyframe time and add it to the map
                targetMap[i].KeyFrameTime = frame.KeyTime;
                targetMap[i].KeyFrames.Add(frame);
            }
        }
Example #2
0
        private void StoreOpacityFrame(int index, DoubleKeyFrame doubleOpacityFrame, DoubleAnimationUsingKeyFrames keyFrames)
        {
            if (!_opKeyFrameMap.TryGetValue(index, out var opFrame))
            {
                opFrame = new KeyFrameDetails();
                _opKeyFrameMap[index] = opFrame;
            }

            opFrame.KeyFrameTime = doubleOpacityFrame.KeyTime;
            opFrame.KeyFrames.Add(doubleOpacityFrame);

            keyFrames.KeyFrames.Add(doubleOpacityFrame);
        }
Example #3
0
        private void StoreKeyFrame(int index, DoubleKeyFrame doubleKeyFrame, DoubleAnimationUsingKeyFrames keyFrames)
        {
            if (!_keyFrameMap.TryGetValue(index, out var keyFrame))
            {
                keyFrame            = new KeyFrameDetails();
                _keyFrameMap[index] = keyFrame;
            }

            keyFrame.KeyFrameTime = doubleKeyFrame.KeyTime;
            keyFrame.KeyFrames.Add(doubleKeyFrame);

            keyFrames.KeyFrames.Add(doubleKeyFrame);
        }
Example #4
0
        /// <summary>
        /// Gets the keyframes in the given animation and stores them in a map
        /// </summary>
        /// <param name="dakeys">Animation containg keyframes</param>
        /// <param name="isOpacityAnim">Flag to indicate whether the animation targets the opacity or the translate transform</param>
        private void ProcessDoubleAnimationWithKeys(DoubleAnimationUsingKeyFrames dakeys, bool isOpacityAnim = false)
        {
            // Get all the keyframes in the instance.
            for (var i = 0; i < dakeys.KeyFrames.Count; i++)
            {
                var frame = dakeys.KeyFrames[i];

                var targetMap = isOpacityAnim ? _opKeyFrameMap : _keyFrameMap;

                if (!targetMap.ContainsKey(i))
                {
                    targetMap[i] = new KeyFrameDetails {
                        KeyFrames = new List <DoubleKeyFrame>()
                    };
                }

                // Update the keyframe time and add it to the map
                targetMap[i].KeyFrameTime = frame.KeyTime;
                targetMap[i].KeyFrames.Add(frame);
            }
        }
		/// <summary>
		/// Gets the keyframes in the given animation and stores them in a map
		/// </summary>
		/// <param name="dakeys">Animation containg keyframes</param>
		/// <param name="isOpacityAnim">Flag to indicate whether the animation targets the opacity or the translate transform</param>
		private void ProcessDoubleAnimationWithKeys(DoubleAnimationUsingKeyFrames dakeys, bool isOpacityAnim = false)
		{
			// Get all the keyframes in the instance.
			for (int i = 0; i < dakeys.KeyFrames.Count; i++)
			{
				DoubleKeyFrame frame = dakeys.KeyFrames[i];

				Dictionary<int, KeyFrameDetails> targetMap = null;

				if (isOpacityAnim)
				{
					targetMap = opKeyFrameMap;
				}
				else
				{
					targetMap = keyFrameMap;
				}

				if (!targetMap.ContainsKey(i))
				{
					targetMap[i] = new KeyFrameDetails() { KeyFrames = new List<DoubleKeyFrame>() };
				}

				// Update the keyframe time and add it to the map
				targetMap[i].KeyFrameTime = frame.KeyTime;
				targetMap[i].KeyFrames.Add(frame);
			}
		}
        /// <summary>
        /// Gets the keyframes in the given animation and stores them in a map
        /// </summary>
        /// <param name="dakeys">Animation containg keyframes</param>
        /// <param name="isOpacityAnim">Flag to indicate whether the animation targets the opacity or the translate transform</param>
        private void ProcessDoubleAnimationWithKeys(DoubleAnimationUsingKeyFrames dakeys, bool isOpacityAnim = false)
        {
            // Get all the keyframes in the instance.
            for (var i = 0; i < dakeys.KeyFrames.Count; i++) {
                var frame = dakeys.KeyFrames[i];

                var targetMap = isOpacityAnim ? _opKeyFrameMap : _keyFrameMap;

                if (!targetMap.ContainsKey(i)) {
                    targetMap[i] = new KeyFrameDetails { KeyFrames = new List<DoubleKeyFrame>() };
                }

                // Update the keyframe time and add it to the map
                targetMap[i].KeyFrameTime = frame.KeyTime;
                targetMap[i].KeyFrames.Add(frame);
            }
        }