Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pulser"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="frequency">The frequency. This is the rate at which this instances pulses, after Delay has passed.</param>
 /// <param name="delay">The delay. This is the time after the pulsor is started or restarted, before it begins pulsing.</param>
 /// <param name="initialState">if set to <c>true</c> IsSignalled will initially be <c>true</c>.</param>
 public Pulser(PulserType type, TimeSpan frequency, TimeSpan delay, bool initialState = false)
 {
     PulserType = type;
     Frequency = frequency;
     Delay = delay;
     IsSignalled = initialState;
     _running = initialState;
     _lastPulsed = DateTime.Now;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pulser"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="frequency">The frequency. This is the rate at which this instances pulses, after Delay has passed.</param>
 /// <param name="delay">The delay. This is the time after the pulsor is started or restarted, before it begins pulsing.</param>
 /// <param name="initialState">if set to <c>true</c> IsSignalled will initially be <c>true</c>.</param>
 public Pulser(PulserType type, TimeSpan frequency, TimeSpan delay, bool initialState)
 {
     this.PulserType  = type;
     this.Frequency   = frequency;
     this.Delay       = delay;
     this.IsSignalled = initialState;
     this.running     = initialState;
     this.lastPulsed  = DateTime.Now;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pulser"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="frequency">The frequency.</param>
 public Pulser(PulserType type, TimeSpan frequency)
     : this(type, frequency, TimeSpan.Zero)
 {
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pulser"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="frequency">The frequency. This is the rate at which this instances pulses, after Delay has passed.</param>
 /// <param name="delay">The delay. This is the time after the pulsor is started or restarted, before it begins pulsing.</param>
 public Pulser(PulserType type, TimeSpan frequency, TimeSpan delay)
     : this(type, frequency, delay, false)
 {
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pulser"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="frequency">The frequency.</param>
 public Pulser(PulserType type, TimeSpan frequency)
     : this(type, frequency, TimeSpan.Zero)
 {
 }