예제 #1
0
 /// <summary>
 /// 移除动画
 /// </summary>
 /// <param name="animationName"></param>
 /// <param name="control"></param>
 static void RemoveAnimation(string animationName, AnimationControl control)
 {
     if (aniControlDict.ContainsKey(animationName))
     {
         if (aniControlDict[animationName].Contains(control))
         {
             aniControlDict[animationName].Remove(control);
         }
         if (aniControlDict[animationName].Count == 0)
         {
             aniControlDict.Remove(animationName);
         }
     }
 }
예제 #2
0
        /// <summary>
        /// 添加动画
        /// </summary>
        /// <param name="animationName"></param>
        /// <param name="control"></param>
        static void AddAnimation(string animationName, AnimationControl control)
        {
            List <AnimationControl> animations = null;

            if (!aniControlDict.ContainsKey(animationName))
            {
                animations = new List <AnimationControl>();
                aniControlDict.Add(animationName, animations);
            }
            else
            {
                animations = aniControlDict[animationName];
            }

            if (!animations.Contains(control))
            {
                animations.Add(control);
            }
        }