55
66namespace GitHub . VisualStudio . Views . GitHubPane
77{
8+ /// <summary>
9+ /// Used to filter commands send to <see cref="IVsTextView"/> dispatch them to a <see cref="Exec"/> event.
10+ /// </summary>
811 class TextViewCommandDispatcher : IOleCommandTarget , IDisposable
912 {
1013 readonly IVsTextView textView ;
1114 readonly Guid commandGroup ;
1215 readonly int commandId ;
1316 readonly IOleCommandTarget next ;
1417
18+ /// <summary>
19+ /// Add a command filter to <see cref="IVsTextView"/>.
20+ /// </summary>
21+ /// <param name="textView">The text view to filter commands from.</param>
22+ /// <param name="commandGroup">The group of the command to filter.</param>
23+ /// <param name="commandId">The ID of the command to filter.</param>
1524 public TextViewCommandDispatcher ( IVsTextView textView , Guid commandGroup , int commandId )
1625 {
1726 this . textView = textView ;
@@ -21,6 +30,9 @@ public TextViewCommandDispatcher(IVsTextView textView, Guid commandGroup, int co
2130 ErrorHandler . ThrowOnFailure ( textView . AddCommandFilter ( this , out next ) ) ;
2231 }
2332
33+ /// <summary>
34+ /// Remove the command filter.
35+ /// </summary>
2436 public void Dispose ( )
2537 {
2638 ErrorHandler . ThrowOnFailure ( textView . RemoveCommandFilter ( this ) ) ;
@@ -54,6 +66,9 @@ int IOleCommandTarget.QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] p
5466 return next ? . QueryStatus ( ref pguidCmdGroup , cCmds , prgCmds , pCmdText ) ?? 0 ;
5567 }
5668
69+ /// <summary>
70+ /// Fired when a command of the filtered type is executed.
71+ /// </summary>
5772 public event EventHandler Exec ;
5873 }
5974}
0 commit comments