IFilesDeleteListener interface which needs to be implemented if a user wants to introduce a custom action when a delete operation is executed.
The interface exposes two methods. The first one is invoked before the delete request is sent to the server, the second one is called
after the request was successfully executed.
public interface IFilesDeleteListener
/// Invoked before the delete request is sent to the server.
/// <param name="file">The file to delete</param>
bool BeforeDelete(FileHeader file);
/// Invoked after the delete operation was effective on the server.
/// <param name="filename">The filename of the deleted file</param>
void AfterDelete(string filename);
BeforeDelete method returns a boolean result that is used to determine whether a file should be really deleted. If any of the registered
false then the delete request won't be sent to a server and no
AfterDelete method will be called.
To prevent anyone from deleting files that have
Read-Only : true metadata you can create the following listener:
public class PreventDeletingReadOnlyFilesListener : IFilesDeleteListener
public bool BeforeDelete(FileHeader file)
return file.Metadata.Value<bool>("Read-Only") == false;
public void AfterDelete(string filename)