예제 #1
0
        public override void ProcessInput(object input, out State newState)
        {
            if (input.Equals(PrivateInput.GoToUpdateAvailable))
            {
                newState = new UpdateAvailableState(this.manifest.VersionInfos[this.latestVersionIndex]);
            }
            else if (input.Equals(PrivateInput.GoToError))
            {
                string errorMessage;

                if (this.exception is WebException)
                {
                    errorMessage = Utility.WebExceptionToErrorMessage((WebException)this.exception);
                }
                else
                {
                    errorMessage = PdnResources.GetString("Updates.CheckingState.GenericError");
                }

                newState = new ErrorState(this.exception, errorMessage);
            }
            else if (input.Equals(PrivateInput.GoToDone))
            {
                newState = new DoneState();
            }
            else if (input.Equals(PrivateInput.GoToAborted))
            {
                newState = new AbortedState();
            }
            else
            {
                throw new ArgumentException();
            }
        }
예제 #2
0
        public override void ProcessInput(object input, out State newState)
        {
            if (input.Equals(PrivateInput.GoToExtracting))
            {
                newState = new ExtractingState(this.zipTempName, this.downloadMe);
            }
            else if (input.Equals(PrivateInput.GoToError))
            {
                string errorMessage;

                if (this.exception is WebException)
                {
                    errorMessage = Utility.WebExceptionToErrorMessage((WebException)this.exception);
                }
                else
                {
                    errorMessage = PdnResources.GetString("Updates.DownloadingState.GenericError");
                }

                newState = new ErrorState(this.exception, errorMessage);
            }
            else if (input.Equals(PrivateInput.GoToAborted))
            {
                newState = new AbortedState();
            }
            else
            {
                throw new ArgumentException();
            }
        }
예제 #3
0
 public override void ProcessInput(object input, out State newState)
 {
     if (input.Equals(PrivateInput.GoToReadyToInstall))
     {
         newState = new ReadyToInstallState(this.installerPath, this.newVersionInfo);
     }
     else if (input.Equals(PrivateInput.GoToError))
     {
         string errorMessage = PdnResources.GetString("Updates.ExtractingState.GenericError");
         newState = new ErrorState(this.exception, errorMessage);
     }
     else if (input.Equals(PrivateInput.GoToAborted))
     {
         newState = new AbortedState();
     }
     else
     {
         throw new ArgumentException();
     }
 }
예제 #4
0
 public override void ProcessInput(object input, out State newState)
 {
     if (input.Equals(PrivateInput.GoToReadyToInstall))
     {
         newState = new ReadyToInstallState(this.installerPath, this.newVersionInfo);
     }
     else if (input.Equals(PrivateInput.GoToError))
     {
         string errorMessage = PdnResources.GetString("Updates.ExtractingState.GenericError");
         newState = new ErrorState(this.exception, errorMessage);
     }
     else if (input.Equals(PrivateInput.GoToAborted))
     {
         newState = new AbortedState();
     }
     else
     {
         throw new ArgumentException();
     }
 }
예제 #5
0
        public override void ProcessInput(object input, out State newState)
        {
            if (input.Equals(PrivateInput.GoToUpdateAvailable))
            {
                newState = new UpdateAvailableState(this.manifest.VersionInfos[this.latestVersionIndex]);
            }
            else if (input.Equals(PrivateInput.GoToError))
            {
                string errorMessage;

                if (this.exception is WebException)
                {
                    errorMessage = Utility.WebExceptionToErrorMessage((WebException)this.exception);
                }
                else
                {
                    errorMessage = PdnResources.GetString("Updates.CheckingState.GenericError");
                }

                newState = new ErrorState(this.exception, errorMessage);
            }
            else if (input.Equals(PrivateInput.GoToDone))
            {
                newState = new DoneState();
            }
            else if (input.Equals(PrivateInput.GoToAborted))
            {
                newState = new AbortedState();
            }
            else
            {
                throw new ArgumentException();
            }
        }
예제 #6
0
        public override void ProcessInput(object input, out State newState)
        {
            if (input.Equals(PrivateInput.GoToExtracting))
            {
                newState = new ExtractingState(this.zipTempName, this.downloadMe);
            }
            else if (input.Equals(PrivateInput.GoToError))
            {
                string errorMessage;

                if (this.exception is WebException)
                {
                    errorMessage = Utility.WebExceptionToErrorMessage((WebException)this.exception);
                }
                else
                {
                    errorMessage = PdnResources.GetString("Updates.DownloadingState.GenericError");
                }

                newState = new ErrorState(this.exception, errorMessage);
            }
            else if (input.Equals(PrivateInput.GoToAborted))
            {
                newState = new AbortedState();
            }
            else
            {
                throw new ArgumentException();
            }
        }