Xceed .NET Libraries Documentation
CopyTo(FileSystemEvents,Object,AbstractFolder,Boolean) Method


Xceed.FileSystem Assembly > Xceed.FileSystem Namespace > FileSystemItem Class > CopyTo Method : CopyTo(FileSystemEvents,Object,AbstractFolder,Boolean) Method
A FileSystemEvents object that will be used to raise events. Cannot be a null reference (Nothing in Visual Basic).
Opaque data that will be passed back to the event handler when an event is raised.
An AbstractFolder object into which the item will be copied. Cannot be a null reference (Nothing in Visual Basic).
true if existing items in the destination should be replaced; false otherwise.
Copies the item to another folder, and raises events during the process.
Syntax
'Declaration
 
Public Overloads Function CopyTo( _
   ByVal events As FileSystemEvents, _
   ByVal userData As Object, _
   ByVal destinationFolder As AbstractFolder, _
   ByVal replaceExistingFiles As Boolean _
) As FileSystemItem
'Usage
 
Dim instance As FileSystemItem
Dim events As FileSystemEvents
Dim userData As Object
Dim destinationFolder As AbstractFolder
Dim replaceExistingFiles As Boolean
Dim value As FileSystemItem
 
value = instance.CopyTo(events, userData, destinationFolder, replaceExistingFiles)

Parameters

events
A FileSystemEvents object that will be used to raise events. Cannot be a null reference (Nothing in Visual Basic).
userData
Opaque data that will be passed back to the event handler when an event is raised.
destinationFolder
An AbstractFolder object into which the item will be copied. Cannot be a null reference (Nothing in Visual Basic).
replaceExistingFiles
true if existing items in the destination should be replaced; false otherwise.

Return Value

A FileSystemItem object that represents the newly copied item.
Remarks

If the physical folder specified by destinationFolder does not exist, it is created.

If this FileSystemItem object represents a file, the physical file is immediately copied to the destination folder.

If it represents a folder, the folder and all it's content (files and subfolders) is immediately copied to the destination.

When replaceExistingFiles is true, any item in the destination that has the same name as an item being copied is automatically replaced.

When replaceExistingFiles is false, an exception is thrown whenever the destination contains an item with the same name as an item being copied.

ApplyPropertiesTo(FileSystemItem) is called on the destination item; therefore, the attributes and dates of the original item are applied to the destination item.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

FileSystemItem Class
FileSystemItem Members
Overload List