Compartir a través de


ConfigurationManager.AddConfigurationRow Method

Creates a new project or project item configuration row based on the Configuration object of an existing project or project item configuration row.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Function AddConfigurationRow ( _
    NewName As String, _
    ExistingName As String, _
    Propagate As Boolean _
) As Configurations
Configurations AddConfigurationRow(
    string NewName,
    string ExistingName,
    bool Propagate
)
Configurations^ AddConfigurationRow(
    String^ NewName, 
    String^ ExistingName, 
    [InAttribute] bool Propagate
)
abstract AddConfigurationRow : 
        NewName:string * 
        ExistingName:string * 
        Propagate:bool -> Configurations
function AddConfigurationRow(
    NewName : String, 
    ExistingName : String, 
    Propagate : boolean
) : Configurations

Parameters

  • NewName
    Type: System.String

    Required. A unique name for the new project or project item configuration row.

  • ExistingName
    Type: System.String

    Required. The name of the project or project item configuration row to copy in order to create the new one.

  • Propagate
    Type: System.Boolean

    Required. true if the project or project item configuration row should be propagated, false if not.

Return Value

Type: EnvDTE.Configurations
A Configurations collection.

Remarks

AddConfigurationRow returns the collection of new Configuration objects. If NewName already exists for this project, then this method fails so that you know that the ExistingName settings were not copied.

Examples

Sub AddConfigurationRowExample()
    ' Make a copy of the "Debug" configurations to temporarily change 
    ' them without affecting the original "Debug" configurations.
    Dim cfgmgr As ConfigurationManager = _
        DTE.ActiveSolutionProject.ConfigurationManager
    Dim cfgs = Cfgmgr.AddConfigurationRow("MyDebug", "Debug")
    For Each (cfg in cfgs)
        Cfg.Properties.Item("SomeProperty") = True
    Next
End Sub

.NET Framework Security

See Also

Reference

ConfigurationManager Interface

EnvDTE Namespace