Microsoft.VisualStudio.Project.FileNode.GetDragTargetHandlerNode C# (CSharp) Method

GetDragTargetHandlerNode() public method

Called by the drag&drop implementation to ask the node which is being dragged/droped over which nodes should process the operation. This allows for dragging to a node that cannot contain items to let its parent accept the drop, while a reference node delegate to the project and a folder/project node to itself.
public GetDragTargetHandlerNode ( ) : HierarchyNode
return HierarchyNode
        public override HierarchyNode GetDragTargetHandlerNode()
        {
            Debug.Assert(this.ProjectManager != null, " The project manager is null for the filenode");
            HierarchyNode handlerNode = this;
            while(handlerNode != null && !(handlerNode is ProjectNode || handlerNode is FolderNode))
                handlerNode = handlerNode.Parent;
            if(handlerNode == null)
                handlerNode = this.ProjectManager;
            return handlerNode;
        }