示例#1
0
        /// <summary>
        /// Helper that performs our asynchronous deleting.
        /// </summary>
        private void DoDeleteAsync(Object asyncState)
        {
            FileOperationState state = asyncState as FileOperationState;
            Exception          error = null;

            // perform the delete operation
            try
            {
                Delete(state.Container, state.File, state.Location);
            }
            catch (Exception e)
            {
                error = e;
            }

            // construct our event arguments
            FileActionCompletedEventArgs args = new FileActionCompletedEventArgs(error, state.UserState);

            // fire our completion event
            DeleteCompleted(this, args);

            // recycle our state Object
            ReturnFileOperationState(state);

            // decrement our pending operation count
            PendingOperationsDecrement();
        }
示例#2
0
        /// <summary>
        /// Helper that performs our asynchronous deleting.
        /// </summary>
        private void DoDeleteAsync(object asyncState)
        {
            // set our processor affinity
            SetProcessorAffinity();

            FileOperationState state = asyncState as FileOperationState;
            Exception          error = null;

            // perform the delete operation
            try
            {
                Delete(state.Container, state.File);
            }
            catch (Exception e)
            {
                error = e;
            }

            // construct our event arguments
            FileActionCompletedEventArgs args = new FileActionCompletedEventArgs(error, state.UserState);

            // fire our completion event
            if (DeleteCompleted != null)
            {
                DeleteCompleted(this, args);
            }

            // recycle our state object
            ReturnFileOperationState(state);

            // decrement our pending operation count
            PendingOperationsDecrement();
        }
		/// <summary>
		/// Helper that performs our asynchronous deleting.
		/// </summary>
		private void DoDeleteAsync(Object asyncState)
		{
			FileOperationState state = asyncState as FileOperationState;
			Exception error = null;

			// perform the delete operation
			try
			{
				Delete(state.Container, state.File, state.Location);
			}
			catch (Exception e)
			{
				error = e;
			}

			// construct our event arguments
			FileActionCompletedEventArgs args = new FileActionCompletedEventArgs(error, state.UserState);

			// fire our completion event
			DeleteCompleted(this, args);

			// recycle our state Object
			ReturnFileOperationState(state);

			// decrement our pending operation count
			PendingOperationsDecrement();
		}
		/// <summary>
		/// Helper that performs our asynchronous deleting.
		/// </summary>
		private void DoDeleteAsync(object asyncState)
		{
			// set our processor affinity
			SetProcessorAffinity();

			FileOperationState state = asyncState as FileOperationState;
			Exception error = null;

			// perform the delete operation
			try
			{
				Delete(state.Container, state.File);
			}
			catch (Exception e)
			{
				error = e;
			}

			// construct our event arguments
			FileActionCompletedEventArgs args = new FileActionCompletedEventArgs(error, state.UserState);

			// fire our completion event
			if (DeleteCompleted != null)
				DeleteCompleted(this, args);

			// recycle our state object
			ReturnFileOperationState(state);

			// decrement our pending operation count
			PendingOperationsDecrement();
		}