SecureBlackbox 2020 .NET Edition

Questions / Feedback?

BeforeCompressFile Event

Marks the start of compression of a file.

Syntax

public event OnBeforeCompressFileHandler OnBeforeCompressFile;

public delegate void OnBeforeCompressFileHandler(object sender, ArchivewriterBeforeCompressFileEventArgs e);

public class ArchivewriterBeforeCompressFileEventArgs : EventArgs {
  public string Path { get; }
  public long FileSize { get; }
  public int DataSource { get; }
}
Public Event OnBeforeCompressFile As OnBeforeCompressFileHandler

Public Delegate Sub OnBeforeCompressFileHandler(sender As Object, e As ArchivewriterBeforeCompressFileEventArgs)

Public Class ArchivewriterBeforeCompressFileEventArgs Inherits EventArgs
  Public ReadOnly Property Path As String
  Public ReadOnly Property FileSize As Long
  Public ReadOnly Property DataSource As Integer
End Class

Remarks

Subscribe to this event to be notified about the start of compression of an archive entry. The handler of this event is a good place to prepare the desired data source.

The Path parameter indicates the path to the extracted entry in the archive. The FileSize specifies the size of the file before compression. Use this event handler to adjust the data source if the file is to be loaded from a stream or buffer. The DataSource parameter indicates the type of the data media:

fdsFile (0)The data will be taken from a file indicated by the entry's LocalPath setting. You can change this path in the handler of this event.
fdsStream (1)The file data will be taken from a stream assigned to FileStream property.
fdsBuffer (2)The data will be taken from a buffer attached to the FileData property.

If passing the data from a stream or buffer, use AfterCompressFile to dispose of any objects allocated in this event handler (such as the source stream).

Use PrepareFile event to adjust the file data source on the fly.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 .NET Edition - Version 20.0 [Build 8165]