Visual Studio toolbox code snippet
Asked Answered
A

1

16

Hi I am trying to create code snippets in my tool box. I dragged code from my code view to toolbox, renamed snippet code to name exSnippet1.

I am trying to find out

-- > Instead of dragging and dropping Can I add code snippets to toolbox dynamically through code to below file ?

..\My Documents\Visual Studio 2010\Settings\CurrentSettings.vssettings

To summarize, I want to create toolbox with code snippets as controls and want to share the toolbox controls to my team for reuse. When I add a codesnippet to toolbox by gragging and dropping, i see the code in currentseetings.vssetting file. What would be the best option to share my toolbox controls to team. Editing vssettings file is not preferred as per this.

Any link which can guide me or any idea would be highly appreciated.

Elaborating little more: 1. I added a few code snippets by dragging and drooping to toolbox 2. I see the code snippets info in my local folder with a file named currentsettings.vssettings 3. I shared my currentsettings.vssettings file with one team member and he used tools/import export and imported this file to get my code snippets on his machine. 4. Do we have any other option than doing the import process? because the current setting file overrides his settings and also he may use other versions of visual studio. 5. I am trying to check if there is any option so that only code snippet part will be imported to his toolbox.

Autohypnosis answered 24/12, 2013 at 17:7 Comment(0)
A
13

Calling it a "snippet" is a great misnomer. The toolbox simply acts like a clipboard in this scenario. It stores bits of text, nothing more. It is automatable, you use the Toolbox interface in a VS add-in. They are stored in a ToolBoxTab named "Clipboard". It can only store 15 of them, doesn't scale at all. Really rather best to leave it to the programmer for his own use.

If you want to create snippets then do just that. Plenty of help around, like the Snippy snippet editor or this snippet designer add-in in the gallery. The MSDN walkthrough page is here.

Aggravation answered 24/12, 2013 at 17:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.