Configuration.Type 属性
获取一个指示对象类型的常数。
命名空间: EnvDTE
程序集: EnvDTE(在 EnvDTE.dll 中)
语法
声明
ReadOnly Property Type As vsConfigurationType
Get
vsConfigurationType Type { get; }
property vsConfigurationType Type {
vsConfigurationType get ();
}
abstract Type : vsConfigurationType
function get Type () : vsConfigurationType
属性值
类型:EnvDTE.vsConfigurationType
一个 vsConfigurationType 常数,它指定配置的类型。
备注
对于配置,Type 返回一个常数,该常数指示配置集合是一个特定配置名的一行配置,还是给定平台的一列配置。 如果该窗口属于一个环境工具,则 Type 标识该工具。 如果窗口针对的是提供软件包的工具或文档窗口,则 Type 为 vsWindowTypeToolWindow 或 vsWindowTypeDocument,并且 ObjectKind 属性指示软件包特定的类型信息。
示例
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;
ConfigurationManager configmgr;
if (dte.Solution.Projects.Count > 0)
{
prj = dte.Solution.Projects.Item(1);
config = prj.ConfigurationManager.ActiveConfiguration;
// Returning the Configuration type constant.
MessageBox.Show(config.Type.ToString());
// Returns the ConfigurationManager containing the active configuration.
configmgr = config.Collection;
// Returns the application containing this active configuration.
MessageBox.Show(config.DTE.Name);
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。