1

我正在寻找一种方法(宏/插件/扩展)来更改特定属性表(已加载到解决方案中的每个项目中)中的值,而无需重新加载解决方案。有没有办法从宏或插件代码访问它?

谢谢!

4

2 回答 2

0

编辑属性表并从宏 IDE 中查看其代码时录制宏。之后,您可以为其分配键绑定并随时播放。

于 2013-02-04T11:46:57.867 回答
0

这就是我开始工作的方式。您必须在项目中添加 VCEngine 引用。

VCProject project;
Projects projCollection = sol1.Projects;
project = (VCProject)projCollection.Item(1).Object;
VCConfiguration config = project.Configurations.Item("Test Release|Win32");
IVCRulePropertyStorage rule = config.Rules.Item("ConfigurationDirectories") as IVCRulePropertyStorage;

//Setting the Include directories
string rawValue = rule.GetUnevaluatedPropertyValue("IncludePath");
string evaluatedValue = rule.GetEvaluatedPropertyValue("IncludePath");
rule.SetPropertyValue("IncludePath", "Whatever you like to specify here");
//Setting the Executable Directory
rawValue = rule.GetUnevaluatedPropertyValue("ExecutablePath");
rule.SetPropertyValue("ExecutablePath", "Whatever you like to specify here");
于 2016-03-04T05:33:37.217 回答