Beispiel #1
0
 /// <summary>
 /// Force l'affichage de la task list
 /// </summary>
 public void ShowErrorList()
 {
     if (errorList != null)
     {
         errorList.BringToFront();
         errorList.ForceShowErrors();
     }
 }
        // EDDO: This is a good place to create/initialize the ErrorListProvider,
        //       as we need to pass a valid IOleServiceProvider to it's constructor.
        public override void OnToolWindowCreated()
        {
            base.OnToolWindowCreated();

            if (errorProvider == null)
            {
                errorProvider = new ErrorListProvider(this);
                errorProvider.ProviderName = "My Errors";
                errorProvider.ProviderGuid = typeof(MyToolWindow).GUID;
                errorProvider.ForceShowErrors();
            }
        }
        public static void ShowError(ErrorListProvider errorListProvider, TaskErrorCategory errorCategory, TaskPriority priority, string errorText, IVsHierarchy hierarchyItem)
        {
            ErrorTask errorTask = new ErrorTask();

            errorTask.Text          = errorText;
            errorTask.ErrorCategory = errorCategory;
            errorTask.Category      = TaskCategory.BuildCompile;
            errorTask.Priority      = priority;
            errorTask.HierarchyItem = hierarchyItem;
            errorListProvider.Tasks.Add(errorTask);
            errorListProvider.BringToFront();
            errorListProvider.ForceShowErrors();
        }
Beispiel #4
0
        public static void Show()
        {
            if (_initialized == false)
            {
                return;
            }

            try
            {
                _errorListProvider.Show();
                _errorListProvider.ForceShowErrors();
                _ivsErrorList.BringToFront();
            }
            catch (Exception exception)
            {
                Log.Error($"Failed to show Error List. {exception.Message}");
            }
        }
Beispiel #5
0
        private void Log(TaskErrorCategory category, string message, string document = null)
        {
            if (_errorListProvider == null)
            {
                return;
            }

            _errorListProvider.Tasks.Add(new ErrorTask()
            {
                Category      = TaskCategory.Misc,
                ErrorCategory = TaskErrorCategory.Error,
                CanDelete     = true,
                Document      = document,
                Text          = message,
            });
            _errorListProvider.ForceShowErrors();
            _errorListProvider.Show();
        }
        public void End()
        {
            NuGetUIThreadHelper.JoinableTaskFactory.Run(async delegate
            {
                await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                OutputConsole.WriteLine(Resources.Finished);
                OutputConsole.WriteLine(string.Empty);

                if (ErrorListProvider.Tasks.Count > 0)
                {
                    ErrorListProvider.BringToFront();
                    ErrorListProvider.ForceShowErrors();
                }

                // Give the error list focus
                ErrorListTableDataSource.Value.BringToFront();
            });
        }
Beispiel #7
0
        internal void UpdateErrors(AnalysisErrorsNotification errorNotification)
        {
            errorProvider.SuspendRefresh();
            RemoveErrorsForFile(errorNotification.File);

            var errorTasks = errorNotification.Errors.Select(CreateErrorTask);

            foreach (var error in errorTasks)
            {
                error.Navigate += (s, e) =>
                {
                    error.Line++;                     // Line number seems 0-based in most places, but Navigate didn't get the memo :(
                    errorProvider.Navigate(error, new Guid(EnvDTE.Constants.vsViewKindCode));
                    error.Line--;
                };
                errorProvider.Tasks.Add(error);
            }
            errorProvider.ResumeRefresh();
            errorProvider.Show();
            errorProvider.ForceShowErrors();
        }