次の方法で共有


SolutionConfiguration2.Collection Property

Definition

Gets the SolutionConfigurations collection containing the SolutionConfiguration object supporting this property.

public:
 property EnvDTE::SolutionConfigurations ^ Collection { EnvDTE::SolutionConfigurations ^ get(); };
[System.Runtime.InteropServices.DispId(2)]
public EnvDTE.SolutionConfigurations Collection { [System.Runtime.InteropServices.DispId(2)] get; }
[<System.Runtime.InteropServices.DispId(2)>]
[<get: System.Runtime.InteropServices.DispId(2)>]
member this.Collection : EnvDTE.SolutionConfigurations
Public ReadOnly Property Collection As SolutionConfigurations

Property Value

A SolutionConfigurations collections.

Implements

Attributes

Examples

This example displays the solution configuration's collection name for the first item. Open a project in the Visual Studio integrated development environment (IDE) before running this example.

Imports EnvDTE  
Sub SolutionConfigurationCollectionExample(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 first solution configuration item's name in  _  
        the collection is: " & config.Collection.Item(1).Name)  
    Catch ex As System.Exception  
        MsgBox(ex.ToString)  
    End Try  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void SolutionConfigurationCollectionExample(DTE2 dte)  
{  
    try  
    {  
        SolutionBuild builder =   
_applicationObject.Solution.SolutionBuild;  
        SolutionConfiguration2 config;  
        config =  
 (SolutionConfiguration2)builder.SolutionConfigurations.Item(1);  
        MessageBox.Show("The first solution configuration item's   
name in the collection is: " + config.Collection.Item(1).Name);  
    }  
    catch(SystemException ex)  
    {  
        MessageBox.Show(ex.ToString());  
    }  
}  

Applies to