private void checkRPMAccess() { if (this.RpmApiKey.Text != PLACEHOLDER_KEY && this.RpmApiUrl.Text != PLACEHOLDER_URL) { string errorMessage = ""; this.rpmAccessWorked = false; try { RPMSync rpmAccess = new RPMSync(this.RpmApiUrl.Text, this.RpmApiKey.Text); this.rpmAccessWorked = rpmAccess.infoSuccessful(); } catch (WebException webex) { errorMessage = "Could not connect to RPM: " + webex.Message; } catch (RPMApiError apiError) { errorMessage = apiError.Message; } catch (ProcessNotFoundException pnfE) { errorMessage = pnfE.Message; } finally { if (errorMessage != "") { this.showRPMAccessError(errorMessage); } } } }
public void setup(bool openMainWindow = true) { this.setupGoogleAccess(); if (this.settingsAreComplete()) { if (openMainWindow) { DataListing dl = new DataListing(); dl.Show(); } bool hasErrors = true; try { this.sync = new RPMSync(this.RpmApiUrl, this.rpmApiKey); this.sync.WorkComplete += sync_WorkComplete; this.sync.ProgressChanged += sync_ProgressChanged; hasErrors = false; } catch (RPMApiError e) { if (!e.Message.Contains("not enabled")) { this.saveSetting("RpmApiUrl", ""); this.saveSetting("RpmApiKey", ""); } } catch (ProcessNotFoundException) {} catch (WebException) {} finally { if (hasErrors) { this.showSetupWindow(true); } } } }