Udostępnij za pośrednictwem


VCFilter.CanMove Method

Returns true if the filter can be moved to the specified location.

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

Syntax

'Declaration
Function CanMove ( _
    Parent As Object _
) As Boolean
bool CanMove(
    Object Parent
)
bool CanMove(
    [InAttribute] Object^ Parent
)
abstract CanMove : 
        Parent:Object -> bool 
function CanMove(
    Parent : Object
) : boolean

Parameters

  • Parent
    Type: System.Object
    Required. The folder or project into which you want to move the filter.

Return Value

Type: System.Boolean
true if the filter can be moved to the specified location; otherwise, false.

Remarks

See How to: Compile Example Code for Project Model Extensibility for information about how to compile and run this example.

Examples

The following example uses CanMove in the integrated development environment (IDE):

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

Public Module Module1
    Sub Test()
        Dim mycollection As IVCCollection
        Dim filter, filter2 As VCFilter
        Dim prj As VCProject
        Dim ret As Boolean
        prj = DTE.Solution.Projects.Item(1).Object
        mycollection = prj.Filters
        'mycollection.Count has count of files
        filter = mycollection.Item(1)
        filter2 = mycollection.Item(2)
        ret = filter.CanMove(filter2)
        MsgBox(ret)
    End Sub
End Module

.NET Framework Security

See Also

Reference

VCFilter Interface

Microsoft.VisualStudio.VCProjectEngine Namespace