index > Visual Studio Guidance Automation Toolkit > ValueProvider for the first selected Item in a project?

ValueProvider for the first selected Item in a project?

I am trying to derive a string from the currently selected item in a project.

e.g. - I have a file called "MyData.xsd" selected in the project. I would like to be able to get a handle on that item from a ValueProvider so I can get the name of it.

I see the CurrentSelectedProject ValueProvider but have not been able to find anything for CurrentSelectedItem. my first instinct was to inspect the Properties collection on the Project, but I didn't see anything useful for this situation there.

Is there already a ValueProvider that will get me that Item? If not, are there any suggestions/hints as to how I might access it within my own ValueProvider?

chooch

figured it out.

it's as simple as using an Evaluator and having these 2 arguments like this:

<Argument Name="CurrentProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

<ValueProvider Type="Microsoft.Practices.RecipeFramework.Library.ValueProviders.FirstSelectedProject, Microsoft.Practices.RecipeFramework.Library" />

</Argument>

<Argument Name="ItemName">

<ValueProvider Type="Evaluator" Expression="$(CurrentProject.DTE.SelectedItems.Item(1).Name)" />

</Argument>

chooch
reply 2

You can use google to search for other answers

 

More Articles

• Help with an error message
• Guidance Automation Extensions Registration does not work
• web project template, to fire code in gac class.
• Code samples anywhere ?
• Not able to create a new Guidance Package project
• CAB Module menu item doesn't run
• Conditional Branching of Recipe Actions
• VSTS - Web Test - FIND TEXT command
• Is GAT dead?
• Is there a way to use the T3 engine as a Custom Tool?
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Minor bug in VszWizard.FindAddItem
• Slow loading Guidance Navigator
• June 2006 CTP and Hands On Lab
• Clean up of wizard base form.
• Support for the June or July CTP of VS .
• T4 templates editor?
• Cannot install GAX/GAT June 2006 CTP
• Can't repair/uninstall GAT or GAX
• new to GAT
• Extend the Meta-Guidance Package
• Newbie Problem
• Is there a way to use the T3 engine as a
• Multiple Project Creation Template
• Error "System.ArgumentNullException
• How to add template menu item to custom

Hot Articles

• Declaratively determining if an action r
• Queued Recipe Execution
• Reality Check?
• Registering guidance with the experiment
• Get all classes from a Project?
• DependentUpon
• No assemblies placed in GAC
• How can I Organize templates in the &quo
• uninstall of HoLPackageSetup.msi failed
• Extensibility with DSL
• Will we see an updated GAT Toolkit soon?
• Passing custom objects to t4 templates
• How to execute actions after solution te
• Creating projects in a subdirectory
• Synchronizing - GAT Package Changes

Recommend Articles

• T3 template engine
• Can we checkout file under ClearCase as
• GAT fails to install, claims GAX is miss
• Error installing GAT on VS 2005 (German)
• When is the next release for GAT???
• Set version for Guidance Package
• HoLPackage Registration menu disappear
• Combining GAT and CAB
• warnings when I try to create guidance p
• Nested Project Templates
• Create Add DataSet recipe
• HoL Registration failed
• Newbie Problem
• Upgrading Headaches
• Guidance Package Build