ReadWriteFileSystemProvider.Delete Method
Namespace: Rebex.IO.FileSystem
Assembly: Rebex.FileSystem.dll (version 7.0.9083)
Delete(NodeBase)
Override this method to implement DirectoryNode and FileNode deletion.
When the virtual file system is used in the FileServer component, the server session, which contains information about the user and the active connection, can be accessed using Current property.
Declaration
protected abstract NodeBase Delete(NodeBase node)
Parameters
Type | Name | Description |
---|---|---|
NodeBase | node | A DirectoryNode or FileNode to be deleted. |
Returns
Type | Description |
---|---|
NodeBase | Up-to-date instance of FileNode or DirectoryNode which represents the deleted |
Examples
protected override NodeBase Delete(NodeBase node)
{
var toDeletePath = getFullPath(node.Path);
if (node.IsDirectory)
{
Directory.Delete(toDeletePath);
}
else
{
File.Delete(toDeletePath);
}
return node;
}