コード例 #1
0
        /// <summary>
        /// Singleton's getInstance method.
        /// </summary>
        public static TransitionManager GetInstance()
        {
            if (_instance == null)
            {
                _instance = new TransitionManager();
            }

            return(_instance);
        }
コード例 #2
0
        /// <summary>
        /// Starts the transition.
        /// </summary>
        public void Run()
        {
            // We find the current start values for the properties we
            // are animating...
            foreach (TransitionedPropertyInfo info in TransitionedProperties)
            {
                object value = info.PropertyInfo.GetValue(info.Target, null);
                info.StartValue = info.ManagedType.Copy(value);
            }

            // We start the stopwatch. We use this when the timer ticks to measure
            // how long the transition has been runnning for...
            _stopwatch.Reset();
            _stopwatch.Start();

            // We register this transition with the transition manager...
            TransitionManager.GetInstance().Register(this);
        }