次の方法で共有


SolutionConfiguration2.PlatformName プロパティ

更新 : 2007 年 11 月

構成の対象となるプラットフォームの CPU を取得します。

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

構文

'宣言
ReadOnly Property PlatformName As String
'使用
Dim instance As SolutionConfiguration2
Dim value As String

value = instance.PlatformName
string PlatformName { get; }
property String^ PlatformName {
    String^ get ();
}
function get PlatformName () : String

プロパティ値

型 : System.String

CPU プラットフォームの名前。

この例では、アクティブ ソリューション構成項目の CPU プラットフォームの名前を最初の項目について表示します。このアドインを実行する前に、Visual Studio 統合開発環境 (IDE) でプロジェクトを開きます。

このアドインの例を実行する方法の詳細については、「方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する」を参照してください。

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    SolutionConfigurationPlatformNameExample(_applicationObject)
End Sub
Sub SolutionConfigurationPlatformNameExample(ByVal dte As DTE2)
    Try
        Dim builder As SolutionBuild = _
        _applicationObject.Solution.SolutionBuild
        Dim config As SolutionConfiguration2
        config = CType(builder.SolutionConfigurations.Item(1) _
        , SolutionConfiguration2)
        MsgBox("The platform name of the solution configuration is: " _
        & config.PlatformName)
    Catch ex As System.Exception
        MsgBox(ex.ToString)
    End Try
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application, 
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    SolutionConfigurationPlatformNameExample(_applicationObject);
}
public void SolutionConfigurationPlatformNameExample(DTE2 dte)
{
    try
    {
        SolutionBuild builder =
 _applicationObject.Solution.SolutionBuild;
        SolutionConfiguration2 config;
        config = 
(SolutionConfiguration2)builder.SolutionConfigurations.Item(1);
        MessageBox.Show("The platform name of the 
solution configuration is: " + config.PlatformName);
    }
    catch(SystemException ex)
    {
        MessageBox.Show(ex.ToString());
    }
}

アクセス許可

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

参照

参照

SolutionConfiguration2 インターフェイス

SolutionConfiguration2 メンバ

EnvDTE80 名前空間