private static void CheckCopyrightText(SyntaxTreeAnalysisContext context, DocumentationSettings documentationSettings, Compilation compilation, XmlFileHeader fileHeader, XElement copyrightElement)
            {
                var copyrightText = copyrightElement.Value;

                if (string.IsNullOrWhiteSpace(copyrightText))
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1635Descriptor, location));
                    return;
                }

                if (compilation.IsAnalyzerSuppressed(SA1636Descriptor))
                {
                    return;
                }

                string fileName = Path.GetFileName(context.Tree.FilePath);
                var    settingsCopyrightText = documentationSettings.GetCopyrightText(fileName);

                if (string.Equals(settingsCopyrightText, DocumentationSettings.DefaultCopyrightText, StringComparison.OrdinalIgnoreCase))
                {
                    // The copyright text is meaningless until the company name is configured by the user.
                    return;
                }

                // trim any leading / trailing new line or whitespace characters (those are a result of the XML formatting)
                if (!CompareCopyrightText(context, documentationSettings, copyrightText.Trim('\r', '\n', ' ', '\t')))
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1636Descriptor, location));
                }
            }
            private static bool CompareCopyrightText(SyntaxTreeAnalysisContext context, DocumentationSettings documentationSettings, string copyrightText)
            {
                // make sure that both \n and \r\n are accepted from the settings.
                string fileName = Path.GetFileName(context.Tree.FilePath);
                var    reformattedCopyrightTextParts = documentationSettings.GetCopyrightText(fileName).Replace("\r\n", "\n").Split('\n');
                var    fileHeaderCopyrightTextParts  = copyrightText.Replace("\r\n", "\n").Split('\n');

                if (reformattedCopyrightTextParts.Length != fileHeaderCopyrightTextParts.Length)
                {
                    return(false);
                }

                // compare line by line, ignoring leading and trailing whitespace on each line.
                for (var i = 0; i < reformattedCopyrightTextParts.Length; i++)
                {
                    if (string.CompareOrdinal(reformattedCopyrightTextParts[i].Trim(), fileHeaderCopyrightTextParts[i].Trim()) != 0)
                    {
                        return(false);
                    }
                }

                return(true);
            }