visual studio item template - find out current folder - visual-studio-2010

When you right click on a folder and 'add a new item', is there a way to find out the current folder? I'm trying to display a default name for my custom item template in the add new item dialog box.
Want this to be dynamic based on the current folder.
I'm currently using the DefaultName property which gives me a static default name.

Related

How to make form templates in visual basic 6?

I would like to make a template for all the forms I create in my visual basic 6 project, for example I want to put a header on all the forms that contains user name etc, I know in c# all I have to do is make the form with appropriate controls and make all other forms inherit from in, in visual basic 6 there does not seem to be a way to make a form inherit from another?
According to MSDN:
To create your own template, save the object that you want to use as a
template, then copy it to the appropriate subdirectory of the Visual
Basic Template directory. For example, to create a custom MyForm form
template, save a form named MyForm, then copy the MyForm.frm file to
the \VB\Template\Forms directory. When you select the Add Form command
from the Project menu, Visual Basic displays the MyForm template in
the Add Form dialog box...
So...design a form any way you want--with whatever code, controls, etc. Then save it and copy it to the \VB\Template\Forms directory.

How to make an item template, which would be available on all project types

I am making a Visual Studio extension, which allows to embed web pages into your projects and solutions: https://visualstudiogallery.msdn.microsoft.com/52bd30dd-596f-40a9-94a9-ba3fb250c671
Alpha is out. However, I have a problem: item template for a web page link indeed appears in File -> 'New -> File ...' dialog, but not when I do right click on C# project, and select 'New Item ...' there. I understand, that I can add identical template to ItemTemplates folder, specific to C# projects, but I want my template be easily available in all project types via 'New Item ...'.
Is there a way to do it?
If you use the item templates to display all the projects you need to create the Custom item templates like Custom project system.

How to add new Code Generation Item for EF Designer?

Can anyone tell me how to create an Item Template that can be used by the EF designer for the Add Code Generation Item option? I have created the Item Template and it works like a dream! However, I can't figure out how to get it to show up in the Add Code Generation Item dialog. FWIW I'm using a VSIX Project to deploy the Item Template.
The .vstemplate file in your Item Template project must have the ADONETArtifactGenerator_ prefix.

Copy home template to make changes & test on hidden menu

I want to copy my Homepage (index page) and make the copy appear on the hidden part of my website as so i can make changes and test it before i put the new page up live...
So i basically want to be able to type a URL and see the page on the web, yet I don't want that page to apart of the websites main menu...
Make a new menu from the menu management name it like 'hidden menu' or something else then add new menu item on it .
Don't publish your hidden menu elsewhere in site. Assign your copied template to your new menu item created under hidden menu.
Now you can copy the link of new menu to the url.
Copy (aka duplicate) your content article (= index page, hompage content). You can access it via URI index.php?option=com_content&view=article&id=<ID> and replace <ID> with your articles ID.
This is for Joomla 3:
Go into the Template Manager and copy your existing template to make a new one e.g. 'YourTemplateName2'.
Note that a style 'YourTemplateName2 - Default' will automatically be created as well.
Edit the new template.
Preview the new template, either:
In Styles, using the 'eye' icon to the left of the style name, or
In Templates, using the link 'Preview' under the style name, or
Using the URL GET parameter 'template' like this:
"http://www.example.com//index.php?template=YourTemplateName2
If you use the 'Preview' link or the 'eye' icon, you'll get a preview with the extra parameter 'tp=1' - this shows you some extra info, but if you want to preview the site exactly as it'll look to the user then you can just delete this parameter.
When you're happy with your changes, either set the new template to be the default template, or copy the details from your new template to the existing one.
Hope that helps.

Extending VS 2010: to include additional items on Right Click context menu (add) on solution explorer?

I wish to create an additional item on the context sensitive right click "ADD" on the solution explorer in vs 2010.
Basically it currently looks like this
New Item
Existing Item
New Folder
Add ASP.NET FOLDER // ACTUALLY THIS IS A MENU with a SUB MENU
Class
What i am trying to do is create a new item similar to "Add asp.net folder" hence it will have subitems
Basically it will be something like this
Add JS items
Add new model
Add new plugin
Basically clicking on "add new model" or "add new plugin" will create a new file UTF-8 and include in the project. It will contain some default code.
I am having a real issue trying to find a good example of how to do this.
Any ideas where i should look?
Anybody seen anything similar?
THanks in advance
Here are some docs to point you in the right direction.
http://msdn.microsoft.com/en-us/library/bb165473.aspx
http://msdn.microsoft.com/en-us/library/bb164699.aspx
Basically commands and menus work the same throughout all of VS, one tricky part is just finding the right Guid of the parent menu that you want to hook in to.

Resources