コード例 #1
0
            internal override int GetHashCode(ComparisonOptions options)
            {
                var comparer = SymbolKeyComparer.GetComparer(options);

                return(Hash.Combine(
                           GetHashCode(options.IgnoreCase, this.metadataName),
                           comparer.GetHashCode(this.containerKeyOpt)));
            }
コード例 #2
0
            internal override bool Equals(NamespaceSymbolKey other, ComparisonOptions options)
            {
                var comparer = SymbolKeyComparer.GetComparer(options);

                return
                    (Equals(options.IgnoreCase, other.metadataName, this.metadataName) &&
                     comparer.Equals(other.containerKeyOpt, this.containerKeyOpt));
            }
コード例 #3
0
 private static SymbolKeyComparer EnsureInitialized(
     ref SymbolKeyComparer location,
     ComparisonOptions options
     )
 {
     // This doesn't need to be interlocked since comparers store no state
     return(location ?? (location = new SymbolKeyComparer(options)));
 }
コード例 #4
0
            internal override bool Equals(NamedTypeSymbolKey other, ComparisonOptions options)
            {
                var comparer = SymbolKeyComparer.GetComparer(options);

                return
                    (other._arity == _arity &&
                     Equals(options.IgnoreCase, other._metadataName, _metadataName) &&
                     comparer.Equals(other._containerKey, _containerKey) &&
                     SequenceEquals(other._typeArgumentKeysOpt, _typeArgumentKeysOpt, comparer));
            }
コード例 #5
0
            internal override bool Equals(ErrorTypeSymbolKey other, ComparisonOptions options)
            {
                var comparer = SymbolKeyComparer.GetComparer(options);

                return
                    (other.arity == this.arity &&
                     Equals(options.IgnoreCase, other.name, this.name) &&
                     comparer.Equals(other.containerKey, this.containerKey) &&
                     SequenceEquals(other.typeArgumentKeysOpt, this.typeArgumentKeysOpt, comparer));
            }
コード例 #6
0
            internal override bool Equals(PropertySymbolKey other, ComparisonOptions options)
            {
                var comparer = SymbolKeyComparer.GetComparer(options.IgnoreCase, options.IgnoreAssemblyKey, compareMethodTypeParametersByName: true);

                return
                    (other.isIndexer == this.isIndexer &&
                     other.refKinds.Length == this.refKinds.Length &&
                     Equals(options.IgnoreCase, other.metadataName, this.metadataName) &&
                     other.containerKey.Equals(this.containerKey, options) &&
                     other.refKinds.SequenceEqual(this.refKinds) &&
                     SequenceEquals(other.originalParameterTypeKeys, this.originalParameterTypeKeys, comparer));
            }
コード例 #7
0
 internal override bool Equals(MethodSymbolKey other, ComparisonOptions options)
 {
     var comparer = SymbolKeyComparer.GetComparer(options.IgnoreCase, options.IgnoreAssemblyKey, compareMethodTypeParametersByName: true);
     return
         other._arity == _arity &&
         other._refKinds.Length == _refKinds.Length &&
         other._isPartialMethodImplementationPart == _isPartialMethodImplementationPart &&
         Equals(options.IgnoreCase, other._metadataName, _metadataName) &&
         other._containerKey.Equals(_containerKey, options) &&
         other._refKinds.SequenceEqual(_refKinds) &&
         other._originalParameterTypeKeys.SequenceEqual(_originalParameterTypeKeys, comparer) &&
         SequenceEquals(other._typeArgumentKeysOpt, _typeArgumentKeysOpt, comparer);
 }
コード例 #8
0
ファイル: SymbolKey.cs プロジェクト: singhsarab/roslyn
 public static IEqualityComparer <SymbolKey> GetComparer(bool ignoreCase, bool ignoreAssemblyKeys)
 {
     return(SymbolKeyComparer.GetComparer(ignoreCase, ignoreAssemblyKeys));
 }
コード例 #9
0
ファイル: SymbolKey.cs プロジェクト: weiqigod/roslyn
 /// <summary>
 /// Returns an <see cref="IEqualityComparer{T}"/> that determines if two <see cref="SymbolKey"/>s
 /// represent the same effective symbol.
 /// </summary>
 /// <param name="ignoreCase">Whether or not casing should be considered when comparing keys.
 /// For example, with <c>ignoreCase=true</c> then <c>X.SomeClass</c> and <c>X.Someclass</c> would be
 /// considered the same effective symbol</param>
 /// <param name="ignoreAssemblyKeys">Whether or not the originating assembly of referenced
 /// symbols should be compared when determining if two symbols are effectively the same.
 /// For example, with <c>ignoreAssemblyKeys=true</c> then an <c>X.SomeClass</c> from assembly
 /// <c>A</c> and <c>X.SomeClass</c> from assembly <c>B</c> will be considered the same
 /// effective symbol.
 /// </param>
 internal static IEqualityComparer <SymbolKey> GetComparer(bool ignoreCase = false, bool ignoreAssemblyKeys = false)
 => SymbolKeyComparer.GetComparer(ignoreCase, ignoreAssemblyKeys);
コード例 #10
0
 public static IEqualityComparer <SymbolKey> GetComparer(bool ignoreCase, bool ignoreAssemblyKeys)
 {
     return(SymbolKeyComparer.GetComparer(ignoreCase, ignoreAssemblyKeys, compareMethodTypeParametersByName: false));
 }