Beispiel #1
0
        private static List <BaseAnimation> VerifyList(BaseAnimation animation)
        {
            var list = GetAnimations(animation.Element);

            if (list == null)
            {
                SetAnimations(animation.Element, list = new List <BaseAnimation>());
            }
            return(list);
        }
Beispiel #2
0
        internal static void RemoveAnimation(BaseAnimation animation)
        {
            var list = GetAnimations(animation.Element);

            if (list != null)
            {
                animation.Retain();
                animation.Stop();
                list.Remove(animation);
            }
        }
Beispiel #3
0
        internal static void AddAnimation(BaseAnimation animation)
        {
            var list  = VerifyList(animation);
            int index = list.IndexOfItem(x => x.Equivalent(animation));

            if (index != -1)
            {
                var item = list[index];
                item.Retain();
                item.Stop();
                list.RemoveAt(index);
            }

            list.Add(animation);
        }
 public virtual bool Equivalent(BaseAnimation animation)
 {
     return(animation.GetType() == GetType());
 }