Volume Control
Application-specific hotkeys for Windows
VolumeControl.WPF.BindableTimer Class Reference
Inheritance diagram for VolumeControl.WPF.BindableTimer:
Collaboration diagram for VolumeControl.WPF.BindableTimer:

Public Member Functions

 BindableTimer ()
 Initializes a new instance of the BindableTimer class, and sets all properties to their default values. More...
 
 BindableTimer (double interval)
 Initializes a new instance of the BindableTimer class, setting the Interval property to the period specified by interval . More...
 
void Close ()
 
void Start ()
 
void Stop ()
 
void Restart ()
 Resets the elapsed time without triggering the Elapsed event. If the timer is stopped, it will be started. More...
 
BindingExpressionBase SetBinding (DependencyProperty dp, BindingBase binding)
 
void BeginInit ()
 
void EndInit ()
 
void Dispose ()
 Disposes of the BindableTimer instance and the underlying timer object. More...
 

Static Public Attributes

const bool DefaultEnabled = false
 Gets the default DefaultEnabled value. More...
 
const double DefaultInterval = 100.0
 Gets the default Interval value. More...
 
const double DefaultMinInterval = 1.0
 Gets the default MinInterval value. More...
 
const double DefaultMaxInterval = int.MaxValue
 Gets the default DefaultMaxInterval value. More...
 
const bool DefaultAutoReset = true
 Gets the default AutoReset value. More...
 
static readonly DependencyProperty EnabledProperty
 The DependencyProperty instance for the Enabled property. More...
 
static readonly DependencyProperty IntervalProperty
 The DependencyProperty instance for the Interval property. More...
 
static readonly DependencyProperty MinIntervalProperty
 The DependencyProperty instance for the MinInterval property. More...
 
static readonly DependencyProperty MaxIntervalProperty
 The DependencyProperty instance for the MaxInterval property. More...
 
static readonly DependencyProperty AutoResetProperty
 The DependencyProperty instance for the AutoReset property. More...
 

Properties

bool Enabled [get, set]
 
double Interval [get, set]
 
double MinInterval [get, set]
 Gets or sets the minimum interval, expressed in milliseconds, at which to raise the Elapsed event.
When attempting to set the interval to a value less than this number, the interval is set to this number instead. More...
 
double MaxInterval [get, set]
 Gets or sets the maximum interval, expressed in milliseconds, at which to raise the Elapsed event.
When attempting to set the interval to a value greater than this number, the interval is set to this number instead. More...
 
bool AutoReset [get, set]
 
ISite? Site [get, set]
 
EventHandler? Disposed
 

Events

System.Timers.? ElapsedEventHandler Elapsed
 

Detailed Description

Uses System.Timers.Timer & supports WPF data binding for related properties.

Constructor & Destructor Documentation

◆ BindableTimer() [1/2]

VolumeControl.WPF.BindableTimer.BindableTimer ( )

Initializes a new instance of the BindableTimer class, and sets all properties to their default values.

References VolumeControl.WPF.BindableTimer.AutoReset, VolumeControl.WPF.BindableTimer.Enabled, and VolumeControl.WPF.BindableTimer.Interval.

◆ BindableTimer() [2/2]

VolumeControl.WPF.BindableTimer.BindableTimer ( double  interval)

Initializes a new instance of the BindableTimer class, setting the Interval property to the period specified by interval .

Parameters
intervalThe time, in milliseconds, between events. The value must be greater than zero and less than or equal to int.MaxValue.

References VolumeControl.WPF.BindableTimer.Interval.

Member Function Documentation

◆ Dispose()

void VolumeControl.WPF.BindableTimer.Dispose ( )

Disposes of the BindableTimer instance and the underlying timer object.

Referenced by VolumeControl.WPF.BindableTimer.Close().

Here is the caller graph for this function:

◆ Restart()

void VolumeControl.WPF.BindableTimer.Restart ( )

Resets the elapsed time without triggering the Elapsed event. If the timer is stopped, it will be started.

Does not cause the value of the Enabled property to change, unless the timer was stopped prior to calling this method.

References VolumeControl.WPF.BindableTimer.Enabled.

Member Data Documentation

◆ AutoResetProperty

