Exemple #1
0
 public static void RemoveAnimation(
     ImageSource source,
     RepeatBehavior repeatBehavior,
     ObjectAnimationUsingKeyFrames _)
 {
     AnimationCache.CacheKey key = new AnimationCache.CacheKey(source, repeatBehavior);
     AnimationCache._animationCache.Remove(key);
 }
Exemple #2
0
 public static void AddAnimation(
     ImageSource source,
     RepeatBehavior repeatBehavior,
     ObjectAnimationUsingKeyFrames animation)
 {
     AnimationCache.CacheKey index = new AnimationCache.CacheKey(source, repeatBehavior);
     AnimationCache._animationCache[index] = animation;
 }
Exemple #3
0
        public static ObjectAnimationUsingKeyFrames GetAnimation(
            ImageSource source,
            RepeatBehavior repeatBehavior)
        {
            AnimationCache.CacheKey       key = new AnimationCache.CacheKey(source, repeatBehavior);
            ObjectAnimationUsingKeyFrames animationUsingKeyFrames;

            AnimationCache._animationCache.TryGetValue(key, out animationUsingKeyFrames);
            return(animationUsingKeyFrames);
        }
Exemple #4
0
        public static void IncrementReferenceCount(ImageSource source, RepeatBehavior repeatBehavior)
        {
            AnimationCache.CacheKey key = new AnimationCache.CacheKey(source, repeatBehavior);
            int num1;

            AnimationCache._referenceCount.TryGetValue(key, out num1);
            int num2 = num1 + 1;

            AnimationCache._referenceCount[key] = num2;
        }
Exemple #5
0
        public static void DecrementReferenceCount(ImageSource source, RepeatBehavior repeatBehavior)
        {
            AnimationCache.CacheKey key = new AnimationCache.CacheKey(source, repeatBehavior);
            int num;

            AnimationCache._referenceCount.TryGetValue(key, out num);
            if (num > 0)
            {
                --num;
                AnimationCache._referenceCount[key] = num;
            }
            if (num != 0)
            {
                return;
            }
            AnimationCache._animationCache.Remove(key);
            AnimationCache._referenceCount.Remove(key);
        }
Exemple #6
0
 private bool Equals(AnimationCache.CacheKey other)
 {
     return(AnimationCache.CacheKey.ImageEquals(this._source, other._source) && object.Equals((object)this._repeatBehavior, (object)other._repeatBehavior));
 }