Class Bike
The primary class for the under desk bike.
Inherited Members
Namespace: UnderDeskBike
Assembly: UnderDeskBike.Device.dll
Syntax
public class Bike : NotifyObject, INotifyPropertyChanged, IDisposable
Constructors
| Improve this Doc View SourceBike(TextWriter?)
Initializes a new instance of the Bike class.
public Bike(TextWriter? logger = null)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | logger | The logger. |
See Also
Properties
| Improve this Doc View SourceIsConnected
Gets a value indicating whether this instance is connected.
public bool IsConnected { get; }
Property Type
bool |
See Also
| Improve this Doc View SourceIsWorkoutRunning
Gets a value indicating whether this instance is workout active.
public bool IsWorkoutRunning { get; }
Property Type
bool |
See Also
| Improve this Doc View SourceWorkoutData
Gets the distance in miles.
public BikeWorkoutData WorkoutData { get; }
Property Type
BikeWorkoutData |
See Also
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
See Also
| Improve this Doc View SourceDispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
|
See Also
| Improve this Doc View SourceStartListening()
Start listening for a connection.
public Task StartListening()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
See Also
| Improve this Doc View SourceStartWorkout(int)
Starts the workout.
public Task<bool> StartWorkout(int interval = 250)
Parameters
Type | Name | Description |
---|---|---|
int | interval | The interval. |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. |
See Also
| Improve this Doc View SourceStopListening()
Stops the listening.
public Task StopListening()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
See Also
| Improve this Doc View SourceStopWorkout()
Stops the workout.
public Task StopWorkout()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
See Also
| Improve this Doc View SourceWaitForConnection()
Waits for connection.
public Task WaitForConnection()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
See Also
| Improve this Doc View SourceWaitForWorkout()
Waits for workout end.
public Task WaitForWorkout()
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
See Also
Events
| Improve this Doc View SourceConnected
Occurs when connected.
public event EventHandler? Connected
Event Type
EventHandler |
See Also
| Improve this Doc View SourceDisconnected
Occurs when disconnected.
public event EventHandler? Disconnected
Event Type
EventHandler |
See Also
| Improve this Doc View SourceError
Occurs when a background error is triggered
public event EventHandler<ExceptionEventArgs>? Error
Event Type
EventHandler<ExceptionEventArgs> |
See Also
| Improve this Doc View SourceWorkoutEnded
Occurs when ending workout.
public event EventHandler? WorkoutEnded
Event Type
EventHandler |
See Also
| Improve this Doc View SourceWorkoutStarted
Occurs when start workout.
public event EventHandler? WorkoutStarted
Event Type
EventHandler |
See Also
| Improve this Doc View SourceWorkoutUpdate
Occurs when workout update occurs.
public event EventHandler<BikeWorkoutEventArgs>? WorkoutUpdate
Event Type
EventHandler<BikeWorkoutEventArgs> |