コード例 #1
0
        /// <summary>
        /// Creates a deep copy, replacing the specified parameters.
        /// </summary>
        /// <param name="source">The new source for the copy.</param>
        /// <param name="destination">The new destination for the copy.</param>
        /// <returns>A copy of the event.</returns>
        /// <remarks>
        /// A common design pattern is to queue data event copies, each with its own unique data payload, to state machines for handling.
        /// </remarks>
        public NSFEvent copy(INSFNamedObject source, INSFEventHandler destination)
        {
            NSFEvent eventCopy = copy();

            eventCopy.Source      = source;
            eventCopy.Destination = destination;
            return(eventCopy);
        }
コード例 #2
0
        /// <summary>
        /// Creates a deep copy, replacing the specified parameters.
        /// </summary>
        /// <param name="source">The new source for the copy.</param>
        /// <param name="destination">The new destination for the copy.</param>
        /// <param name="data">The new data for the copy.</param>
        /// <returns>A copy of the event.</returns>
        /// <remarks>
        /// A common design pattern is to queue data event copies, each with its own unique data payload, to state machines for handling.
        /// </remarks>
        public NSFDataEvent <DataType> copy(INSFNamedObject source, INSFEventHandler destination, DataType data)
        {
            NSFDataEvent <DataType> eventCopy = copy(data);

            eventCopy.Source      = source;
            eventCopy.Destination = destination;
            return(eventCopy);
        }
コード例 #3
0
 /// <summary>
 /// Creates event that can have a data payload.
 /// </summary>
 /// <param name="name">The name of the event.</param>
 /// <param name="source">The source of the event.</param>
 /// <param name="destination">The destination of the event.</param>
 /// <param name="data">The data of the event.</param>
 public NSFDataEvent(NSFString name, INSFNamedObject source, INSFEventHandler destination, DataType data)
     : base(name, source, destination)
 {
     Data = data;
 }
コード例 #4
0
 /// <summary>
 /// Creates event that can have a data payload.
 /// </summary>
 /// <param name="name">The name of the event.</param>
 /// <param name="source">The source of the event.</param>
 /// <param name="destination">The destination of event.</param>
 public NSFDataEvent(NSFString name, INSFNamedObject source, INSFEventHandler destination)
     : base(name, source, destination)
 {
 }
コード例 #5
0
 public void queueEvent(NSFEvent nsfEvent, INSFNamedObject source)
 {
     nsfEvent.Source = source;
     queueEvent(nsfEvent);
 }
コード例 #6
0
 /// <summary>
 /// Creates an event.
 /// </summary>
 /// <param name="name">The name of the event.</param>
 /// <param name="source">The source of the event.</param>
 /// <param name="destination">The destination of the event.</param>
 public NSFEvent(NSFString name, INSFNamedObject source, INSFEventHandler destination)
     : base(name)
 {
     construct(NSFUniquelyNumberedObject.getNextUniqueId(), source, destination);
 }
コード例 #7
0
 private void construct(NSFId id, INSFNamedObject source, INSFEventHandler destination)
 {
     Id = id;
     Source = source;
     Destination = destination;
 }
コード例 #8
0
 /// <summary>
 /// Sets the source and destination of the event.
 /// </summary>
 /// <param name="source">Source of the event.</param>
 /// <param name="destination">Destination of the event.</param>
 public void setRouting(INSFNamedObject source, INSFEventHandler destination)
 {
     Source = source;
     Destination = destination;
 }
コード例 #9
0
 /// <summary>
 /// Schedules the event to execute.
 /// </summary>
 /// <param name="source">Source of the event.</param>
 /// <param name="destination">Destination of the event.</param>
 /// <param name="delayTime">Delay time before executing the event.</param>
 /// <param name="repeatTime">Repeat time, if desired.  Zero if one-shot.</param>
 public void schedule(INSFNamedObject source, INSFEventHandler destination, NSFTime delayTime, NSFTime repeatTime)
 {
     Source = source;
     Destination = destination;
     NSFTimerThread.PrimaryTimerThread.scheduleAction(this, delayTime, repeatTime);
 }
コード例 #10
0
 /// <summary>
 /// Creates a deep copy, replacing the specified parameters.
 /// </summary>
 /// <param name="name">The new name for the copy.</param>
 /// <param name="source">The new source for the copy.</param>
 /// <param name="destination">The new destination for the copy.</param>
 /// <returns>A copy of the event.</returns>
 /// <remarks>
 /// A common design pattern is to queue data event copies, each with its own unique data payload, to state machines for handling.
 /// </remarks>
 public NSFEvent copy(NSFString name, INSFNamedObject source, INSFEventHandler destination)
 {
     NSFEvent eventCopy = copy();
     eventCopy.Name = name;
     eventCopy.Source = source;
     eventCopy.Destination = destination;
     return eventCopy;
 }
コード例 #11
0
 /// <summary>
 /// Creates an event.
 /// </summary>
 /// <param name="name">The name of the event.</param>
 /// <param name="source">The source of the event.</param>
 /// <param name="destination">The destination of the event.</param>
 public NSFEvent(NSFString name, INSFNamedObject source, INSFEventHandler destination)
     : base(name)
 {
     construct(NSFUniquelyNumberedObject.getNextUniqueId(), source, destination);
 }
コード例 #12
0
 private void construct(NSFId id, INSFNamedObject source, INSFEventHandler destination)
 {
     Id          = id;
     Source      = source;
     Destination = destination;
 }
コード例 #13
0
 /// <summary>
 /// Sets the source and destination of the event.
 /// </summary>
 /// <param name="source">Source of the event.</param>
 /// <param name="destination">Destination of the event.</param>
 public void setRouting(INSFNamedObject source, INSFEventHandler destination)
 {
     Source      = source;
     Destination = destination;
 }
コード例 #14
0
 /// <summary>
 /// Schedules the event to execute.
 /// </summary>
 /// <param name="source">Source of the event.</param>
 /// <param name="destination">Destination of the event.</param>
 /// <param name="delayTime">Delay time before executing the event.</param>
 /// <param name="repeatTime">Repeat time, if desired.  Zero if one-shot.</param>
 public void schedule(INSFNamedObject source, INSFEventHandler destination, NSFTime delayTime, NSFTime repeatTime)
 {
     Source      = source;
     Destination = destination;
     NSFTimerThread.PrimaryTimerThread.scheduleAction(this, delayTime, repeatTime);
 }
コード例 #15
0
 public void queueEvent(NSFEvent nsfEvent, INSFNamedObject source)
 {
     nsfEvent.Source = source;
     queueEvent(nsfEvent);
 }