Compartilhar via


CommonMessagePump Class

Definition

CommonMessagePump allows callers to block the current thread until a handle or handles have been signaled. During the wait the IDE will be placed in a modal state to prevent reentrancy. If the wait takes more than 2 secs a wait dialog is presented to the user which can be canceled (by default). Callers can call the default behaviour 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 etc. 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, timeout or a handle being signaled. This interface can also be used to detemine if the wait should continue or return.

public ref class CommonMessagePump : Microsoft::Internal::VisualStudio::Shell::Interop::IOleComponent2Private, Microsoft::VisualStudio::OLE::Interop::IOleComponent, Microsoft::VisualStudio::Shell::Interop::IVsCommonMessagePump
[Windows::Foundation::Metadata::WebHostHidden]
class CommonMessagePump : Microsoft::Internal::VisualStudio::Shell::Interop::IOleComponent2Private, Microsoft::VisualStudio::OLE::Interop::IOleComponent, Microsoft::VisualStudio::Shell::Interop::IVsCommonMessagePump
public class CommonMessagePump : Microsoft.Internal.VisualStudio.Shell.Interop.IOleComponent2Private, Microsoft.VisualStudio.OLE.Interop.IOleComponent, Microsoft.VisualStudio.Shell.Interop.IVsCommonMessagePump
type CommonMessagePump = class
    interface IVsCommonMessagePump
    interface IOleComponent2Private
    interface IOleComponent
Public Class CommonMessagePump
Implements IOleComponent, IOleComponent2Private, IVsCommonMessagePump
Inheritance
CommonMessagePump
Implements
Microsoft.Internal.VisualStudio.Shell.Interop.IOleComponent2Private IOleComponent IVsCommonMessagePump

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.

Constructors

CommonMessagePump()

Initializes a new instance of CommonMessagePump.

Properties

AllowCancel

Controls if the wait dialog has an enabled cancel button.

CurrentStep

Current step for the progress control of the wait dialog.

EnableRealProgress

Determines what type of progress control to use in the Wait Dialog. true indicates a percentage progress. false indicates a marquee stype progress. Only has an effect before calling the ModalWait functions.

ProgressText

Gets the progress text.

StatusBarText

Text of the status bar during the wait.

Timeout

Set the timeout value for the modal wait. Use TimeSpan.MaxValue for an infinite wait.

TotalSteps

Total number of steps for the progress control of the wait dialog.

WaitText

Wait dialog text for what we are waiting on.

WaitTitle

Title of the wait dialog

Methods

ModalWaitForHandles(WaitHandle)

Blocks the current thread by pumping messages until either a timeout or the specified handle has been signaled.

ModalWaitForHandles(WaitHandle[], Int32)

Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.

ModalWaitForHandles(WaitHandle[], IVsCommonMessagePumpClientEvents)

Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.

Explicit Interface Implementations

IOleComponent.FContinueMessageLoop(UInt32, IntPtr, MSG[])

Called during each iteration of a message loop.

IOleComponent.FDoIdle(UInt32)

Gives the component a chance to do idle time tasks.

IOleComponent.FPreTranslateMessage(MSG[])

Processes the message before it is translated and dispatched.

IOleComponent.FQueryTerminate(Int32)

Called when the component manager wishes to know if the component is in a state in which it can terminate.

IOleComponent.FReserved1(UInt32, UInt32, IntPtr, IntPtr)

Reserved.

IOleComponent.HwndGetWindow(UInt32, UInt32)

Retrieves a window associated with the component.

IOleComponent.OnActivationChange(IOleComponent, Int32, OLECRINFO[], Int32, OLECHOSTINFO[], UInt32)

Notifies the component when a new object is being activated.

IOleComponent.OnAppActivate(Int32, UInt32)

Notifies the component when the host application gains or loses activation.

IOleComponent.OnEnterState(UInt32, Int32)

Notifies the component when the application enters or exits the specified state.

IOleComponent.OnLoseActivation()

Notifies the active component that it has lost its active status because the host or another component has become active.

IOleComponent.Terminate()

Terminates the message loop.

IOleComponent2Private.FContinueMessageLoop(UInt32, IntPtr, MSG[])
IOleComponent2Private.FDoIdle(UInt32)
IOleComponent2Private.FPreTranslateMessage(MSG[])
IOleComponent2Private.FQueryTerminate(Int32)
IOleComponent2Private.FReserved1(UInt32, UInt32, IntPtr, IntPtr)
IOleComponent2Private.GetWaitHandlesAndTimeout(IntPtr[], UInt32, UInt32, IntPtr)
IOleComponent2Private.HwndGetWindow(UInt32, UInt32)
IOleComponent2Private.OnActivationChange(IOleComponent, Int32, OLECRINFO[], Int32, OLECHOSTINFO[], UInt32)
IOleComponent2Private.OnAppActivate(Int32, UInt32)
IOleComponent2Private.OnEnterState(UInt32, Int32)
IOleComponent2Private.OnHandleSignaled(UInt32, IntPtr, Boolean)
IOleComponent2Private.OnLoseActivation()
IOleComponent2Private.OnTimeout(IntPtr, Boolean)
IOleComponent2Private.Terminate()
IVsCommonMessagePump.EnableRealProgress(Boolean)

Determines the kind of progress to be displayed

IVsCommonMessagePump.ModalWaitForObjects(IntPtr[], UInt32, UInt32)

Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.

IVsCommonMessagePump.ModalWaitForObjectsWithClient(IntPtr[], UInt32, IVsCommonMessagePumpClientEvents)

Blocks the current thread by pumping messages until either a timeout or one of the specified handles has been signaled.

IVsCommonMessagePump.SetAllowCancel(Boolean)

Controls if the wait dialog has an enabled cancel button.

IVsCommonMessagePump.SetProgressInfo(Int32, Int32, String)

Sets progress information for the message.

IVsCommonMessagePump.SetStatusBarText(String)

Text of the status bar during the wait.

IVsCommonMessagePump.SetTimeout(UInt32)

Set the timeout value for the modal wait. Use 0xFFFFFFFF for an infinite wait.

IVsCommonMessagePump.SetWaitText(String)

Wait dialog text for what we are waiting on.

IVsCommonMessagePump.SetWaitTitle(String)

Title of the wait dialog

Applies to