/// <summary>
        /// Cleans up the download session and returns an UpdateDownloadResult
        /// that matches the given parameters.
        /// </summary>
        /// <param name="state">The type of the update download result.</param>
        /// <param name="errorDescription">The description of the error that occured, if any.</param>
        /// <returns></returns>
        private UpdateDownloadResult CleanUpAndReturnResult(UpdateDownloadResultType state, string errorDescription = "")
        {
            verifier.VerificationFailed -= Verifier_VerificationFailed;
            verifier.Completed          -= Verifier_Completed;
            verifier.Stop();

            webClient.DownloadProgressChanged -= WebClient_DownloadProgressChanged;
            webClient.Dispose();

            verifierWaitHandle.Dispose();

            return(new UpdateDownloadResult(state, errorDescription));
        }
 public UpdateDownloadResult(UpdateDownloadResultType updateDownloadResultState,
                             string errorDescription)
 {
     UpdateDownloadResultState = updateDownloadResultState;
     ErrorDescription          = errorDescription;
 }
 public UpdateDownloadResult(UpdateDownloadResultType updateDownloadResultState)
 {
     UpdateDownloadResultState = updateDownloadResultState;
     ErrorDescription          = string.Empty;
 }