次の方法で共有


SolutionConfiguration2.Name プロパティ

オブジェクトの名前を取得します。

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

構文

'宣言
ReadOnly Default Property Name As String
    Get
string this { get; }
property String^ default {
    String^ get ();
}
abstract Name : string
function get Name () : String

プロパティ値

型: System.String
オブジェクトの名前。

実装

SolutionConfiguration.Name

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

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

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)
    SolutionConfigurationNameExample(_applicationObject)
End Sub
Sub SolutionConfigurationNameExample(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 name of the solution configuration is: "  _
        & config.Name)
    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;
    SolutionConfigurationNameExample(_applicationObject);
}
public void SolutionConfigurationNameExample(DTE2 dte)
{
    try
    {
        SolutionBuild builder =
 _applicationObject.Solution.SolutionBuild;
        SolutionConfiguration2 config;
        config =
 (SolutionConfiguration2)builder.SolutionConfigurations.Item(1);
        MessageBox.Show("The name of the solution configuration is: " 
+ config.Name);
    }
    catch(SystemException ex)
    {
        MessageBox.Show(ex.ToString());
    }
}

.NET Framework セキュリティ

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

参照

参照

SolutionConfiguration2 インターフェイス

Name オーバーロード

EnvDTE80 名前空間