Jobs

A job is a defined task (file copy, file create...), inhertis from QuickIOTransferJob and has no dependencies.
However, he can pass his information (ex. progress) to an optional observer.

// For example the observer information behavior of file creation progress
private void OnCopyProgress( Int64 totalBytes, UInt64 bytesTransfered )
{
    QuickIOTransferFileCopyProgressEventArgs args = null;
    if ( Progress != null )
    {
        args = new QuickIOTransferFileCopyProgressEventArgs( this, Source, Target, totalBytes,
                      bytesTransfered, ( DateTime ) TransferStarted );
        Progress( this, args );
    }
    if ( Observer != null )
    {
        if ( args == null )
        {
            args = new QuickIOTransferFileCopyProgressEventArgs( this, Source, Target, totalBytes, 
                           bytesTransfered, ( DateTime ) TransferStarted );
        }
        Observer.OnFileCopyProgress( args );
    }
}
       

QuickIOTransferJob requires the custom implementation of Implementation-Method, in which the logic of the task must be implemented. The action is performed using the method Run; starting with the .NET 4.0 the method RunAsync is available, too.

// For example the job implementation of CreateDirectory       
protected override void Implementation( )
{
    OnDirectoryCreating( );
    if ( !QuickIODirectory.Exists( DirectoryToCreatePath ) )
    {
        QuickIODirectory.Create( DirectoryToCreatePath, true );
    }
    OnDirectoryCreated( );
}
       

Run passes the status of "Start", "End" and "Error" to the respective event interfaces, which can be overridden in your own job classes.

// Implementation of Run()
public void Run( )
{
    var started = DateTime.Now;
    OnRun( started );
    try
    {
        Implementation( );
    }
    catch ( Exception e )
    {
        OnError( e );
        throw;
    }
    OnEnd( started, DateTime.Now );
}
        

For more information please see the appropriate documentation or - if necessary - the source code.

I've spent really much time in the detailed documentation of QuickIO.NET and will continue.
Please read the documentation before you opened a new topic in the dicusccion area.

Thank you very much.