Exemple #1
0
        private void ProcessCompileResult(CompileResult result)
        {
            TaskManager.ClearMessages();

            if (result.IsSuccess)
            {
                Success(this, new EventArgs());
            }
            else
            {
                Fail(this, new EventArgs());

                _errors.Clear();
                _currentErrorIndex = 0;

                foreach (var file in result.Files)
                {
                    foreach (var error in file.GetErrors())
                    {
                        _errors.Add(error);

                        var location   = error.Location;
                        var filename   = location.Source?.File?.FullName ?? "";
                        var lineColumn = location.StartLineColumn;

                        TaskManager.AddError(error.Text, filename, lineColumn.Line, lineColumn.Column);
                    }
                }
            }
        }
 private async void btnRunHubScan_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         await ExecuteHubCommunication();
     }
     catch (Exception ex)
     {
         tbStatus.Foreground  = Brushes.Red;
         pbStatus.Visibility  = Visibility.Hidden;
         sepStatus.Visibility = Visibility.Hidden;
         tbStatus.Text        = Properties.Resources.MessageError;
         TaskManager.AddError(Properties.Resources.PaneTitle + ": " + ex.ToString());
     }
 }
 private void dgPackagesRow_DoubleClick(object sender, RoutedEventArgs e)
 {
     try
     {
         //View component version in Hub
         var package = dgPackages.SelectedItem as NuGetPackageViewModel.NuGetPackage;
         if (package.HubLink != null)
         {
             Process.Start(package.HubLink);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Properties.Resources.MessageError);
         TaskManager.AddError(Properties.Resources.PaneTitle + ": " + ex.ToString());
     }
 }
 private void cmbProjects_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if ((cmbProjects.SelectedItem != null) && (cmbProjects.SelectedItem.ToString() != Properties.Resources.ItemAll))
         {
             var filteredList =
                 _packagesList.Where(x => x.VsProject.Contains(cmbProjects.SelectedItem.ToString())).ToList();
             dgPackages.ItemsSource = filteredList;
         }
         else
         {
             dgPackages.ItemsSource = _packagesList;
         }
         dgPackages.Items.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show(Properties.Resources.MessageError);
         TaskManager.AddError(Properties.Resources.PaneTitle + ": " + ex.ToString());
     }
 }
        private void btnTestConnection_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var hubSettings = new HubSettings()
                {
                    ServerUrl = txtHubServerUrl.Text,
                    Username  = txtHubUsername.Text,
                    Password  = txtHubPassword.Password,
                    Timeout   = txtHubTimeout.Text,

                    ProxyHost     = txtProxyHost.Text,
                    ProxyPort     = txtProxyPort.Text,
                    ProxyUsername = txtProxyUsername.Text,
                    ProxyPassword = txtProxyPassword.Password
                };

                if (hubSettings.HasSettings())
                {
                    var client = Authenticate.EstablishHubSession(hubSettings);

                    MessageBox.Show(client != null
                        ? Properties.Resources.MessageConnectionSuccessful
                        : Properties.Resources.MessageConnectionUnsuccessful);
                }
                else
                {
                    MessageBox.Show(Properties.Resources.MesageNoHubSettings);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Properties.Resources.MessageError);
                TaskManager.AddError(Properties.Resources.PaneTitle + ": " + ex.ToString());
            }
        }