Configuration.Properties 属性
获取属于 Configuration 对象的所有属性的集合。
命名空间: EnvDTE
程序集: EnvDTE(在 EnvDTE.dll 中)
语法
声明
ReadOnly Property Properties As Properties
Get
Properties Properties { get; }
property Properties^ Properties {
Properties^ get ();
}
abstract Properties : Properties
function get Properties () : Properties
属性值
类型:EnvDTE.Properties
一个 Properties 集合。
备注
一些属性公开为 Solution 对象上的自动化属性,或者公开为通过解决方案获取的对象(如生成依赖项的 SolutionBuild 对象)的自动化属性。
示例
public void CodeExample(DTE2 dte, AddIn addin)
{ // Make sure you have a solution loaded into Visual Studio
// before running the following example.
try
{
Project prj;
Configuration config;
OutputGroups outPGs;
Properties props;
if (dte.Solution.Projects.Count > 0)
{
prj = dte.Solution.Projects.Item(1);
config = prj.ConfigurationManager.ActiveConfiguration;
// Return a collection of OutputGroup objects that contain
// the names of files that are outputs for the project.
outPGs = config.OutputGroups;
MessageBox.Show(outPGs.Count.ToString());
// Returns the project for the config.
MessageBox.Show(((Project)config.Owner).Name);
// Returning the platform name for the Configuration.
MessageBox.Show(config.PlatformName);
// Returning all properties for Configuration object.
props = config.Properties;
string p = "";
foreach (Property prop in props)
{
p = p + prop.Name + "\n";
}
MessageBox.Show(p);
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。