_dispVCProjectEngineEvents.ItemMoved 方法

此 API 支持 .NET Framework 基础结构,不适合在代码中直接使用。

指示指定项已在项目中移动。

命名空间:  Microsoft.VisualStudio.VCProjectEngine
程序集:  Microsoft.VisualStudio.VCProjectEngine(在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

语法

声明
Sub ItemMoved ( _
    Item As Object, _
    NewParent As Object, _
    OldParent As Object _
)
void ItemMoved(
    Object Item,
    Object NewParent,
    Object OldParent
)
void ItemMoved(
    [InAttribute] Object^ Item, 
    [InAttribute] Object^ NewParent, 
    [InAttribute] Object^ OldParent
)
abstract ItemMoved : 
        Item:Object * 
        NewParent:Object * 
        OldParent:Object -> unit 
function ItemMoved(
    Item : Object, 
    NewParent : Object, 
    OldParent : Object
)

参数

备注

ItemMoved 方法引发,该项目将 VCProjectVCFilterVCFile 对象。

示例

[Visual Basic]

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

Public Module Module1
    Sub ItemMoved(ByVal item As Object, ByVal newParent As Object, _
        ByVal oldParent As Object)
        Dim vcitem As VCProjectItem
        vcitem = item
        MsgBox(vcitem)
    End Sub

    Sub Main()
        Dim projEngine As VCProjectEngine
        Dim evt As VCProjectEngineEvents
        Dim prj As VCProject
        Dim col As IVCCollection
        Dim file As VCFile
        Dim folder As VCFilter
        projEngine = DTE.Solution.Projects.Item(1).Object.VCProjectEngine
        prj = DTE.Solution.Projects.Item(1).Object
        evt = projEngine.Events
        AddHandler evt.ItemMoved, AddressOf ItemMoved
        col = prj.Items
        folder = col.Item("Resource Files")
        file = col.Item("ReadMe.txt")
        file.Move(folder)
    End Sub
End Module

.NET Framework 安全性

请参见

参考

_dispVCProjectEngineEvents 接口

Microsoft.VisualStudio.VCProjectEngine 命名空间