Click here to Skip to main content
15,891,316 members
Articles / General Programming / Threads

SimplePack Library

Rate me:
Please Sign up or sign in to vote.
4.93/5 (30 votes)
23 Nov 2010CPOL7 min read 72.9K   1.9K   97  
Simple way how to pack data into one file
using System;
using System.ComponentModel;
using SimplePack.Exceptions;

namespace SimplePack.Events
{
    ///<summary>
    /// Delegate which wrap <see cref="RemoveDirectoryCompletedEventArgs"/> event argument.
    ///</summary>
    ///<param name="sender"></param>
    ///<param name="removeDirectoryCompletedEventArgs"></param>
    public delegate void RemoveDirectoryCompletedEventHandler(
        Archive sender, RemoveDirectoryCompletedEventArgs removeDirectoryCompletedEventArgs);

    ///<summary>
    /// Asynchronous Event Argument which is invoked when removing directory from Archive is done.
    ///</summary>
    public class RemoveDirectoryCompletedEventArgs : AsyncCompletedEventArgs
    {
        private readonly string directoryArchivePath;

        ///<summary>
        /// Constructor.
        ///<list type="table">
        /// <listheader>
        /// <term>Exceptions in Error</term>
        /// <description>Conditions</description>
        /// </listheader>
        ///<item>
        /// <term><see cref="ArchivePathException"/></term>
        /// <description><paramref name="directoryArchivePath"/> 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>removed 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="directoryArchivePath">Path to directory which will be removed from archive</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 RemoveDirectoryCompletedEventArgs(string directoryArchivePath, Exception error, bool canceled, object userState) : base(error, canceled, userState)
        {
            this.directoryArchivePath = directoryArchivePath;
        }

        ///<summary>
        /// Path to directory which will be removed from archive.
        ///</summary>
        public string DirectoryArchivePath
        {
            get { return directoryArchivePath; }
        }
    }
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Slovakia Slovakia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions