示例#1
0
            public override bool Equals(Diagnostic?obj)
            {
                if (ReferenceEquals(this, obj))
                {
                    return(true);
                }

                var other = obj as SimpleDiagnostic;

                if (other == null)
                {
                    return(false);
                }

                if (AnalyzerExecutor.IsAnalyzerExceptionDiagnostic(this))
                {
                    // We have custom Equals logic for diagnostics generated for analyzer exceptions.
                    return(AnalyzerExecutor.AreEquivalentAnalyzerExceptionDiagnostics(this, other));
                }

                return(_descriptor.Equals(other._descriptor) &&
                       _messageArgs.SequenceEqual(other._messageArgs, (a, b) => a == b) &&
                       _location == other._location &&
                       _severity == other._severity &&
                       _warningLevel == other._warningLevel);
            }
            public override bool Equals(Diagnostic obj)
            {
                var other = obj as SimpleDiagnostic;

                return(other != null &&
                       _descriptor.Equals(other._descriptor) &&
                       _messageArgs.SequenceEqual(other._messageArgs, (a, b) => a == b) &&
                       _location == other._location &&
                       _severity == other._severity &&
                       _warningLevel == other._warningLevel);
            }