C# 클래스 WinRTXamlToolkit.Tools.BackgroundTimer

A timer that raises the Tick events on a background thread, similar to ThreadPoolTimer, but with API compatible with DispatcherTimer.
It was written in response to this SO question: Controlled non UI timer in metro app (.NET) (http://stackoverflow.com/questions/10493253/controlled-non-ui-timer-in-metro-app-net). The purpose was to have ticks on a background thread and have the same API as the DispatcherTimer. It also has an option to self adjust a bit to have an average frequency closer to what you would expect given the configured Interval. That said I was not aware of the ThreadPoolTimer, so it is possible it makes more sense to use that one. It is a bit strange that the two timers we get have different APIs though, so perhaps that is one case where using the BackgroundTimer makes a little bit of sense.
상속: IDisposable
파일 보기 프로젝트 열기: xyzzer/WinRTXamlToolkit 1 사용 예제들

공개 메소드들

메소드 설명
BackgroundTimer ( ) : System

Initializes a new instance of the BackgroundTimer class.

Dispose ( ) : void

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

Start ( ) : void

Starts the BackgroundTimer.

Stop ( ) : void

Stops the BackgroundTimer. Waits for it to stop before returning.

StopNonBlocking ( ) : void

Stops the BackgroundTimer - non blocking.

비공개 메소드들

메소드 설명
Run ( ) : void
RunAdjusted ( ) : void

메소드 상세

BackgroundTimer() 공개 메소드

Initializes a new instance of the BackgroundTimer class.
public BackgroundTimer ( ) : System
리턴 System

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

Start() 공개 메소드

Starts the BackgroundTimer.
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stops the BackgroundTimer. Waits for it to stop before returning.
public Stop ( ) : void
리턴 void

StopNonBlocking() 공개 메소드

Stops the BackgroundTimer - non blocking.
public StopNonBlocking ( ) : void
리턴 void