Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comment out a block of code?
Message
De
16/05/2010 21:58:57
 
 
À
16/05/2010 16:52:41
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01464415
Message ID:
01464841
Vues:
44
Being lazy and liking macros I kind of like this approach :

http://stackoverflow.com/questions/210323/what-is-the-easiest-way-to-add-a-visual-studio-2008-context-menu-item

if you're creating an add-in :
http://www.knowdotnet.com/articles/contextmenus.html
http://www.mztools.com/articles/2004/MZ2004003.aspx

http://msdn.microsoft.com/en-us/vstudio/bb614548.aspx

BTW, while poking around I find DevExpress is continuing their freebie give-aways ( winform TextEditor controls, Silverlight stuff ) with DxCore :

http://www.devexpress.com/Products/Visual_Studio_Add-in/DXCore/


>>Worth mentioning, though, that pretty much everything in the VS ide is customizable in ways I never dreamed of in VFP
>>
>>http://blogs.msdn.com/saraford/archive/2008/01/30/did-you-know-you-can-customize-the-commands-on-the-context-menus.aspx
>
>Nice, except I couldn't find a way to add to the ContextMenus, only make changes (or delete) to stuff already there. Am I missing something?
>
>~~Bonnie
>
>
>
>>
>>
>>>>>Ok, its the "Edit" menu not the "File" and yes you did mention the toolbar, but, my point is why would M$ force one to use the main menu or toolbar which is "way up there at the top of the screen" when a very handy context menu is way more convenient!!!! (for those mouse users who can't remember shortcut keys). If an "outdated IDE" like VFP's could do it, why not VS2010? This is a step backwards to me.
>>>>
>>>>I'll admit that it took me awhile to get used to not having a context menu for commenting when I switched from VFP to .NET more than 8 years ago, but if you think about it, you've got a trade-off for the context menu convenience vs having to click "way up there" on a toolbar button in that you've got one extra click to activate a context menu. <g>
>>>>
>>>>~~Bonnie
>>>
>>>
>>>Well my reason/argument for having it in the context menu is that if I go to the trouble of highlighting a bunch of text and then right-clicking to bring up a short cut menu, I'd intuitively EXPECT common actions that could be taken on said text to be available.
>>>
>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>>>>In VFP I like to use the mouse method to highlight the lines that I want to comment out. Then I LOVE the right-click context menu option to comment/uncomment the highlighted text.
>>>>>>>
>>>>>>>In the VS2010 *beta* that I have on my computer, there is NO such option in the context menu. Did this change in the final product? Not only that, but, apparently commenting and uncommenting code is an "Advanced" option in the main File menu!!!! Whoa. Wouldn't want programming noobs messing around with such dangerous features now :)

>>>>>>
>>>>>>I don't think it's ever been in the context menu in Visual Studio. And you meant the "Advanced" option in the "Edit" menu, not the "File" menu ... . which I never use anyway. Tim and I *did* say Toolbar button, not menu item, did we not? (There are two toolbar buttons; one for commenting, one for uncommenting.)
>>>>>>
>>>>>>~~Bonnie
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>I agree with Tim ... and the nice thing about highlighting with the mouse is that you don't have to actually highlight the entire block from the left side of the IDE ... highlighting even just a part of a line will cause it to be commented. I'm sure that's true when using the keyboard shortcuts also, but as Tim points out, if you are using the mouse to highlight, you might as well use it to click the toolbar button. I just find that for large blocks of code, mouse highlighting is easier than keyboard highlighting IMHO.
>>>>>>>>
>>>>>>>>~~Bonnie
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>Thanks to both of you for the quick feedback.
>>>>>>>>>
>>>>>>>>>I have been using the /* technique, but was feeling inefficient. Glad to know there's a faster way.
>>>>>>>>>
>>>>>>>>>:)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>Ctrl+K+C and Ctrl+K+U.
>>>>>>>>>>
>>>>>>>>>>See http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=92ced922-d505-457a-8c9c-84036160639f
>>>>>>>>>>
>>>>>>>>>>You can also just do /* at the beginning and */ at the end of the block.
>>>>>>>>>>
>>>>>>>>>>>Hi,
>>>>>>>>>>>
>>>>>>>>>>>In VFP I could highlight a block of code and do the keyboard shortcut ALT+O,M to comment it out.
>>>>>>>>>>>
>>>>>>>>>>>Is there a keyboard equivalent to do this in VS 2010? I'm using C# if that matters.
>>>>>>>>>>>
>>>>>>>>>>>Thanks,
>>>>>>>>>>>Guy


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform