我正在寻找一种方法(宏/插件/扩展)来更改特定属性表中的值(它被加载到解决方案中的每个项目中),而无需重新加载解决方案。 有没有办法从宏或插件代码访问它?
谢谢!
答案 0 :(得分:0)
编辑属性表时记录宏,并从宏IDE中查看代码。之后,您可以为其分配键绑定并随时播放。
答案 1 :(得分: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");