Partilhar via


Método _dispVCProjectEngineEvents.ItemRenamed

Esta API oferece suporte à infraestrutura .NET Framework e não se destina a ser usada diretamente do seu código.

Isso significa que o item especificado no projeto foi renomeado.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (em Microsoft.VisualStudio.VCProjectEngine.dll)

Sintaxe

'Declaração
Sub ItemRenamed ( _
    Item As Object, _
    ItemParent As Object, _
    OldName As String _
)
void ItemRenamed(
    Object Item,
    Object ItemParent,
    string OldName
)
void ItemRenamed(
    [InAttribute] Object^ Item, 
    [InAttribute] Object^ ItemParent, 
    [InAttribute] String^ OldName
)
abstract ItemRenamed : 
        Item:Object * 
        ItemParent:Object * 
        OldName:string -> unit 
function ItemRenamed(
    Item : Object, 
    ItemParent : Object, 
    OldName : String
)

Parâmetros

Comentários

O método de ItemRenamed acionado quando um item é renomeado em VCProject, em VCFilter, ou o objeto de VCFile .

Exemplos

[Visual Basic]

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub ItemRenamed(ByVal item As Object, ByVal ItemParent As Object, ByVal OldName As String)
        Dim vcitem As VCProjectItem
        vcitem = item
        MsgBox(vcitem.ItemName)
    End Sub

    Sub Main()
        Dim projEngine As VCProjectEngine
        Dim evt As VCProjectEngineEvents
        Dim prj As VCProject
        Dim col As IVCCollection
        Dim folder As VCFilter
        prj = DTE.Solution.Projects.Item(1).Object
        projEngine = prj.VCProjectEngine
        col = prj.Filters
        evt = projEngine.Events
        AddHandler evt.ItemRenamed, AddressOf ItemRenamed
        folder = col.Item("MyFolder")
        folder.Name = "MyNewFolderName"
    End Sub
End Module

Segurança do .NET Framework

Consulte também

Referência

_dispVCProjectEngineEvents Interface

Namespace Microsoft.VisualStudio.VCProjectEngine