Lousy.Mon.EventToken.PlaceholderToken C# (CSharp) Method

PlaceholderToken() public static method

Factory method for creating an empty event token. Used in conjunction with PassOn for creating animations out of order.
public static PlaceholderToken ( ) : EventToken
return EventToken
        public static EventToken PlaceholderToken()
        {
            return new EventToken();
        }

Usage Example

Example #1
0
        /// <summary>
        /// <para>Executes the user code after a specified duration.</para>
        /// <para>Note: This method produces a working EventToken</para>
        /// </summary>
        /// <param name="duration"></param>
        /// <param name="timeType"></param>
        /// <returns>A token representing the animation</returns>
        public override EventToken After(double duration, OrSo timeType)
        {
            DispatcherTimer timer       = new DispatcherTimer();
            EventToken      placeholder = EventToken.PlaceholderToken();

            timer.Interval = GetTimeSpan(duration, timeType);
            timer.Tick    += (s, e) =>
            {
                timer.Stop();
                placeholder.PassOn(Now());
            };
            timer.Start();

            return(placeholder);
        }
All Usage Examples Of Lousy.Mon.EventToken::PlaceholderToken