Pergunta

I am developing Visual studio plugin.

In plug in , I am adding error in error list of visual studio plug in.

I know how to add error. Now I want to give help for each error.

I am using below code to add error to error list :

public static ErrorListProvider errorListProvider;
var newError = new ErrorTask();
        newError.ErrorCategory = errorCategory;
        newError.Category = TaskCategory.BuildCompile;
        newError.Text = errorMsg;
        newError.Document = errorDoc;
        newError.Line = line;
errorListProvider.Tasks.Add(newError);

So how to attach Help to each error in error list?

Note: When user right click on error. It menu has "Show error Help" option. I want to give help on that option.

Foi útil?

Solução

Attach eventhandler to Help event of ErrorTask.

newError.Help += new EventHandler(Showhelp);

Put your code in below eventhandler method

static void Showhelp(object sender, EventArgs e)
{
        // Put your code here
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top