|
using System;
using System.ComponentModel;
using SimplePack.Exceptions;
namespace SimplePack.Events
{
///<summary>
/// Delegate which wrap <see cref="ExtractFileCompletedEventArgs"/> event argument.
///</summary>
///<param name="sender"></param>
///<param name="extractFileCompletedEventArgs"></param>
public delegate void ExtractFileCompletedEventHandler(
Archive sender, ExtractFileCompletedEventArgs extractFileCompletedEventArgs);
///<summary>
/// Asynchronous Event Argument which is invoked when extracting file from Archive is done.
///</summary>
public class ExtractFileCompletedEventArgs : AsyncCompletedEventArgs
{
private readonly string newFilePath;
private readonly string fileArchivePath;
///<summary>
/// Constructor.
///<list type="table">
/// <listheader>
/// <term>Exceptions in Error</term>
/// <description>Conditions</description>
/// </listheader>
///<item>
/// <term><see cref="UnauthorizedAccessException"/></term>
/// <description>you don't have privileges to write to specified directory</description>
///</item>
///<item>
/// <term><see cref="ArchivePathException"/></term>
/// <description><paramref name="fileArchivePath"/> is not correct</description>
///</item>
///<item>
/// <term><see cref="ArchiveFileNotFoundException"/></term>
/// <description>archive path is syntactically correct but File not exist in archive</description>
///</item>
///<item>
/// <term><see cref="ArchiveConsistencyException"/></term>
/// <description>extracted file have different size than expected</description>
///</item>
///<item>
/// <term><see cref="ArchiveNotOpenedException"/></term>
/// <description>Archive must be opened first</description>
///</item>
///</list>
///</summary>
///<param name="newFilePath">File Path where File will be extracted</param>
///<param name="fileArchivePath">File Path in Archive specified which File will be extracted</param>
///<param name="error">Exception occurred during performing asynchronous operation</param>
///<param name="canceled"><see langword="true"/> if operation was canceled (unused)</param>
///<param name="userState">unused</param>
public ExtractFileCompletedEventArgs(string newFilePath, string fileArchivePath, Exception error, bool canceled, object userState)
: base(error, canceled, userState)
{
this.newFilePath = newFilePath;
this.fileArchivePath = fileArchivePath;
}
///<summary>
/// File Path where File will be extracted.
///</summary>
public string NewFilePath
{
get { return newFilePath; }
}
///<summary>
/// File Path in Archive specified which File will be extracted.
///</summary>
public string FileArchivePath
{
get { return fileArchivePath; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.