Configuration.Type 属性

获取一个指示对象类型的常数。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
ReadOnly Property Type As vsConfigurationType
vsConfigurationType Type { get; }
property vsConfigurationType Type {
    vsConfigurationType get ();
}
abstract Type : vsConfigurationType with get
function get Type () : vsConfigurationType

属性值

类型:EnvDTE.vsConfigurationType
一个 vsConfigurationType 常数,它指定配置的类型。

备注

对于配置,Type 返回一个常数,该常数指示配置集合是一个特定配置名的一行配置,还是给定平台的一列配置。 如果该窗口属于一个环境工具,则 Type 标识该工具。 如果窗口针对的是提供软件包的工具或文档窗口,则 Type 为 vsWindowTypeToolWindowvsWindowTypeDocument,并且 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 安全性

请参阅

参考

Configuration 接口

EnvDTE 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例