Exemplo n.º 1
0
        private static LicenseSubServiceResponse CallExternalProcess(ProcessStartInfo info)
        {
            LicenseSubServiceResponse licenseSubServiceResponse;
            LicenseSubServiceResponse exitCode = new LicenseSubServiceResponse();

            try
            {
                Process process = Process.Start(info);
                if (process != null)
                {
                    process.WaitForExit();
                    if (process.ExitCode < 0)
                    {
                        exitCode.ErrorCode        = (uint)process.ExitCode;
                        licenseSubServiceResponse = exitCode;
                        return(licenseSubServiceResponse);
                    }
                }
                return(exitCode);
            }
            catch (ObjectDisposedException objectDisposedException)
            {
                exitCode.Exception        = objectDisposedException;
                licenseSubServiceResponse = exitCode;
            }
            catch (InvalidOperationException invalidOperationException)
            {
                exitCode.Exception        = invalidOperationException;
                licenseSubServiceResponse = exitCode;
            }
            catch (Win32Exception win32Exception)
            {
                exitCode.Exception        = win32Exception;
                licenseSubServiceResponse = exitCode;
            }
            catch (Exception exception)
            {
                exitCode.Exception        = exception;
                licenseSubServiceResponse = exitCode;
            }
            return(licenseSubServiceResponse);
        }
Exemplo n.º 2
0
 public EnterKeyResponse(LicenseSubServiceResponse baseResponse)
 {
     this.ErrorCode = baseResponse.ErrorCode;
     this.Exception = baseResponse.Exception;
 }