次の方法で共有


Configuration.Type プロパティ

オブジェクト型を示す定数を取得します。

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)

構文

'宣言
ReadOnly Property Type As vsConfigurationType
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 セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

Configuration インターフェイス

EnvDTE 名前空間

その他の技術情報

方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する