C# Class Nexus.Client.Util.ThreadSafeSevenZipExtractor

A wrapper for the SevenZipExtractor class that makes using it thread safe.
Inheritance: IDisposable
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void

Ensures all used resources are released.

This terminates the thread upon which the SevenZipExtractor was created.

ExtractFile ( Int32 p_intIndex, Stream p_stmFile ) : void

Extracts the specified file to the given stream.

This wrapper property ensures the operation executes on the same thread in which the SevenZipExtractor was created.

ThreadSafeSevenZipExtractor ( Stream p_stmArchive ) : System

Creates a thread safe extractor for the given stream.

ThreadSafeSevenZipExtractor ( string p_strPath ) : System

Creates a thread safe extractor for the file at the given path.

Méthodes protégées

Méthode Description
ExecuteAction ( System.Action p_actAction ) : void

Executes the given action.

This method: 1) Enqueues the action in the work queue. 2) Notifies the extraction thread that there is work to do. 3) Waits to be notified that the action has completed. 4) Throws any exception that was raised while executing the action.

Init ( ) : void

Initializes the thread safe extractor.

RunThread ( ) : void

The run method of the thread on which the SevenZipExtractor is created.

This method creates a SevenZipExtractor and then watches for events to execute. Other methods signal the thread that an action needs to be taken, and this thread executes said actions.

Method Details

Dispose() public méthode

Ensures all used resources are released.
This terminates the thread upon which the SevenZipExtractor was created.
public Dispose ( ) : void
Résultat void

ExecuteAction() protected méthode

Executes the given action.
This method: 1) Enqueues the action in the work queue. 2) Notifies the extraction thread that there is work to do. 3) Waits to be notified that the action has completed. 4) Throws any exception that was raised while executing the action.
protected ExecuteAction ( System.Action p_actAction ) : void
p_actAction System.Action The action to get the extractor to execute.
Résultat void

ExtractFile() public méthode

Extracts the specified file to the given stream.
This wrapper property ensures the operation executes on the same thread in which the SevenZipExtractor was created.
public ExtractFile ( Int32 p_intIndex, Stream p_stmFile ) : void
p_intIndex System.Int32 The index of the file to extract from the archive.
p_stmFile Stream The stream to which to extract the file.
Résultat void

Init() protected méthode

Initializes the thread safe extractor.
protected Init ( ) : void
Résultat void

RunThread() protected méthode

The run method of the thread on which the SevenZipExtractor is created.
This method creates a SevenZipExtractor and then watches for events to execute. Other methods signal the thread that an action needs to be taken, and this thread executes said actions.
protected RunThread ( ) : void
Résultat void

ThreadSafeSevenZipExtractor() public méthode

Creates a thread safe extractor for the given stream.
public ThreadSafeSevenZipExtractor ( Stream p_stmArchive ) : System
p_stmArchive Stream The stream for which to create an extractor.
Résultat System

ThreadSafeSevenZipExtractor() public méthode

Creates a thread safe extractor for the file at the given path.
public ThreadSafeSevenZipExtractor ( string p_strPath ) : System
p_strPath string The path to the file for which to create an extractor.
Résultat System