コード例 #1
0
ファイル: App.xaml.cs プロジェクト: gomckenz/rpm-google-docs
 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);
             }
         }
     }
 }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: gomckenz/rpm-google-docs
 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);
             }
         }
     }
 }