GAudio.GATAudioLoader.bw_Completed C# (CSharp) Method

bw_Completed() static private method

static private bw_Completed ( object sender, RunWorkerCompletedEventArgs e ) : void
sender object
e System.ComponentModel.RunWorkerCompletedEventArgs
return void
        void bw_Completed( object sender, RunWorkerCompletedEventArgs e )
        {
            if( e.Error != null )
            {
                _currentOperation.SetStatus( LoadOperationStatus.Failed );
            }
            else if( e.Cancelled )
            {
                _currentOperation.SetStatus( LoadOperationStatus.Cancelled );
                _pendingOperations.Clear();
            }

            if( _currentOperation.OnOperationCompleted != null )
                _currentOperation.OnOperationCompleted( _currentOperation );

            if( _pendingOperations.Count > 0 )
            {
                _currentOperation = _pendingOperations.Dequeue();
                _currentOperation.OperationWillStart();
                _bw.RunWorkerAsync( _currentOperation );
            }
            else
            {
                _bw = null;
                _currentOperation = null;
            }
        }