Used for arguments for FileExistsAsync.
Esempio n. 1
0
        /// <summary>
        /// Helper that performs our asynchronous FileExists.
        /// </summary>
        private void DoFileExistsAsync(object asyncState)
        {
            // set our processor affinity
            SetProcessorAffinity();

            FileOperationState state = asyncState as FileOperationState;
            Exception          error = null;
            bool result = false;

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

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

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

            // recycle our state object
            ReturnFileOperationState(state);

            // decrement our pending operation count
            PendingOperationsDecrement();
        }
Esempio n. 2
0
		/// <summary>
		/// Helper that performs our asynchronous FileExists.
		/// </summary>
		private void DoFileExistsAsync(object asyncState)
		{
			FileOperationState state = asyncState as FileOperationState;
			Exception error = null;
			bool result = false;

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

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

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

			// recycle our state object
			ReturnFileOperationState(state);

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