Raised every time a FileSystemItem object has been processed, providing progression information to the event handler and the ability to perform custom post-processing on the target item.
The event handler receives an argument of type ItemProgressionEventArgs containing data related to this event. The following ItemProgressionEventArgs properties provide information specific to this event.
staticvoid ItemCompletionExample()
{
/* Create a reference to a FileSystemEvents object */
FileSystemEvents events = new FileSystemEvents();
/* Subscribe to the ItemCompletion event of the FileSystemEvents object using the ItemProgressionEventHandler delegate */
events.ItemCompletion += new ItemProgressionEventHandler( OnItemCompletion );
// Get a reference to an existing zip file
AbstractFile zipFile = new DiskFile( "ItemCompletionExample.zip" );
System.Diagnostics.Debug.Assert( zipFile.Exists );
Xceed.Zip.ZipArchive zip = new Xceed.Zip.ZipArchive( zipFile );
// Select an output folder
AbstractFolder destination = new DiskFolder( "Output" );
// Extract the files from the archive using the events object
zip.CopyFilesTo( events, null, destination, true, true );
}
/* Create a new method that will handle the events that are raised. For the purposes of this example, we will call the method OnItemProgression */staticvoid OnItemCompletion( object sender, ItemProgressionEventArgs e )
{
/* Place the desired code in the newly created event handler */
FileSystemItem targetItem = e.TargetItem;
// Remove the read-only attribute from the target file
FileAttributes attributes = targetItem.Attributes;
targetItem.Attributes = ( attributes & ~FileAttributes.ReadOnly );
}
PrivateSharedSub ItemCompletionExample()
' Create a reference to a FileSystemEvents object
Dim events AsNew FileSystemEvents()
' Subscribe to the ItemCompletion event of the FileSystemEvents object using the ItemProgressionEventHandler delegate
AddHandler events.ItemCompletion, AddressOf OnItemCompletion
' Get a reference to an existing zip file
Dim zipFile As AbstractFile = New DiskFile("ItemCompletionExample.zip")
System.Diagnostics.Debug.Assert(zipFile.Exists)
Dim zip AsNew Xceed.Zip.ZipArchive(zipFile)
' Select an output folder
Dim destination As AbstractFolder = New DiskFolder("Output")
' Extract the files from the archive using the events object
zip.CopyFilesTo(events, Nothing, destination, True, True)
End Sub' Create a new method that will handle the events that are raised. For the purposes of this example, we will call the method OnItemProgression
PrivateSharedSub OnItemCompletion(ByVal sender AsObject, ByVal e As ItemProgressionEventArgs)
' Place the desired code in the newly created event handler
Dim targetItem As FileSystemItem = e.TargetItem
' Remove the read-only attribute from the target file
Dim attributes As FileAttributes = targetItem.Attributes
targetItem.Attributes = (attributes And (Not FileAttributes.ReadOnly))
End Sub
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