src/Misc/EFTools/EntityDesign/VisualStudio/ErrorListHelper.cs
// <summary>
//     This method will log errors to the "Extension" Multi-doc error list.
// </summary>
This method will log errors to the "Extension" Multi-doc error list.
This method will log errors to the " Extension " Multi - doc error list .
internal static void LogExtensionErrors(IEnumerable<ExtensionError> errors, ProjectItem projectItem)
        {
            if (null == errors)
            {
                throw new ArgumentNullException("errors");
            }
            if (null == projectItem)
            {
                throw new ArgumentNullException("projectItem");
            }
            if (PackageManager.Package != null)
            {
                var hierarchy = VsUtils.GetVsHierarchy(projectItem.ContainingProject, Services.ServiceProvider);
                var itemId = VsUtils.GetProjectItemId(hierarchy, projectItem);
                var errorList = GetExtensionErrorList(PackageManager.Package);
                var errorCount = 0;
                foreach (var error in errors)
                {
                    if (errorCount++ > 99)
                    {
                        break;
                    }
                    var category = TaskErrorCategory.Message;
                    if (error.Severity == ExtensionErrorSeverity.Error)
                    {
                        category = TaskErrorCategory.Error;
                    }
                    else if (error.Severity == ExtensionErrorSeverity.Warning)
                    {
                        category = TaskErrorCategory.Warning;
                    }
                    string filePath = null;
                    var fullPathProperty = projectItem.Properties.Item("FullPath");
                    if (fullPathProperty != null)
                    {
                        filePath = fullPathProperty.Value as String;
                    }
                    if (filePath == null)
                    {
                        filePath = projectItem.Name;
                    }
                    var textSpan = new TextSpan();
                    textSpan.iStartLine = error.Line;
                    textSpan.iStartIndex = error.Column;
                    textSpan.iEndLine = error.Line;
                    textSpan.iEndIndex = error.Column;
                    errorList.AddItem(
                        EFModelErrorTaskFactory.CreateErrorTask(
                            filePath, error.Message, textSpan, category, hierarchy, itemId, MARKERTYPE.MARKER_OTHER_ERROR));
                }
            }
        }
internal static void LogExtensionErrors ( IEnumerable < ExtensionError > errors , ProjectItem projectItem ) { if ( null == errors ) { throw new ArgumentNullException ( " " ) ; } if ( null == projectItem ) { throw new ArgumentNullException ( " " ) ; } if ( PackageManager . Package != null ) { var hierarchy = VsUtils . GetVsHierarchy ( projectItem . ContainingProject , Services . ServiceProvider ) ; var itemId = VsUtils . GetProjectItemId ( hierarchy , projectItem ) ; var errorList = GetExtensionErrorList ( PackageManager . Package ) ; var errorCount = 0 ; foreach ( var error in errors ) { if ( errorCount ++ > 99 ) { break ; } var category = TaskErrorCategory . Message ; if ( error . Severity == ExtensionErrorSeverity . Error ) { category = TaskErrorCategory . Error ; } else if ( error . Severity == ExtensionErrorSeverity . Warning ) { category = TaskErrorCategory . Warning ; } string filePath = null ; var fullPathProperty = projectItem . Properties . Item ( " " ) ; if ( fullPathProperty != null ) { filePath = fullPathProperty . Value as String ; } if ( filePath == null ) { filePath = projectItem . Name ; } var textSpan = new TextSpan ( ) ; textSpan . iStartLine = error . Line ; textSpan . iStartIndex = error . Column ; textSpan . iEndLine = error . Line ; textSpan . iEndIndex = error . Column ; errorList . AddItem ( EFModelErrorTaskFactory . CreateErrorTask ( filePath , error . Message , textSpan , category , hierarchy , itemId , MARKERTYPE . MARKER_OTHER_ERROR ) ) ; } } }
This method will log errors to the "Extension" Multi-doc error list.
This method will log errors to the " Extension " Multi - doc error list .
// only display the first 100 errors.  VS gets really slow if you try to display more
errors
IEnumerable<ExtensionError>
projectItem
ProjectItem