Ejemplo n.º 1
0
        /// <summary>
        /// Execute a command to perform an animation sequence.
        /// </summary>
        /// <param name="eventHandler">The handler for the animation timeline.</param>
        /// <param name="arguments">The arguments for the animation timeline.</param>
        public void Enqueue(StorylineHandler timelineHandler, params object[] arguments)
        {
            // Place the new command in a list of items that will be executed in the order they are place in the queue.
            this.storylineQueue.Enqueue(new TimelineSegment(timelineHandler, arguments));

            // Animation is accomplished through a series of event handlers that run as each animation before it completes.  The
            // queue is the starting point for each of these animation sequences.  It holds commands that have queued up while the
            // previous animations -- which take a finite amount of time to complete -- finish their time lines.  This action
            // 'primes' the queue that drives the animations.  Note that the command is invoked through the dispatcher at a very
            // low proprity.  This allows the windows subsystem to update.
            if (storylineQueue.Count == 1)
            {
                Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.ApplicationIdle,
                                                         (StartCommandDelegate)(() => { StartCommand(); }));
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a description of a method that should be invoked with the specified arguments.
 /// </summary>
 /// <param name="argumentDelegate">The method that should be invoked.</param>
 /// <param name="arguments">The arguments of the method invokation.</param>
 public TimelineSegment(StorylineHandler genericEventHandler, params object[] arguments)
 {
     // Initialize the object
     this.TimelineHandler  = genericEventHandler;
     this.GenericEventArgs = new GenericEventArgs(arguments);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a description of a method that should be invoked with the specified arguments.
 /// </summary>
 /// <param name="argumentDelegate">The method that should be invoked.</param>
 /// <param name="arguments">The arguments of the method invokation.</param>
 public TimelineSegment(StorylineHandler genericEventHandler, GenericEventArgs genericEventArgs)
 {
     // Initialize the object
     this.TimelineHandler  = genericEventHandler;
     this.GenericEventArgs = genericEventArgs;
 }