leonard chan leonard chan - 2 months ago 16
C# Question

Completion Command Handler

I was trying out the "Displaying Statement Completion Walkthrough" on MSDN but am unable to build it without error.

On the site they asked to build TestCompletionCommandHandler class. Under Implementing The Completion Command Handler Provider.

However on Implementing the Completion Command Handler. It asked to create another classname by the same name, TestCompletionCommandHandler class.

Question.


  1. Which is the correct class name?



Thank you

Answer

Here is a cite from the site (I hope you are talking about)

Walkthrough: Displaying Statement Completion

Implementing the Completion Command Handler Provider

To implement the completion command handler provider

  1. Add a file named TestCompletionCommandHandler.
  2. Add a class named TestCompletionHandlerProvider that implements IVsTextViewCreationListener.

Implementing the Completion Command Handler

To implement the completion command handler

  1. Add a class named TestCompletionCommandHandler that implements IOleCommandTarget:

The instruction is very clear that you should end up with one file named TestCompletionCommandHandler.cs containing two classes and both classes have for sure different names:

[Export(typeof(IVsTextViewCreationListener))]
[Name("token completion handler")]
[ContentType("plaintext")]
[TextViewRole(PredefinedTextViewRoles.Editable)]
internal class TestCompletionHandlerProvider : IVsTextViewCreationListener
{
    // implementation
}

internal class TestCompletionCommandHandler : IOleCommandTarget
{
   // implementation 
}
Comments