Compartilhar via


CommonMessagePump Class

Allows callers to block the current thread until a handle or handles have been signaled.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.Shell.CommonMessagePump

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Public Class CommonMessagePump _
    Implements IVsCommonMessagePump, IOleComponent
public class CommonMessagePump : IVsCommonMessagePump, 
    IOleComponent
public ref class CommonMessagePump : IVsCommonMessagePump, 
    IOleComponent
type CommonMessagePump =  
    class 
        interface IVsCommonMessagePump 
        interface IOleComponent 
    end
public class CommonMessagePump implements IVsCommonMessagePump, IOleComponent

The CommonMessagePump type exposes the following members.

Constructors

  Name Description
Public method CommonMessagePump Initializes a new instance of CommonMessagePump.

Top

Properties

  Name Description
Public property AllowCancel Determines whether the wait dialog has an enabled cancel button.
Public property CurrentStep Gets the current step for the progress control of the wait dialog.
Public property EnableRealProgress Determines the type of progress control to use in the wait dialog.
Public property ProgressText Gets the progress text.
Public property StatusBarText Gets or sets the text of the status bar during the wait.
Public property Timeout Gets or sets the timeout value for the modal wait.
Public property TotalSteps Gets the total number of steps for the progress control of the wait dialog.
Public property WaitText Gets or sets the wait dialog text.
Public property WaitTitle Gets or sets the title of the wait dialog.

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ModalWaitForHandles(WaitHandle) Blocks the current thread by pumping messages until either a timeout or the specified handle has been signaled.
Public method ModalWaitForHandles(array<WaitHandle[], IVsCommonMessagePumpClientEvents) Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.
Public method ModalWaitForHandles(array<WaitHandle[], Int32%) Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IOleComponent.FContinueMessageLoop Called during each iteration of a message loop.
Explicit interface implemetationPrivate method IOleComponent.FDoIdle Gives the component a chance to do idle time tasks.
Explicit interface implemetationPrivate method IOleComponent.FPreTranslateMessage Processes the message before it is translated and dispatched.
Explicit interface implemetationPrivate method IOleComponent.FQueryTerminate Called when the component manager wishes to know if the component is in a state in which it can terminate.
Explicit interface implemetationPrivate method IOleComponent.FReserved1 Reserved.
Explicit interface implemetationPrivate method IOleComponent.HwndGetWindow Retrieves a window associated with the component.
Explicit interface implemetationPrivate method IOleComponent.OnActivationChange Notifies the component when a new object is being activated.
Explicit interface implemetationPrivate method IOleComponent.OnAppActivate Notifies the component when the host application gains or loses activation.
Explicit interface implemetationPrivate method IOleComponent.OnEnterState Notifies the component when the application enters or exits the specified state.
Explicit interface implemetationPrivate method IOleComponent.OnLoseActivation Notifies the active component that it has lost its active status because the host or another component has become active.
Explicit interface implemetationPrivate method IOleComponent.Terminate Terminates the message loop.
Explicit interface implemetationPrivate method IVsCommonMessagePump.EnableRealProgress Determines the kind of progress to be displayed
Explicit interface implemetationPrivate method IVsCommonMessagePump.ModalWaitForObjects Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.
Explicit interface implemetationPrivate method IVsCommonMessagePump.ModalWaitForObjectsWithClient Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.
Explicit interface implemetationPrivate method IVsCommonMessagePump.SetAllowCancel Determines whether the wait dialog has an enabled cancel button.
Explicit interface implemetationPrivate method IVsCommonMessagePump.SetProgressInfo Sets progress information for the message.
Explicit interface implemetationPrivate method IVsCommonMessagePump.SetStatusBarText Sets the text of the status bar during the wait.
Explicit interface implemetationPrivate method IVsCommonMessagePump.SetTimeout Sets the timeout value for the modal wait.
Explicit interface implemetationPrivate method IVsCommonMessagePump.SetWaitText Sets the wait dialog text.
Explicit interface implemetationPrivate method IVsCommonMessagePump.SetWaitTitle Sets the title of the wait dialog with the specified title.

Top

Remarks

During the wait, the IDE is placed in a modal state to prevent reentrancy. If the wait takes more than 2 seconds, a wait dialog is presented to the user which can be canceled (by default). Callers can use the default behavior, which will show default text in the wait dialog, or they can provide custom values for things like the dialog text, status bar text, timeout values, and so on.

Callers can also provide a custom implementation of IVsCommonMessagePumpClientEvents, which allows the client to run code when certain events occur such as messages being processed, a timeout, or a handle being signaled. This interface can also be used to determine if the wait should continue or return.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.Shell Namespace