Click here to Skip to main content
16,016,535 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
When I add an eventHandler to a control, the intellisense comes up just fine, and (optionally) produces a method stub. I don't like the provided method stub, and would like to change it. If you're curious, I would like it to be private void rather than [Default] void.

Please let me know how to modify the generated method stub produced by intellisense.
Posted

1 solution

You need to edit the MethodStub.snippet file.

On my VS C# Express 2005 this is located at

C:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033\Refactoring

The addition is shown underlined

                <![CDATA[private $signature$
{
 	$end$throw new $Exception$("The method or operation is not implemented.");
}]]>


I haven't tested this fully but I imagine that all generated method stubs will now be private.

Alan.

[UPDATE]
I'm going to downvote myself as the modification works well for auto-implemented event handlers but doubles up the private prefix in other situations, e.g.
C#
private private string PvrDriveInformation()
{
     throw new Exception("The method or operation is not implemented.");
}

Rats!
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900