예제 #1
0
        /// <summary>
        /// Actualizes error associated with this project reference
        /// </summary>
        public void RefreshProjectReferenceErrorState()
        {
            UIThread.DoOnUIThread(() =>
            {
                CleanProjectReferenceErrorState();

                switch (CheckFrameworksCompatibility(ProjectMgr, referencedProjectGuid))
                {
                case FrameworkCompatibility.Ok:
                    /* This is OK - do nothing */
                    break;

                case FrameworkCompatibility.HigherVersion:
                    SetProjectReferencesHigherVersionWarningMessage();
                    break;

                case FrameworkCompatibility.DifferentFamily:
                    {
                        var myFramework    = GetProjectTargetFrameworkName(ProjectMgr);
                        var otherFramework = GetProjectTargetFrameworkName(ProjectMgr.Site, referencedProjectGuid);
                        var msg            = GetDifferentFamilyErrorMessage(myFramework, referencedProjectName, otherFramework);
                        SetError(msg);
                    }
                    break;
                }
            }
                                  );
        }
예제 #2
0
 /// <summary>
 /// Resets error (if any) associated with current project reference
 /// </summary>
 public void CleanProjectReferenceErrorState()
 {
     UIThread.DoOnUIThread(() =>
     {
         if (projectRefError != null)
         {
             ProjectMgr.ProjectErrorsTaskListProvider.Tasks.Remove(projectRefError);
             projectRefError = null;
         }
     }
                           );
 }
예제 #3
0
        /// <summary>
        /// Creates new error with given text and associates it with current project reference.
        /// Old error is removed
        /// </summary>
        /// <param name="text"></param>
        private void SetError(string text)
        {
            UIThread.DoOnUIThread(() =>
            {
                // delete existing error if exists
                CleanProjectReferenceErrorState();

                projectRefError = new Shell.ErrorTask
                {
                    ErrorCategory = Shell.TaskErrorCategory.Warning,
                    HierarchyItem = ProjectMgr.InteropSafeIVsHierarchy,
                    Text          = text
                };

                ProjectMgr.ProjectErrorsTaskListProvider.Tasks.Add(projectRefError);
            }
                                  );
        }