C# Класс Nexus.Client.Util.ThreadSafeSevenZipExtractor

A wrapper for the SevenZipExtractor class that makes using it thread safe.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Описание методов

Dispose() публичный Метод

Ensures all used resources are released.
This terminates the thread upon which the SevenZipExtractor was created.
public Dispose ( ) : void
Результат void

ExecuteAction() защищенный Метод

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.
Результат void

ExtractFile() публичный Метод

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.
Результат void

Init() защищенный Метод

Initializes the thread safe extractor.
protected Init ( ) : void
Результат void

RunThread() защищенный Метод

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
Результат void

ThreadSafeSevenZipExtractor() публичный Метод

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.
Результат System

ThreadSafeSevenZipExtractor() публичный Метод

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.
Результат System