C# Class Hourglass.Windows.TimerWindow

A timer window.
Inheritance: INotifyPropertyChanged, IRestorableWindow
ファイルを表示 Open project: Dziemborowicz/Hourglass Class Usage Examples

Public Properties

Property Type Description
CancelCommand System.Windows.Input.RoutedCommand
CloseCommand System.Windows.Input.RoutedCommand
EscapeCommand System.Windows.Input.RoutedCommand
FullScreenCommand System.Windows.Input.RoutedCommand
PauseCommand System.Windows.Input.RoutedCommand
PauseResumeCommand System.Windows.Input.RoutedCommand
ResetCommand System.Windows.Input.RoutedCommand
ResumeCommand System.Windows.Input.RoutedCommand
StartCommand System.Windows.Input.RoutedCommand
StopCommand System.Windows.Input.RoutedCommand
UpdateCommand System.Windows.Input.RoutedCommand

Public Methods

Method Description
BringToFront ( ) : bool

Brings the window to the front.

BringToFrontAndActivate ( ) : void

Brings the window to the front, activates it, and focusses it.

MinimizeToNotificationArea ( ) : void

Minimizes the window to the notification area of the taskbar.

This method does nothing if Settings.ShowInNotificationArea is false.

Show ( Timer existingTimer ) : void

Opens the TimerWindow if it is not already open and displays the specified timer.

Show ( TimerStart timerStart ) : void

Opens the TimerWindow if it is not already open and displays a new timer started with the specified TimerStart.

TimerWindow ( ) : System

Initializes a new instance of the TimerWindow class.

TimerWindow ( Timer timer ) : System

Initializes a new instance of the TimerWindow class.

TimerWindow ( TimerStart timerStart ) : System

Initializes a new instance of the TimerWindow class.

ToString ( ) : string

Returns a string that represents the current object.

Protected Methods

Method Description
OnPropertyChanged ( ) : void

Raises the PropertyChanged event.

Private Methods

Method Description
BeginExpirationAnimation ( bool glowOnly = false ) : void

Begins the animation used to notify the user that the timer has expired.

BeginExpirationAnimationAndSound ( ) : void

Begins the animation and sound used to notify the user that the timer has expired.

BeginExpirationSound ( ) : void

Begins the sound used to notify the user that the timer has expired.

BeginValidationErrorAnimation ( ) : void

Begins the animation used notify the user that the input was invalid.

BindTimer ( ) : void

Binds the TimerWindow event handlers and controls to a timer.

ButtonMouseEnter ( object sender, System.Windows.Input.MouseEventArgs e ) : void

Invoked when the mouse pointer enters the bounds of a Button.

ButtonMouseLeave ( object sender, System.Windows.Input.MouseEventArgs e ) : void

Invoked when the mouse pointer leaves the bounds of a Button.

CancelCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the CancelCommand is executed.

CancelOrReset ( ) : bool

When the window is in input mode, this method switches back to status mode if there is a running or paused timer or it stops the notification sound if it is playing.

When the window is in status mode, this method switches to input mode if the timer is expired or stops the notification sound if it is playing.

This is invoked when the user presses the Escape key, or performs an equivalent action.

CloseCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the CloseCommand is executed.

EndAnimationsAndSounds ( ) : void

Stops all animations and sounds.

EscapeCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the EscapeCommand is executed.

FlashExpirationStoryboardCompleted ( object sender, EventArgs e ) : void

Invoked when the flash expiration storyboard has completely finished playing.

FullScreenCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the FullScreenCommand is executed.

InitializeAnimations ( ) : void

Initializes the animation members.

InitializeResources ( ) : void

Initializes localized resources.

InitializeSoundPlayer ( ) : void

Initializes the sound player.

InitializeUpdateButton ( ) : void

Initializes the update button.

PauseCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the PauseCommand is executed.

PauseResumeCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the PauseResumeCommand is executed.

ResetCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the ResetCommand is executed.

ResumeCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the ResumeCommand is executed.

SoundPlayerPlaybackCompleted ( object sender, EventArgs e ) : void

Invoked when sound playback has completed.

SoundPlayerPlaybackStarted ( object sender, EventArgs e ) : void

Invoked when sound playback has started.

SoundPlayerPlaybackStopped ( object sender, EventArgs e ) : void

Invoked when sound playback has stopped.

StartCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the StartCommand is executed.

StopCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the StopCommand is executed.

SwitchToInputMode ( TextBox textBoxToFocus = null ) : void

Sets the window to accept user input to start a new Timer.

SwitchToStatusMode ( ) : void

Sets the window to display the status of a running or paused Timer.

ThemePropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Invoked when a Theme property value changes.

TimerExpired ( object sender, EventArgs e ) : void

Invoked when the timer expires.

TimerOptionsPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Invoked when a TimerOptions property value changes.

TimerPaused ( object sender, EventArgs e ) : void

Invoked when the timer is paused.

TimerPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Invoked when a timer property value changes.

TimerResumed ( object sender, EventArgs e ) : void

Invoked when the timer is resumed from a paused state.

TimerStarted ( object sender, EventArgs e ) : void

Invoked when the timer is started.

TimerStopped ( object sender, EventArgs e ) : void

Invoked when the timer is stopped.

