C# Class RemoteViewing.Utility.PollingSynchronizationContext

A synchronization context that can be used if you want to handle events by polling.
Inheritance: System.Threading.SynchronizationContext
Mostrar archivo Open project: qmfrederik/remoteviewing

Public Methods

Method Description
CheckEvents ( int timeout ) : bool

Dequeues and runs an action, if one is queued.

Post ( SendOrPostCallback d, object state ) : void

Posts an action to run when PollingSynchronizationContext.CheckEvents is called. This will not block.

Send ( SendOrPostCallback d, object state ) : void

Sends an action to run when PollingSynchronizationContext.CheckEvents is called. This will block until then. This will lock up if you call it from the same thread you use for checking events.

Private Methods

Method Description
Post ( System.Action action ) : void

Post an action to run when PollingSynchronizationContext.CheckEvents is called. This will not block.

Method Details

CheckEvents() public method

Dequeues and runs an action, if one is queued.
public CheckEvents ( int timeout ) : bool
timeout int The number of milliseconds to wait for an action to run.
return bool

Post() public method

Posts an action to run when PollingSynchronizationContext.CheckEvents is called. This will not block.
public Post ( SendOrPostCallback d, object state ) : void
d SendOrPostCallback The callback.
state object State to pass to the callback.
return void

Send() public method

Sends an action to run when PollingSynchronizationContext.CheckEvents is called. This will block until then. This will lock up if you call it from the same thread you use for checking events.
public Send ( SendOrPostCallback d, object state ) : void
d SendOrPostCallback The callback.
state object State to pass to the callback.
return void