コード例 #1
0
        public sealed override bool Equals(object obj)
        {
            LanguageDiagnosticInfo other = obj as LanguageDiagnosticInfo;

            bool result = false;

            if (other != null &&
                other._errorCode == _errorCode &&
                this.GetType() == obj.GetType())
            {
                if (_arguments == null && other._arguments == null)
                {
                    result = true;
                }
                else if (_arguments != null && other._arguments != null && _arguments.Length == other._arguments.Length)
                {
                    result = true;
                    for (int i = 0; i < _arguments.Length; i++)
                    {
                        if (!object.Equals(_arguments[i], other._arguments[i]))
                        {
                            result = false;
                            break;
                        }
                    }
                }
            }

            return(result);
        }
コード例 #2
0
 internal LanguageDiagnostic(LanguageDiagnosticInfo info, Location location, bool isSuppressed = false)
 {
     Debug.Assert(info != null);
     Debug.Assert(location != null);
     _info         = info;
     _location     = location;
     _isSuppressed = isSuppressed;
 }
コード例 #3
0
 private LanguageDiagnosticInfo(LanguageDiagnosticInfo original, DiagnosticSeverity overriddenSeverity)
 {
     _errorCode         = original._errorCode;
     _arguments         = original._arguments;
     _effectiveSeverity = overriddenSeverity;
 }
コード例 #4
0
 public static Diagnostic Create(LanguageDiagnosticInfo info)
 {
     return(new DiagnosticWithInfo(info, Location.None));
 }