/// <summary>
        /// Finds any properties in the old-transition that are also in the new one,
        /// and removes them from the old one.
        /// </summary>
        /// <param name="newTransition">The new transition.</param>
        /// <param name="oldTransition">The old transition.</param>
        private void removeDuplicates(ZeroitTransitor newTransition, ZeroitTransitor oldTransition)
        {
            // Note: This checking might be a bit more efficient if it did the checking
            //       with a set rather than looking through lists. That said, it is only done
            //       when transitions are added (which isn't very often) rather than on the
            //       timer, so I don't think this matters too much.

            // We get the list of properties for the old and new transitions...
            IList <ZeroitTransitor.TransitionedPropertyInfo> newProperties = newTransition.TransitionedProperties;
            IList <ZeroitTransitor.TransitionedPropertyInfo> oldProperties = oldTransition.TransitionedProperties;

            // We loop through the old properties backwards (as we may be removing
            // items from the list if we find a match)...
            for (int i = oldProperties.Count - 1; i >= 0; i--)
            {
                // We get one of the properties from the old transition...
                ZeroitTransitor.TransitionedPropertyInfo oldProperty = oldProperties[i];

                // Is this property part of the new transition?
                foreach (ZeroitTransitor.TransitionedPropertyInfo newProperty in newProperties)
                {
                    if (oldProperty.target == newProperty.target
                        &&
                        oldProperty.propertyInfo == newProperty.propertyInfo)
                    {
                        // The old transition contains the same property as the new one,
                        // so we remove it from the old transition...
                        oldTransition.removeProperty(oldProperty);
                    }
                }
            }
        }
        /// <summary>
        /// Creates and immediately runs a transition on the property passed in.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <param name="strPropertyName">Name of the string property.</param>
        /// <param name="destinationValue">The destination value.</param>
        /// <param name="transitionMethod">The transition method.</param>
        public static void run(object target, string strPropertyName, object destinationValue, ITransitionType transitionMethod)
        {
            ZeroitTransitor t = new ZeroitTransitor(transitionMethod);

            t.add(target, strPropertyName, destinationValue);
            t.run();
        }
 /// <summary>
 /// Checks if any existing transitions are acting on the same properties as the
 /// transition passed in. If so, we remove the duplicated properties from the
 /// older transitions.
 /// </summary>
 /// <param name="transition">The transition.</param>
 private void removeDuplicates(ZeroitTransitor transition)
 {
     // We look through the set of transitions we're currently managing...
     foreach (KeyValuePair <ZeroitTransitor, bool> pair in m_Transitions)
     {
         removeDuplicates(transition, pair.Key);
     }
 }
        /// <summary>
        /// Called when the transition we have just run has completed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private void onTransitionCompleted(object sender, ZeroitTransitor.Args e)
        {
            // We unregister from the completed event...
            ZeroitTransitor transition = (ZeroitTransitor)sender;

            transition.TransitionCompletedEvent -= onTransitionCompleted;

            // We remove the completed transition from our collection, and
            // run the next one...
            m_listTransitions.RemoveFirst();
            runNextTransition();
        }
        /// <summary>
        /// Called when a transition has completed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private void onTransitionCompleted(object sender, ZeroitTransitor.Args e)
        {
            // We stop observing the transition...
            ZeroitTransitor transition = (ZeroitTransitor)sender;

            transition.TransitionCompletedEvent -= onTransitionCompleted;

            // We remove the transition from the collection we're managing...
            lock (m_Lock)
            {
                m_Transitions.Remove(transition);
            }
        }
        /// <summary>
        /// You register a transition with the manager here. This will start to run
        /// the transition as the manager's timer ticks.
        /// </summary>
        /// <param name="transition">The transition.</param>
        public void register(ZeroitTransitor transition)
        {
            lock (m_Lock)
            {
                // We check to see if the properties of this transition
                // are already being animated by any existing transitions...
                removeDuplicates(transition);

                // We add the transition to the collection we manage, and
                // observe it so that we know when it has completed...
                m_Transitions[transition]            = true;
                transition.TransitionCompletedEvent += onTransitionCompleted;
            }
        }
        /// <summary>
        /// Runs the next transition in the list.
        /// </summary>
        private void runNextTransition()
        {
            if (m_listTransitions.Count == 0)
            {
                return;
            }

            // We find the next transition and run it. We also register
            // for its completed event, so that we can start the next transition
            // when this one completes...
            ZeroitTransitor nextTransition = m_listTransitions.First.Value;

            nextTransition.TransitionCompletedEvent += onTransitionCompleted;
            nextTransition.run();
        }
        /// <summary>
        /// Starts the animation.
        /// </summary>
        public void Activate()
        {
            int x       = TransitionTime;
            int flashes = No_Of_Flashes;

            switch (_Transtion)
            {
            case TransitionType.Accelaration:
                ZeroitTransitor accelerate = new ZeroitTransitor(new TransitionType_Acceleration(x));
                accelerate.add(_Target, _Position.ToString(), _destination);
                accelerate.run();
                break;

            case TransitionType.Bounce:
                ZeroitTransitor bounce = new ZeroitTransitor(new TransitionType_Bounce(x));
                bounce.add(_Target, _Position.ToString(), _destination);
                bounce.run();
                break;

            case TransitionType.CriticalDamping:
                ZeroitTransitor criticalDumping = new ZeroitTransitor(new TransitionType_CriticalDamping(x));
                criticalDumping.add(_Target, _Position.ToString(), _destination);
                criticalDumping.run();
                break;

            case TransitionType.Deceleration:
                ZeroitTransitor deceleration = new ZeroitTransitor(new TransitionType_Deceleration(x));
                deceleration.add(_Target, _Position.ToString(), _destination);
                deceleration.run();
                break;

            case TransitionType.EaseInEaseOut:
                ZeroitTransitor easeInEaseOut = new ZeroitTransitor(new TransitionType_EaseInEaseOut(x));
                easeInEaseOut.add(_Target, _Position.ToString(), _destination);
                easeInEaseOut.run();
                break;

            case TransitionType.Flash:
                ZeroitTransitor flash = new ZeroitTransitor(new TransitionType_Flash(flashes, x));
                flash.add(_Target, _Position.ToString(), _destination);
                flash.run();
                break;

            case TransitionType.Linear:
                ZeroitTransitor linear = new ZeroitTransitor(new TransitionType_Linear(x));
                linear.add(_Target, _Position.ToString(), _destination);
                linear.run();
                break;

            case TransitionType.ThrowAndCatch:
                ZeroitTransitor throwAndCatch = new ZeroitTransitor(new TransitionType_ThrowAndCatch(x));
                throwAndCatch.add(_Target, _Position.ToString(), _destination);
                throwAndCatch.run();
                break;

            case TransitionType.Zeroit:
                ZeroitTransitor zeroit = new ZeroitTransitor(new TransitionType_Zeroit(x));
                zeroit.add(_Target, _Position.ToString(), _destination);
                zeroit.run();
                break;

            default:
                break;
            }
        }