Created
July 26, 2013 01:50
-
-
Save kazuk/6085409 to your computer and use it in GitHub Desktop.
Enumerate Project Property
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ template debug="false" hostspecific="true" language="C#" #> | |
<#@ assembly name="System.Core" #> | |
<#@ assembly name="EnvDTE" #> | |
<#@ import namespace="EnvDTE" #> | |
<#@ import namespace="System.Linq" #> | |
<#@ import namespace="System.ComponentModel" #> | |
<#@ import namespace="System.Text" #> | |
<#@ import namespace="System.Collections.Generic" #> | |
<#@ output extension=".txt" #> | |
<# | |
EnumerateHostProjectProperty(); | |
#> | |
<#+ | |
public void EnumerateHostProjectProperty() | |
{ | |
var sp = Host as IServiceProvider; | |
var dte = (DTE)sp.GetService( typeof( DTE ) ); | |
var projItem = dte.Solution.FindProjectItem( Host.TemplateFile ); | |
var project = projItem.ContainingProject; | |
foreach( Property item in project.Properties ) | |
{ | |
#> | |
<#=item.Name#> <#=item.Value#> | |
<#+ | |
} | |
} | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment