Under Desk Bike

    Show / Hide Table of Contents

    Class Bike

    The primary class for the under desk bike.

    Inheritance
    object
    NotifyObject
    Bike
    Implements
    INotifyPropertyChanged
    IDisposable
    Inherited Members
    NotifyObject.PropertyChanged
    NotifyObject.SetProperty<T>(ref T, T, Action<T>, string)
    NotifyObject.OnPropertyChanged(string)
    Namespace: UnderDeskBike
    Assembly: UnderDeskBike.Device.dll
    Syntax
    public class Bike : NotifyObject, INotifyPropertyChanged, IDisposable

    Constructors

    | Improve this Doc View Source

    Bike(TextWriter?)

    Initializes a new instance of the Bike class.

    public Bike(TextWriter? logger = null)
    Parameters
    Type Name Description
    TextWriter logger

    The logger.

    See Also
    NotifyObject
    IDisposable

    Properties

    | Improve this Doc View Source

    IsConnected

    Gets a value indicating whether this instance is connected.

    public bool IsConnected { get; }
    Property Type
    bool
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    IsWorkoutRunning

    Gets a value indicating whether this instance is workout active.

    public bool IsWorkoutRunning { get; }
    Property Type
    bool
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    WorkoutData

    Gets the distance in miles.

    public BikeWorkoutData WorkoutData { get; }
    Property Type
    BikeWorkoutData
    See Also
    NotifyObject
    IDisposable

    Methods

    | Improve this Doc View Source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    public void Dispose()
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    Dispose(bool)

    Releases unmanaged and - optionally - managed resources.

    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    StartListening()

    Start listening for a connection.

    public Task StartListening()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    StartWorkout(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
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    StopListening()

    Stops the listening.

    public Task StopListening()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    StopWorkout()

    Stops the workout.

    public Task StopWorkout()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    WaitForConnection()

    Waits for connection.

    public Task WaitForConnection()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    WaitForWorkout()

    Waits for workout end.

    public Task WaitForWorkout()
    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    See Also
    NotifyObject
    IDisposable

    Events

    | Improve this Doc View Source

    Connected

    Occurs when connected.

    public event EventHandler? Connected
    Event Type
    EventHandler
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    Disconnected

    Occurs when disconnected.

    public event EventHandler? Disconnected
    Event Type
    EventHandler
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    Error

    Occurs when a background error is triggered

    public event EventHandler<ExceptionEventArgs>? Error
    Event Type
    EventHandler<ExceptionEventArgs>
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    WorkoutEnded

    Occurs when ending workout.

    public event EventHandler? WorkoutEnded
    Event Type
    EventHandler
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    WorkoutStarted

    Occurs when start workout.

    public event EventHandler? WorkoutStarted
    Event Type
    EventHandler
    See Also
    NotifyObject
    IDisposable
    | Improve this Doc View Source

    WorkoutUpdate

    Occurs when workout update occurs.

    public event EventHandler<BikeWorkoutEventArgs>? WorkoutUpdate
    Event Type
    EventHandler<BikeWorkoutEventArgs>
    See Also
    NotifyObject
    IDisposable

    Implements

    INotifyPropertyChanged
    IDisposable

    See Also

    NotifyObject
    IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright (c) 2021 by Wayne Venables