C# Class PReview.CommandFilter

Inheritance: Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget, IDisposable
显示文件 Open project: laurentkempe/PReview

Public Methods

Method Description
Dispose ( ) : void

Protected Methods

Method Description
CommandFilter ( ) : System

Initializes a new instance of the CommandFilter class.

Connect ( ) : Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget

Enables the command filter by connecting it to a chain of command targets.

Do not call this method directly. This method is called as necessary when Enabled is set to .

Disconnect ( ) : void

Disables the command filter by disconnecting it from a chain of command targets.

Do not call this method directly. This method is called as necessary when Enabled is set to .

Dispose ( bool disposing ) : void

Releases the unmanaged resources used by this instance.

When disposing is , the default implementation sets Enabled to .

HandlePostExec ( System.Guid &commandGroup, uint commandId, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut ) : void

This method supports specialized handling in response to commands that are successfully handled by another command target.

This method is only called if HandlePreExec for the current instance returned and the next command target in the chain returned a value indicating the command execution succeeded.

The default implementation is empty.

HandlePreExec ( System.Guid &commandGroup, uint commandId, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut ) : bool

This method supports the implementation for commands which are directly implemented by this command filter.

The default implementation returns for all commands.

QueryCommandStatus ( System.Guid &commandGroup, uint commandId ) : Microsoft.VisualStudio.OLE.Interop.OLECMDF

Gets the current status of a particular command.

The base implementation returns 0 for all commands, indicating the command is not supported by this command filter.

QueryParameterList ( System.Guid &commandGroup, uint commandId, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut ) : int
ThrowIfDisposed ( ) : void

Throw an ObjectDisposedException if the current instance has been disposed.

Private Methods

Method Description
ExecCommand ( System.Guid &guidCmdGroup, uint nCmdID, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut ) : int
IOleCommandTarget ( System.Guid &guidCmdGroup, uint cCmds, Microsoft.VisualStudio.OLE.Interop.OLECMD prgCmds, IntPtr pCmdText ) : int
IOleCommandTarget ( System.Guid &guidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut ) : int
InnerExec ( System.Guid &commandGroup, uint commandId, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut ) : int

Method Details

CommandFilter() protected method

Initializes a new instance of the CommandFilter class.
protected CommandFilter ( ) : System
return System

Connect() protected abstract method

Enables the command filter by connecting it to a chain of command targets.
Do not call this method directly. This method is called as necessary when Enabled is set to .
protected abstract Connect ( ) : Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget
return Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget

Disconnect() protected abstract method

Disables the command filter by disconnecting it from a chain of command targets.
Do not call this method directly. This method is called as necessary when Enabled is set to .
protected abstract Disconnect ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources used by this instance.
When disposing is , the default implementation sets Enabled to .
protected Dispose ( bool disposing ) : void
disposing bool if this method is being called from ; otherwise, if this method is being called from a finalizer.
return void

HandlePostExec() protected method

This method supports specialized handling in response to commands that are successfully handled by another command target.
This method is only called if HandlePreExec for the current instance returned and the next command target in the chain returned a value indicating the command execution succeeded.

The default implementation is empty.

protected HandlePostExec ( System.Guid &commandGroup, uint commandId, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut ) : void
commandGroup System.Guid The command group.
commandId uint The command ID.
executionOptions Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT The OLE command execution options.
pvaIn System.IntPtr An optional pointer to the command argument(s). The semantics of this parameter are specific to a particular command.
pvaOut System.IntPtr An optional pointer to the command result(s). The semantics of this parameter are specific to a particular command.
return void

HandlePreExec() protected method

This method supports the implementation for commands which are directly implemented by this command filter.
The default implementation returns for all commands.
protected HandlePreExec ( System.Guid &commandGroup, uint commandId, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut ) : bool
commandGroup System.Guid The command group.
commandId uint The command ID.
executionOptions Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT The OLE command execution options.
pvaIn System.IntPtr An optional pointer to the command argument(s). The semantics of this parameter are specific to a particular command.
pvaOut System.IntPtr An optional pointer to the command result(s). The semantics of this parameter are specific to a particular command.
return bool

QueryCommandStatus() protected method

Gets the current status of a particular command.
The base implementation returns 0 for all commands, indicating the command is not supported by this command filter.
protected QueryCommandStatus ( System.Guid &commandGroup, uint commandId ) : Microsoft.VisualStudio.OLE.Interop.OLECMDF
commandGroup System.Guid The command group.
commandId uint The command ID.
return Microsoft.VisualStudio.OLE.Interop.OLECMDF

QueryParameterList() protected method

protected QueryParameterList ( System.Guid &commandGroup, uint commandId, Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT executionOptions, IntPtr pvaIn, IntPtr pvaOut ) : int
commandGroup System.Guid
commandId uint
executionOptions Microsoft.VisualStudio.OLE.Interop.OLECMDEXECOPT
pvaIn System.IntPtr
pvaOut System.IntPtr
return int

ThrowIfDisposed() protected method

Throw an ObjectDisposedException if the current instance has been disposed.
If the current instance has been disposed.
protected ThrowIfDisposed ( ) : void
return void