C# Класс Hourglass.Windows.TimerWindow

A timer window.
Наследование: INotifyPropertyChanged, IRestorableWindow
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
OnPropertyChanged ( ) : void

Raises the PropertyChanged event.

Приватные методы

Метод Описание
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.

Описание методов

BringToFront() публичный Метод

Brings the window to the front.
public BringToFront ( ) : bool
Результат bool

BringToFrontAndActivate() публичный Метод

Brings the window to the front, activates it, and focusses it.
public BringToFrontAndActivate ( ) : void
Результат void

MinimizeToNotificationArea() публичный Метод

Minimizes the window to the notification area of the taskbar.
This method does nothing if Settings.ShowInNotificationArea is false.
public MinimizeToNotificationArea ( ) : void
Результат void

OnPropertyChanged() защищенный Метод

Raises the PropertyChanged event.
protected OnPropertyChanged ( ) : void
Результат void

Show() публичный Метод

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.
Результат void

Show() публичный Метод

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 .
Результат void

TimerWindow() публичный Метод

Initializes a new instance of the TimerWindow class.
public TimerWindow ( ) : System
Результат System

TimerWindow() публичный Метод

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. ///
Результат System

TimerWindow() публичный Метод

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.
Результат System

ToString() публичный Метод

Returns a string that represents the current object.
public ToString ( ) : string
Результат string

Описание свойств

CancelCommand публичное статическое свойство

Cancels editing.
public static RoutedCommand,System.Windows.Input CancelCommand
Результат System.Windows.Input.RoutedCommand

CloseCommand публичное статическое свойство

Closes the window.
public static RoutedCommand,System.Windows.Input CloseCommand
Результат System.Windows.Input.RoutedCommand

EscapeCommand публичное статическое свойство

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
Результат System.Windows.Input.RoutedCommand

FullScreenCommand публичное статическое свойство

Toggles full-screen mode.
public static RoutedCommand,System.Windows.Input FullScreenCommand
Результат System.Windows.Input.RoutedCommand

PauseCommand публичное статическое свойство

Pauses a running timer.
public static RoutedCommand,System.Windows.Input PauseCommand
Результат System.Windows.Input.RoutedCommand

PauseResumeCommand публичное статическое свойство

Resumes a paused or resumes timer.
public static RoutedCommand,System.Windows.Input PauseResumeCommand
Результат System.Windows.Input.RoutedCommand

ResetCommand публичное статическое свойство

Enters input mode.
public static RoutedCommand,System.Windows.Input ResetCommand
Результат System.Windows.Input.RoutedCommand

ResumeCommand публичное статическое свойство

Resumes a paused timer.
public static RoutedCommand,System.Windows.Input ResumeCommand
Результат System.Windows.Input.RoutedCommand

StartCommand публичное статическое свойство

Starts a new timer.
public static RoutedCommand,System.Windows.Input StartCommand
Результат System.Windows.Input.RoutedCommand

StopCommand публичное статическое свойство

Stops a running timer and enters input mode.
public static RoutedCommand,System.Windows.Input StopCommand
Результат System.Windows.Input.RoutedCommand

UpdateCommand публичное статическое свойство

Updates the app.
public static RoutedCommand,System.Windows.Input UpdateCommand
Результат System.Windows.Input.RoutedCommand