Class ExtractFileCallbackArgs
The arguments passed to ExtractFileCallback.
Inherited Members
Namespace: SharpSevenZip.EventArguments
Assembly: SharpSevenZip.dll
Syntax
public class ExtractFileCallbackArgs : EventArgs
Remarks
For each file, ExtractFileCallback is first called with Reason set to Start. If the callback chooses to extract the file data by setting ExtractToFile or ExtractToStream, the callback will be called a second time with Reason set to Done or Failure to allow for any cleanup task like closing the stream.
Constructors
| Edit this page View SourceExtractFileCallbackArgs(ArchiveFileInfo)
Initializes a new instance of the ExtractFileCallbackArgs class.
Declaration
public ExtractFileCallbackArgs(ArchiveFileInfo archiveFileInfo)
Parameters
Type | Name | Description |
---|---|---|
ArchiveFileInfo | archiveFileInfo | The information about file in the archive. |
Properties
| Edit this page View SourceArchiveFileInfo
Information about file in the archive.
Declaration
public ArchiveFileInfo ArchiveFileInfo { get; }
Property Value
Type | Description |
---|---|
ArchiveFileInfo | Information about file in the archive. |
CancelExtraction
Gets or sets a value indicating whether to cancel the extraction.
Declaration
public bool CancelExtraction { get; set; }
Property Value
Type | Description |
---|---|
bool |
|
Exception
The exception that occurred during extraction.
Declaration
public Exception? Exception { get; set; }
Property Value
Type | Description |
---|---|
Exception | The _Exception. |
Remarks
If the callback is called with Reason set to Failure,
this member contains the _Exception that occurred.
The default behavior is to rethrow the _Exception after return of the callback.
However the callback can set Exception to null
to swallow the _Exception
and continue extraction with the next file.
ExtractToFile
Gets or sets whether and where to extract the file.
Declaration
public string? ExtractToFile { get; set; }
Property Value
Type | Description |
---|---|
string | The path where to extract the file to. |
Remarks
If ExtractToStream is set, this mmember will be ignored.
ExtractToStream
Gets or sets whether and where to extract the file.
Declaration
public Stream? ExtractToStream { get; set; }
Property Value
Type | Description |
---|---|
Stream | The the extracted data is written to. |
Remarks
If both this member and ExtractToFile are null
(the defualt), the file
will not be extracted and the callback will be be executed a second time with the Reason
set to Done or Failure.
ObjectData
Gets or sets any data that will be preserved between the Start callback call and the Done or Failure calls.
Declaration
public object? ObjectData { get; set; }
Property Value
Type | Description |
---|---|
object | The data. |
Reason
The reason for calling ExtractFileCallback.
Declaration
public ExtractFileCallbackReason Reason { get; }
Property Value
Type | Description |
---|---|
ExtractFileCallbackReason | The reason. |
Remarks
If neither ExtractToFile nor ExtractToStream is set, ExtractFileCallback will not be called after Start.