C# 클래스 Sanford.Threading.DelegateQueue

Represents an asynchronous queue of delegates.
상속: System.Threading.SynchronizationContext, IComponent, ISynchronizeInvoke
파일 보기 프로젝트 열기: hmadrigal/playground-dotnet 1 사용 예제들

공개 메소드들

메소드 설명
BeginInvoke ( Delegate method ) : IAsyncResult

Executes the delegate on the main thread that this DelegateQueue executes on.

The delegate is called asynchronously, and this method returns immediately. You can call this method from any thread. If you need the return value from a process started with this method, call EndInvoke to get the value.

If you need to call the delegate synchronously, use the Invoke method instead.

DelegateQueue ( string name ) : System

Initializes a new instance of the DelegateQueue class.

DelegateQueue ( string name, IContainer container ) : System

Initializes a new instance of the DelegateQueue class with the specified IContainer object.

Dispose ( ) : void

Disposes of the DelegateQueue.

EndInvoke ( IAsyncResult result ) : object

Waits until the process started by calling BeginInvoke completes, and then returns the value generated by the process.

This method gets the return value of the asynchronous operation represented by the IAsyncResult passed by this interface. If the asynchronous operation has not completed, this method will wait until the result is available.

Invoke ( Delegate method ) : object

Executes the delegate on the main thread that this DelegateQueue executes on.

Unlike BeginInvoke, this method operates synchronously, that is, it waits until the process completes before returning. Exceptions raised during the call are propagated back to the caller.

Use this method when calling a method from a different thread to marshal the call to the proper thread.

Post ( SendOrPostCallback d, object state ) : void

Dispatches an asynchronous message to this synchronization context.

The Post method starts an asynchronous request to post a message.

Send ( SendOrPostCallback d, object state ) : void

Dispatches a synchronous message to this synchronization context.

The Send method starts an synchronous request to send a message.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void
OnDisposed ( EventArgs e ) : void
OnInvokeCompleted ( InvokeCompletedEventArgs e ) : void
OnPostCompleted ( Sanford.Threading.PostCompletedEventArgs e ) : void

비공개 메소드들

메소드 설명
DelegateProcedure ( ) : void
InitializeDelegateQueue ( string name ) : void

메소드 상세

BeginInvoke() 공개 메소드

Executes the delegate on the main thread that this DelegateQueue executes on.

The delegate is called asynchronously, and this method returns immediately. You can call this method from any thread. If you need the return value from a process started with this method, call EndInvoke to get the value.

If you need to call the delegate synchronously, use the Invoke method instead.

public BeginInvoke ( Delegate method ) : IAsyncResult
method System.Delegate /// A Delegate to a method that takes parameters of the same number and type that /// are contained in args. ///
리턴 IAsyncResult

DelegateQueue() 공개 메소드

Initializes a new instance of the DelegateQueue class.
public DelegateQueue ( string name ) : System
name string
리턴 System

DelegateQueue() 공개 메소드

Initializes a new instance of the DelegateQueue class with the specified IContainer object.
public DelegateQueue ( string name, IContainer container ) : System
name string
container IContainer /// The IContainer to which the DelegateQueue will add itself. ///
리턴 System

Dispose() 공개 메소드

Disposes of the DelegateQueue.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

EndInvoke() 공개 메소드

Waits until the process started by calling BeginInvoke completes, and then returns the value generated by the process.
This method gets the return value of the asynchronous operation represented by the IAsyncResult passed by this interface. If the asynchronous operation has not completed, this method will wait until the result is available.
public EndInvoke ( IAsyncResult result ) : object
result IAsyncResult /// An IAsyncResult interface that represents the asynchronous operation started /// by calling BeginInvoke. ///
리턴 object

Invoke() 공개 메소드

Executes the delegate on the main thread that this DelegateQueue executes on.

Unlike BeginInvoke, this method operates synchronously, that is, it waits until the process completes before returning. Exceptions raised during the call are propagated back to the caller.

Use this method when calling a method from a different thread to marshal the call to the proper thread.

public Invoke ( Delegate method ) : object
method System.Delegate /// A Delegate that contains a method to call, in the context of the thread for the DelegateQueue. ///
리턴 object

OnDisposed() 보호된 메소드

protected OnDisposed ( EventArgs e ) : void
e System.EventArgs
리턴 void

OnInvokeCompleted() 보호된 메소드

protected OnInvokeCompleted ( InvokeCompletedEventArgs e ) : void
e InvokeCompletedEventArgs
리턴 void

OnPostCompleted() 보호된 메소드

protected OnPostCompleted ( Sanford.Threading.PostCompletedEventArgs e ) : void
e Sanford.Threading.PostCompletedEventArgs
리턴 void

Post() 공개 메소드

Dispatches an asynchronous message to this synchronization context.
The Post method starts an asynchronous request to post a message.
public Post ( SendOrPostCallback d, object state ) : void
d SendOrPostCallback /// The SendOrPostCallback delegate to call. ///
state object /// The object passed to the delegate. ///
리턴 void

Send() 공개 메소드

Dispatches a synchronous message to this synchronization context.
The Send method starts an synchronous request to send a message.
public Send ( SendOrPostCallback d, object state ) : void
d SendOrPostCallback /// The SendOrPostCallback delegate to call. ///
state object /// The object passed to the delegate. ///
리턴 void