Ejemplo n.º 1
0
 public static void InstallZipFromWeb(Control parent, InstallProgram install)
 {
     try
     {
         IList <ToolStoreItem> toolStoreItems = null;
         using (var dlg = new LongWaitDlg {
             Message = Resources.ConfigureToolsDlg_AddFromWeb_Contacting_the_server
         })
         {
             dlg.PerformWork(parent, 1000, () =>
             {
                 toolStoreItems = ToolStoreUtil.ToolStoreClient.GetToolStoreItems();
             });
         }
         if (toolStoreItems == null || toolStoreItems.Count == 0)
         {
             MessageDlg.Show(parent, Resources.ConfigureToolsDlg_AddFromWeb_Unknown_error_connecting_to_the_tool_store);
         }
         using (var dlg = new ToolStoreDlg(ToolStoreUtil.ToolStoreClient, toolStoreItems))
         {
             if (dlg.ShowDialog(parent) == DialogResult.OK)
             {
                 InstallZipTool(parent, dlg.DownloadPath, install);
             }
         }
     }
     catch (TargetInvocationException x)
     {
         if (x.InnerException is ToolExecutionException || x.InnerException is WebException)
         {
             MessageDlg.Show(parent, String.Format(Resources.ConfigureToolsDlg_GetZipFromWeb_Error_connecting_to_the_Tool_Store___0_, x.Message));
         }
         else if (x.InnerException is JsonReaderException)
         {
             MessageDlg.Show(parent, Resources.ToolInstallUI_InstallZipFromWeb_The_server_returned_an_invalid_response__It_might_be_down_for_maintenance__Please_check_the_Tool_Store_on_the_skyline_ms_website_);
         }
         else
         {
             throw;
         }
     }
 }
Ejemplo n.º 2
0
 public static void InstallZipFromWeb(Control parent, InstallProgram install)
 {
     try
     {
         IList <ToolStoreItem> toolStoreItems = null;
         using (var dlg = new LongWaitDlg {
             Message = Resources.ConfigureToolsDlg_AddFromWeb_Contacting_the_server
         })
         {
             dlg.PerformWork(parent, 1000, () =>
             {
                 toolStoreItems = ToolStoreUtil.ToolStoreClient.GetToolStoreItems();
             });
         }
         if (toolStoreItems == null || toolStoreItems.Count == 0)
         {
             MessageDlg.Show(parent, Resources.ConfigureToolsDlg_AddFromWeb_Unknown_error_connecting_to_the_tool_store);
         }
         using (var dlg = new ToolStoreDlg(ToolStoreUtil.ToolStoreClient, toolStoreItems))
         {
             if (dlg.ShowDialog(parent) == DialogResult.OK)
             {
                 InstallZipTool(parent, dlg.DownloadPath, install);
             }
         }
     }
     catch (TargetInvocationException x)
     {
         if (x.InnerException is ToolExecutionException || x.InnerException is WebException)
         {
             MessageDlg.Show(parent, String.Format(Resources.ConfigureToolsDlg_GetZipFromWeb_Error_connecting_to_the_Tool_Store___0_, x.Message));
         }
         else
         {
             throw;
         }
     }
 }
Ejemplo n.º 3
0
 private static void ShowToolStore(string testDirectory, bool downloadSuccess)
 {
     var client = new TestToolStoreClient(testDirectory) {FailDownload = !downloadSuccess};
     using (var dlg = new ToolStoreDlg(client, client.GetToolStoreItems()))
     {
         dlg.ShowDialog();
     }
 }
Ejemplo n.º 4
0
 public static void InstallZipFromWeb(Control parent, InstallProgram install)
 {
     try
     {
         IList<ToolStoreItem> toolStoreItems = null;
         using (var dlg = new LongWaitDlg { Message = Resources.ConfigureToolsDlg_AddFromWeb_Contacting_the_server })
         {
             dlg.PerformWork(parent, 1000, () =>
             {
                 toolStoreItems = ToolStoreUtil.ToolStoreClient.GetToolStoreItems();
             });
         }
         if (toolStoreItems == null || toolStoreItems.Count == 0)
         {
             MessageDlg.Show(parent, Resources.ConfigureToolsDlg_AddFromWeb_Unknown_error_connecting_to_the_tool_store);
         }
         using (var dlg = new ToolStoreDlg(ToolStoreUtil.ToolStoreClient, toolStoreItems))
         {
             if (dlg.ShowDialog(parent) == DialogResult.OK)
                 InstallZipTool(parent, dlg.DownloadPath, install);
         }
     }
     catch (TargetInvocationException x)
     {
         if (x.InnerException.GetType() == typeof(ToolExecutionException) || x.InnerException is WebException)
             MessageDlg.Show(parent, String.Format(Resources.ConfigureToolsDlg_GetZipFromWeb_Error_connecting_to_the_Tool_Store___0_, x.Message));
         else
             throw;
     }
 }