GetUpdate.xaml 的交互逻辑
Inheritance: System.Windows.Window
示例#1
0
 public void minecraftUpdate()
 {
     if (isMinecraftUpdate)
     {
         if (MessageBox.Show(this.Resources["haveNewMinecraftUpdates"].ToString(), this.Resources["haveNewUpdatesTitle"].ToString(), MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
         {
             try
             {
                 this.Hide();
                 GetUpdate updateForm = new GetUpdate();
                 updateForm.Show();
                 updateForm.setParent(this);
                 updateForm.setDownload(minecraftDownload);
                 updateForm.minecraftUpdateStart();
                 updateForm.Show();
             }
             catch (Exception ex)
             {
                 if (ex.Message == "networkerror")
                 {
                     MessageBox.Show(this.Resources["networkError"].ToString(), this.Resources["errorMessageTitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
                 }
             }
         }
     }
 }
示例#2
0
 private void selfUpdate()
 {
     try
     {
         checkUpdate();
     }
     catch (Exception ex)
     {
         if (ex.Message == "networkerror")
         {
             MessageBox.Show(this.Resources["networkError"].ToString(), this.Resources["errorMessageTitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
     if (isSelfUpdate)
     {
         if (MessageBox.Show(this.Resources["haveNewSelfUpdates"].ToString(), this.Resources["haveNewUpdatesTitle"].ToString(), MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
         {
             try
             {
                 this.Hide();
                 GetUpdate updateForm = new GetUpdate();
                 updateForm.Show();
                 updateForm.setParent(this);
                 updateForm.setDownload(selfDownload);
                 updateForm.selfUpdateStart();
                 updateForm.Show();
             }
             catch (Exception ex)
             {
                 if (ex.Message == "networkerror")
                 {
                     MessageBox.Show(this.Resources["networkError"].ToString(), this.Resources["errorMessageTitle"].ToString(), MessageBoxButton.OK, MessageBoxImage.Error);
                 }
             }
         }
         else
             minecraftUpdate();
     }
     else
         minecraftUpdate();
 }