readonly DependencyProperty VolumeControl.WPF.BindableTimer.AutoResetProperty
static
Initial value:
= DependencyProperty.Register(
nameof(AutoReset),
typeof(bool),
typeof(BindableTimer),
new PropertyMetadata(DefaultAutoReset, OnAutoResetPropertyChanged))
bool AutoReset
Definition: BindableTimer.cs:212
const bool DefaultAutoReset
Gets the default AutoReset value.
Definition: BindableTimer.cs:64
BindableTimer()
Initializes a new instance of the BindableTimer class, and sets all properties to their default value...
Definition: BindableTimer.cs:21

The DependencyProperty instance for the AutoReset property.

◆ DefaultAutoReset

const bool VolumeControl.WPF.BindableTimer.DefaultAutoReset = true
static

Gets the default AutoReset value.

◆ DefaultEnabled

const bool VolumeControl.WPF.BindableTimer.DefaultEnabled = false
static

Gets the default DefaultEnabled value.

◆ DefaultInterval

const double VolumeControl.WPF.BindableTimer.DefaultInterval = 100.0
static

Gets the default Interval value.

◆ DefaultMaxInterval

const double VolumeControl.WPF.BindableTimer.DefaultMaxInterval = int.MaxValue
static

Gets the default DefaultMaxInterval value.

◆ DefaultMinInterval

const double VolumeControl.WPF.BindableTimer.DefaultMinInterval = 1.0
static

Gets the default MinInterval value.

◆ EnabledProperty

readonly DependencyProperty VolumeControl.WPF.BindableTimer.EnabledProperty
static
Initial value:
= DependencyProperty.Register(
nameof(Enabled),
typeof(bool),
typeof(BindableTimer),
new PropertyMetadata(DefaultEnabled, OnEnabledPropertyChanged))
const bool DefaultEnabled
Gets the default DefaultEnabled value.
Definition: BindableTimer.cs:48
bool Enabled
Definition: BindableTimer.cs:93

The DependencyProperty instance for the Enabled property.

◆ IntervalProperty

readonly DependencyProperty VolumeControl.WPF.BindableTimer.IntervalProperty
static
Initial value:
= DependencyProperty.Register(
nameof(Interval),
typeof(double),
typeof(BindableTimer),
new PropertyMetadata(DefaultInterval, OnIntervalPropertyChanged, OnIntervalCoerceValue))
const double DefaultInterval
Gets the default Interval value.
Definition: BindableTimer.cs:52
double Interval
Definition: BindableTimer.cs:116

The DependencyProperty instance for the Interval property.

◆ MaxIntervalProperty

readonly DependencyProperty VolumeControl.WPF.BindableTimer.MaxIntervalProperty
static
Initial value:
= DependencyProperty.Register(
nameof(MaxInterval),
typeof(double),
typeof(BindableTimer),
new PropertyMetadata(DefaultMaxInterval))
const double DefaultMaxInterval
Gets the default DefaultMaxInterval value.
Definition: BindableTimer.cs:60
double MaxInterval
Gets or sets the maximum interval, expressed in milliseconds, at which to raise the Elapsed event....
Definition: BindableTimer.cs:190

The DependencyProperty instance for the MaxInterval property.

◆ MinIntervalProperty

readonly DependencyProperty VolumeControl.WPF.BindableTimer.MinIntervalProperty
static
Initial value:
= DependencyProperty.Register(
nameof(MinInterval),
typeof(double),
typeof(BindableTimer),
new PropertyMetadata(DefaultMinInterval))
const double DefaultMinInterval
Gets the default MinInterval value.
Definition: BindableTimer.cs:56
double MinInterval
Gets or sets the minimum interval, expressed in milliseconds, at which to raise the Elapsed event....
Definition: BindableTimer.cs:161

The DependencyProperty instance for the MinInterval property.

Property Documentation

◆ MaxInterval

double VolumeControl.WPF.BindableTimer.MaxInterval
getset

Gets or sets the maximum interval, expressed in milliseconds, at which to raise the Elapsed event.
When attempting to set the interval to a value greater than this number, the interval is set to this number instead.

The maximum possible interval allowed by System.Timers.Timer cannot be greater than int.MaxValue.

Exceptions
ArgumentOutOfRangeExceptionValue is greater than int.MaxValue.

◆ MinInterval

double VolumeControl.WPF.BindableTimer.MinInterval
getset

Gets or sets the minimum interval, expressed in milliseconds, at which to raise the Elapsed event.
When attempting to set the interval to a value less than this number, the interval is set to this number instead.

The minimum possible interval allowed by System.Timers.Timer cannot be less than or equal to zero.

Exceptions
ArgumentOutOfRangeExceptionValue is less than or equal to zero.

The documentation for this class was generated from the following file: