Ejemplo n.º 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);
        }
        /// <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);
        }
 /// <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;
 }
 /// <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)
 {
 }
 public void queueEvent(NSFEvent nsfEvent, INSFNamedObject source)
 {
     nsfEvent.Source = source;
     queueEvent(nsfEvent);
 }
 /// <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);
 }
 private void construct(NSFId id, INSFNamedObject source, INSFEventHandler destination)
 {
     Id = id;
     Source = source;
     Destination = destination;
 }
 /// <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;
 }
 /// <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);
 }
 /// <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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 12
0
 private void construct(NSFId id, INSFNamedObject source, INSFEventHandler destination)
 {
     Id          = id;
     Source      = source;
     Destination = destination;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
 public void queueEvent(NSFEvent nsfEvent, INSFNamedObject source)
 {
     nsfEvent.Source = source;
     queueEvent(nsfEvent);
 }