/// <summary> /// Handles execution of Rotated event /// </summary> /// <param name="args">RotaryEvent Args</param> private void RotaryEventManager_Rotated(ElmSharp.Wearable.RotaryEventArgs args) { _currentMoveTime = DateTime.Now; var span = _currentMoveTime - _lastMoveTime; _lastMoveTime = _currentMoveTime; if (span.TotalMilliseconds <= 4) { return; } if (args.IsClockwise) { if (_currentScreen == 3) { return; } SwitchScreen(_currentScreen + 1); } else { if (_currentScreen == 0) { return; } SwitchScreen(_currentScreen - 1); } }
void OnRotaryEventChanged(ElmSharp.Wearable.RotaryEventArgs e) { if (_currentRotaryFocusObject is IRotaryEventReceiver receiver) { receiver.Rotate(new RotaryEventArgs { IsClockwise = e.IsClockwise }); } }
/// <summary> /// Rotated event handler /// </summary> /// <param name="args">Rotary event arguments.</param> private void OnRotated(ElmSharp.Wearable.RotaryEventArgs args) { if (args.IsClockwise) { ZoomLevel++; } else { ZoomLevel--; } }
void OnRotaryEventChanged(ElmSharp.Wearable.RotaryEventArgs e) { _rotaryReceiver?.Rotate(new RotaryEventArgs { IsClockwise = e.IsClockwise }); }