FileSystemNotifier.GetContentCompleted Event
Namespace: Rebex.IO.FileSystem.Notifications
Assembly: Rebex.FileSystem.dll (version 7.0.9083)
Occurs before the FileSystemProvider returns NodeContent of the NodeBase.
When the virtual file system is used in the FileServer component, then the server session, which contains information about the user and the active connection, can be accessed using Current property in the handler of this event.
Syntax
public event EventHandler<GetContentEventArgs> GetContentCompleted
Returns
Type | Description |
---|---|
EventHandler<GetContentEventArgs> |
Remarks
When the event handler provides a new value in the ResultContent property, then the same handler is responsible for cleaning-up old resources and should call Dispose() method on the instance of the NodeContent returned from the ResultContent property. Typical handler that replaces NodeContent has the following structure:
myFileSystemProvider.FileSystemNotifier.GetContentCompleted += (sender, args) =>
{
//Dispose original content
args.ResultContent.Dispose();
// Prepare new content
//Replace content
args.ResultContent = NodeContent.CreateImmediateWriteContent(new MemoryStream());
};