TimerTextBoxPreviewGotKeyboardFocus ( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

Invoked when the TimerTextBox is in the process of acquiring keyboard focus.

TimerTextBoxPreviewMouseDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

Invoked when any mouse button is pressed while the pointer is over the TimerTextBox.

TimerTick ( object sender, EventArgs e ) : void

Invoked when the timer ticks.

TitleTextBoxKeyDown ( object sender, System.Windows.Input.KeyEventArgs e ) : void

Invoked when a key on the keyboard is pressed in the TitleTextBox.

TitleTextBoxPreviewGotKeyboardFocus ( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

Invoked when the TitleTextBox is in the process of acquiring keyboard focus.

TitleTextBoxPreviewMouseDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

Invoked when any mouse button is pressed while the pointer is over the TitleTextBox.

UnbindTimer ( ) : void

Unbinds the TimerWindow event handlers and controls from a timer.

UnfocusAll ( ) : bool

Removes focus from all controls.

UpdateBoundControls ( ) : void

Updates the controls bound to timer properties.

UpdateBoundTheme ( ) : void

Updates the control properties set by the bound theme.

UpdateCommandExecuted ( object sender, System.Windows.Input.ExecutedRoutedEventArgs e ) : void

Invoked when the UpdateCommand is executed.

UpdateKeepAwake ( ) : void

Updates the registration of this window in the KeepAwakeManager based on the state of the timer.

UpdateManagerPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Invoked when a UpdateManager property value changes.

UpdateTaskbarProgress ( ) : void

Updates the progress shown in the taskbar.

UpdateWindowTitle ( ) : void

Updates the window title.

WindowClosing ( object sender, CancelEventArgs e ) : void

Invoked directly after Window.Close is called, and can be handled to cancel window closure.

WindowLoaded ( object sender, RoutedEventArgs e ) : void

Invoked when the TimerWindow is laid out, rendered, and ready for interaction.

WindowMouseDoubleClick ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

Invoked when a mouse button is clicked two or more times on the TimerWindow.

WindowMouseDown ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void

Invoked when any mouse button is depressed on the TimerWindow.

WindowStateChanged ( object sender, EventArgs e ) : void

Invoked when the window's WindowState property changes.

Method Details

BringToFront() public method

Brings the window to the front.
public BringToFront ( ) : bool
return bool

BringToFrontAndActivate() public method

Brings the window to the front, activates it, and focusses it.
public BringToFrontAndActivate ( ) : void
return void

MinimizeToNotificationArea() public method

Minimizes the window to the notification area of the taskbar.
This method does nothing if Settings.ShowInNotificationArea is false.
public MinimizeToNotificationArea ( ) : void
return void

OnPropertyChanged() protected method

Raises the PropertyChanged event.
protected OnPropertyChanged ( ) : void
return void

Show() public method

Opens the TimerWindow if it is not already open and displays the specified timer.
public Show ( Timer existingTimer ) : void
existingTimer Hourglass.Timing.Timer A timer.
return void

Show() public method

Opens the TimerWindow if it is not already open and displays a new timer started with the specified TimerStart.
public Show ( TimerStart timerStart ) : void
timerStart Hourglass.Timing.TimerStart A .
return void

TimerWindow() public method

Initializes a new instance of the TimerWindow class.
public TimerWindow ( ) : System
return System

TimerWindow() public method

Initializes a new instance of the TimerWindow class.
public TimerWindow ( Timer timer ) : System
timer Hourglass.Timing.Timer The timer to resume when the window loads, or null if no timer is to be resumed. ///
return System

TimerWindow() public method

Initializes a new instance of the TimerWindow class.
public TimerWindow ( TimerStart timerStart ) : System
timerStart Hourglass.Timing.TimerStart The to start when the window loads, or null if no /// is to be started.
return System

ToString() public method

Returns a string that represents the current object.
public ToString ( ) : string
return string

Property Details

CancelCommand public_oe static_oe property

Cancels editing.
public static RoutedCommand,System.Windows.Input CancelCommand
return System.Windows.Input.RoutedCommand

CloseCommand public_oe static_oe property

Closes the window.
public static RoutedCommand,System.Windows.Input CloseCommand
return System.Windows.Input.RoutedCommand

EscapeCommand public_oe static_oe property

Exits input mode, enters input mode, or exits full-screen mode depending on the state of the window.
public static RoutedCommand,System.Windows.Input EscapeCommand
return System.Windows.Input.RoutedCommand

FullScreenCommand public_oe static_oe property

Toggles full-screen mode.
public static RoutedCommand,System.Windows.Input FullScreenCommand
return System.Windows.Input.RoutedCommand

PauseCommand public_oe static_oe property

Pauses a running timer.
public static RoutedCommand,System.Windows.Input PauseCommand
return System.Windows.Input.RoutedCommand

PauseResumeCommand public_oe static_oe property

Resumes a paused or resumes timer.
public static RoutedCommand,System.Windows.Input PauseResumeCommand
return System.Windows.Input.RoutedCommand

ResetCommand public_oe static_oe property

Enters input mode.
public static RoutedCommand,System.Windows.Input ResetCommand
return System.Windows.Input.RoutedCommand

ResumeCommand public_oe static_oe property

Resumes a paused timer.
public static RoutedCommand,System.Windows.Input ResumeCommand
return System.Windows.Input.RoutedCommand

StartCommand public_oe static_oe property

Starts a new timer.
public static RoutedCommand,System.Windows.Input StartCommand
return System.Windows.Input.RoutedCommand

StopCommand public_oe static_oe property

Stops a running timer and enters input mode.
public static RoutedCommand,System.Windows.Input StopCommand
return System.Windows.Input.RoutedCommand

UpdateCommand public_oe static_oe property

Updates the app.
public static RoutedCommand,System.Windows.Input UpdateCommand
return System.Windows.Input.RoutedCommand