private void InstallLicenses_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     TaskProgressBar.ProgressState = TaskbarItemProgressState.None;
     Tab4Process.IsIndeterminate   = false;
     if (e.Error != null)
     {
         CMessageBox.Show(e.Error.Message, Find("MsgError"), CMessageBoxImage.Error);
     }
     else if (e.Result != null)
     {
         ToastMessage(e.Result.ToString(), string.Empty);
     }
     else
     {
         ToastMessage(Find("ToastLicensesInstallSuccess"), string.Empty);
     }
     try //删除多余文件,避免出错
     {
         DirectoryInfo di = new DirectoryInfo(TempInfo.FullName + "licenses\\");
         di.Delete(true);
     }
     catch
     { }
     InstallLicenses.Dispose();
 }
 private void ILicenses_Click(object sender, RoutedEventArgs e)
 {
     if (InstallLicenses.IsBusy)
     {
         ToastMessage(Find("ToastWorkerIsBusy"), Find("MsgNormalTitle"));
         return;
     }
     if (CMessageBox.Show(Find("MsgInstallLicenses"), Find("MsgNormalTitle"), CMessageBoxButton.YesNO, CMessageBoxImage.Question) == CMessageBoxResult.Yes)
     {
         string Licenses_Dir;
         string Key;
         if (ConversionSelected.SelectedIndex == 0)
         {
             Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\ProPlus16";
             Key          = "XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99";
         }
         else if (ConversionSelected.SelectedIndex == 1)
         {
             Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Mondo16";
             Key          = "HFTND-W9MK4-8B7MJ-B6C4G-XQBR2";
         }
         else if (ConversionSelected.SelectedIndex == 2)
         {
             Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Project16";
             Key          = "WGT24-HCNMF-FQ7XH-6M8K7-DRTW9";
         }
         else if (ConversionSelected.SelectedIndex == 3)
         {
             Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Visio16";
             Key          = "69WXN-MBYV6-22PQG-3WGHK-RM6XC";
         }
         else if (ConversionSelected.SelectedIndex == 4)
         {
             Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\ProPlus17";
             Key          = "NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP";
         }
         else if (ConversionSelected.SelectedIndex == 5)
         {
             Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Project17";
             Key          = "B4NPR-3FKK7-T2MBV-FRQ4W-PKD2B";
         }
         else if (ConversionSelected.SelectedIndex == 6)
         {
             Licenses_Dir = TempInfo.FullName + "licenses\\VOL\\Visio17";
             Key          = "9BGNQ-K37YR-RQHF2-38RQ3-7VCBB";
         }
         else
         {
             string[] arg = new string[] { "2", "CommonLicenseFiles," + ConversionSelected.Text };
             InstallLicenses.RunWorkerAsync(arg);
             return;
         }
         // 0 内置证书,1 证书路径,2 Office 文件夹
         string[] ar = { "0", Licenses_Dir, Key, TempInfo.FullName + "licenses\\Common" };
         InstallLicenses.RunWorkerAsync(ar);
     }
 }
Beispiel #3
0
 private void InstallLicensesByPath_Click(object sender, RoutedEventArgs e)
 {
     if (InstallLicenses.IsBusy)
     {
     }
     else
     {
         System.Windows.Forms.FolderBrowserDialog m_Dialog = new System.Windows.Forms.FolderBrowserDialog
         {
             Description = Find("MsgSelectLicensesPath")
         };
         System.Windows.Forms.DialogResult result = m_Dialog.ShowDialog();
         if (result == System.Windows.Forms.DialogResult.OK)
         {
             string[] ar = new string[] { "1", m_Dialog.SelectedPath.Trim() };
             InstallLicenses.RunWorkerAsync(ar);
         }
     }
 }
Beispiel #4
0
 private void InstallLicenses_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         CMessageBox.Show(e.Error.Message, CMessageBoxImage.Error);
     }
     else if (e.Result != null)
     {
     }
     else
     {
     }
     try //删除多余文件,避免出错
     {
         DirectoryInfo di = new DirectoryInfo(a + "licenses\\");
         di.Delete(true);
     }
     catch
     { }
     InstallLicenses.Dispose();
 }