Esempio n. 1
0
 /// <inheritdoc/>
 public void Dispose()
 {
     if (helper != null)
     {
         helper.Dispose();
         helper = null;
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new <see cref="PushButton"/> instance.
        /// </summary>
        public RotaryEncoder()
        {
            // Create helper
            buttonHelper = new PushButtonHelper(this);

            // Lower debounce timeout
            buttonHelper.DebounceTimeout = 10;

            // Create events
            rotatedEvent = new ObservableEvent <IRotaryEncoder, RotaryEncoderRotatedEventArgs>(firstAdded: EnsureInitialized);
        }
Esempio n. 3
0
 /// <inheritdoc/>
 public void Dispose()
 {
     if (buttonHelper != null)
     {
         buttonHelper.Dispose();
         buttonHelper = null;
     }
     if (clockPin != null)
     {
         clockPin.Dispose();
         clockPin = null;
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new <see cref="PushButton"/> instance.
 /// </summary>
 public PushButton()
 {
     // Create helper
     helper = new PushButtonHelper(this);
 }