Access Project Custom Properties in LPT template

Posts   
 
    
basik
User
Posts: 123
Joined: 20-Aug-2012
# Posted on: 02-May-2013 14:13:08   

Hi,

I couldn't work out how to access a projects Custom Properties in a custom LPT template and couldn't find anything on the forum. Anyway I thought I'd share my discovery.

To access the Custom Properties key value pair collection for a project from within a custom LPT template.


      Project currentProject = _executingGenerator.ProjectDefinition;
      string customAppName = currentProject.OutputSettingValues.CustomProperties["ApplicationName"];

Walaa avatar
Walaa
Support Team
Posts: 14954
Joined: 21-Aug-2005
# Posted on: 02-May-2013 19:13:07   

Thanks for sharing.

But just in case you have missed it, I think same info can be found in the SDK documentation