System.Type.GetHashCode()

Here are the examples of the csharp api System.Type.GetHashCode() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

533 Examples 7

19 Source : ExtendedType.cs
with MIT License
from ChilliCream

public override int GetHashCode()
    {
        unchecked
        {
            var hashCode = (Type.GetHashCode() * 397)
                ^ (Kind.GetHashCode() * 397)
                ^ (IsNullable.GetHashCode() * 397);

            for (var i = 0; i < TypeArguments.Count; i++)
            {
                hashCode ^= (TypeArguments[i].GetHashCode() * 397 * i);
            }

            return hashCode;
        }
    }

19 Source : ExtendedTypeId.cs
with MIT License
from ChilliCream

public override int GetHashCode()
    {
        unchecked
        {
            return Type.GetHashCode() * 397 ^
                   Nullability.GetHashCode() * 397 ^
                   Kind.GetHashCode() * 397;
        }
    }

19 Source : AnimatedParameterCache.cs
with MIT License
from chstetco

public override int GetHashCode()
        {
            unchecked
            {
                return ((m_Type != null ? m_Type.GetHashCode() : 0) * 397) ^ (m_Path != null ? m_Path.GetHashCode() : 0);
            }
        }

19 Source : ShellPropertyFactory.cs
with GNU General Public License v3.0
from CitizensReactor

private static int GetTypeHash(IEnumerable<Type> types)
        {
            int hash = 0;
            foreach (Type type in types)
            {
                hash = hash * 31 + type.GetHashCode();
            }
            return hash;
        }

19 Source : TypeTuple.cs
with MIT License
from ClockGet

public override int GetHashCode()
        {
            return Item1.GetHashCode() + Item2.GetHashCode();
        }

19 Source : Identity.cs
with MIT License
from cloudnative-netcore

public override int GetHashCode()
        {
            return GetType().GetHashCode() * 907 + Id.GetHashCode();
        }

19 Source : Key.cs
with MIT License
from codewriter-packages

public override int GetHashCode() => typeof(T).GetHashCode();

19 Source : SchemaBuilder.cs
with MIT License
from Cooke

public override int GetHashCode()
            {
                unchecked
                {
                    return (ClrType.GetHashCode() * 397) ^ IsInput.GetHashCode();
                }
            }

19 Source : RequestReplyCorrelator.cs
with MIT License
from CoreWCF

public override int GetHashCode()
            {
                return MessageId.GetHashCode() ^ StateType.GetHashCode();
            }

19 Source : StreamedSequenceInfo.cs
with Apache License 2.0
from coronabytes

public override int GetHashCode()
        {
            return DataType.GetHashCode() ^ ItemExpression.GetHashCode();
        }

19 Source : StreamedValueInfo.cs
with Apache License 2.0
from coronabytes

public override int GetHashCode()
        {
            return DataType.GetHashCode();
        }

19 Source : ConfigLoadingContext.cs
with Apache License 2.0
from cosmos-loops

private static MethodInfo GetMethod(Type firstParamType, FileTypes fileTypes) {
            var m = GetMetadata(fileTypes);
            var h = firstParamType.GetHashCode();
            var key = (m.replacedemblyName, m.ClreplacedNamePrefix, m.MethodName, h);
            if (_methodCallingCache.TryGetValue(key, out var method))
                return method;

            var replacedemblyName = DependencyContext.Default.GetDefaultreplacedemblyNames().FirstOrDefault(x => x.Name == m.replacedemblyName);

            if (replacedemblyName == null)
                return null;

            var replacedembly = replacedembly.Load(replacedemblyName);
            var fullName = $"Cosmos.Logging.Configuration.{m.ClreplacedNamePrefix}ConfigurationBuilderExtensions";
            var clazz = replacedembly.GetTypes().FirstOrDefault(t => t.FullName == fullName);

            method = clazz?.GetMethod(m.MethodName, new[] {firstParamType, _stringType});

            if (method == null)
                return null;

            if (_methodCallingCache.TryAdd(key, method))
                return method;

            throw new InvalidOperationException("Cannot cache the matched method right now.");
        }

19 Source : DefaultContractResolver.cs
with MIT License
from CragonGame

public override int GetHashCode()
		{
			return _resolverType.GetHashCode() ^ _contractType.GetHashCode();
		}

19 Source : ConvertUtils.cs
with MIT License
from CragonGame

public override int GetHashCode()
      {
        return _initialType.GetHashCode() ^ _targetType.GetHashCode();
      }

19 Source : ObjectCompareHint.cs
with Mozilla Public License 2.0
from CreateAndFake

protected override int GetHashCode(object item, ValuerChainer valuer)
        {
            if (item == null) throw new ArgumentNullException(nameof(item));
            if (valuer == null) throw new ArgumentNullException(nameof(valuer));

            Type type = item.GetType();
            int hash = ValueComparer.BaseHash + type.GetHashCode();

            foreach (PropertyInfo property in type.GetProperties(_scope).Where(p => p.CanRead))
            {
                hash = hash * ValueComparer.HashMultiplier + valuer.GetHashCode(property.GetValue(item));
            }

            foreach (FieldInfo field in type.GetFields(_scope))
            {
                hash = hash * ValueComparer.HashMultiplier + valuer.GetHashCode(field.GetValue(item));
            }

            return hash;
        }

19 Source : StatelessCompareHint.cs
with Mozilla Public License 2.0
from CreateAndFake

protected override int GetHashCode(object item, ValuerChainer valuer)
        {
            if (item == null) throw new ArgumentNullException(nameof(item));

            return item.GetType().GetHashCode();
        }

19 Source : ProtocolBase.cs
with MIT License
from CymaticLabs

public override int GetHashCode() {
            return GetType().GetHashCode();
        }

19 Source : HashTreeTests.cs
with MIT License
from dadhi

[Test]
        public void Can_use_int_key_tree_to_represent_general_HashTree_with_possible_hash_conflicts()
        {
            var tree = ImHashMap<int, KeyValuePair<Type, string>[]>.Empty;

            var key = typeof(HashTreeTests);
            var keyHash = key.GetHashCode();
            var value = "test";

            Update<KeyValuePair<Type, string>[]> update = (oldValue, newValue) =>
            {
                var newItem = newValue[0];
                var oldItemCount = oldValue.Length;
                for (var i = 0; i < oldItemCount; i++)
                {
                    if (oldValue[i].Key == newItem.Key)
                    {
                        var updatedItems = new KeyValuePair<Type, string>[oldItemCount];
                        Array.Copy(oldValue, updatedItems, updatedItems.Length);
                        updatedItems[i] = newItem;
                        return updatedItems;
                    }
                }

                var addedItems = new KeyValuePair<Type, string>[oldItemCount + 1];
                Array.Copy(oldValue, addedItems, addedItems.Length);
                addedItems[oldItemCount] = newItem;
                return addedItems;
            };

            tree = tree.AddOrUpdate(keyHash, new[] { new KeyValuePair<Type, string>(key, value) }, update);
            tree = tree.AddOrUpdate(keyHash, new[] { new KeyValuePair<Type, string>(key, value) }, update);

            string result = null;

            var items = tree.GetValueOrDefault(keyHash);
            if (items != null)
            {
                var firsreplacedem = items[0];
                if (firsreplacedem.Key == key)
                    result = firsreplacedem.Value;
                else if (items.Length > 1)
                {
                    for (var i = 1; i < items.Length; i++)
                    {
                        if (items[i].Key == key)
                        {
                            result = items[i].Value;
                            break;
                        }
                    }
                }
            }

            replacedert.That(result, Is.EqualTo("test"));
        }

19 Source : ImHashMapTests.cs
with MIT License
from dadhi

[Test]
        public void Can_use_int_key_tree_to_represent_general_HashTree_with_possible_hash_conflicts()
        {
            var tree = ImMap<KeyValuePair<Type, string>[]>.Empty;

            var key = typeof(ImHashMapTests);
            var keyHash = key.GetHashCode();
            var value = "test";

            KeyValuePair<Type, string>[] Update(int _, KeyValuePair<Type, string>[] oldValue, KeyValuePair<Type, string>[] newValue)
            {
                var newItem = newValue[0];
                var oldItemCount = oldValue.Length;
                for (var i = 0; i < oldItemCount; i++)
                {
                    if (oldValue[i].Key == newItem.Key)
                    {
                        var updatedItems = new KeyValuePair<Type, string>[oldItemCount];
                        Array.Copy(oldValue, updatedItems, updatedItems.Length);
                        updatedItems[i] = newItem;
                        return updatedItems;
                    }
                }

                var addedItems = new KeyValuePair<Type, string>[oldItemCount + 1];
                Array.Copy(oldValue, addedItems, addedItems.Length);
                addedItems[oldItemCount] = newItem;
                return addedItems;
            }

            tree = tree.AddOrUpdate(keyHash, new[] {new KeyValuePair<Type, string>(key, value)}, Update);
            tree = tree.AddOrUpdate(keyHash, new[] {new KeyValuePair<Type, string>(key, value)}, Update);

            string result = null;

            var items = tree.GetValueOrDefault(keyHash);
            if (items != null)
            {
                var firsreplacedem = items[0];
                if (firsreplacedem.Key == key)
                    result = firsreplacedem.Value;
                else if (items.Length > 1)
                {
                    for (var i = 1; i < items.Length; i++)
                    {
                        if (items[i].Key == key)
                        {
                            result = items[i].Value;
                            break;
                        }
                    }
                }
            }

            replacedert.That(result, Is.EqualTo("test"));
        }

19 Source : ImMapTests.cs
with MIT License
from dadhi

[Test]
        public void Can_use_int_key_tree_to_represent_general_HashTree_with_possible_hash_conflicts()
        {
            var tree = ImMap<KeyValuePair<Type, string>[]>.Empty;

            var key = typeof(ImMapTests);
            var keyHash = key.GetHashCode();
            var value = "test";

            KeyValuePair<Type, string>[] Update(int _, KeyValuePair<Type, string>[] oldValue, KeyValuePair<Type, string>[] newValue)
            {
                var newItem = newValue[0];
                var oldItemCount = oldValue.Length;
                for (var i = 0; i < oldItemCount; i++)
                {
                    if (oldValue[i].Key == newItem.Key)
                    {
                        var updatedItems = new KeyValuePair<Type, string>[oldItemCount];
                        Array.Copy(oldValue, updatedItems, updatedItems.Length);
                        updatedItems[i] = newItem;
                        return updatedItems;
                    }
                }

                var addedItems = new KeyValuePair<Type, string>[oldItemCount + 1];
                Array.Copy(oldValue, addedItems, addedItems.Length);
                addedItems[oldItemCount] = newItem;
                return addedItems;
            }

            tree = tree.AddOrUpdate(keyHash, new[] {new KeyValuePair<Type, string>(key, value)}, Update);
            tree = tree.AddOrUpdate(keyHash, new[] {new KeyValuePair<Type, string>(key, value)}, Update);

            string result = null;

            var items = tree.GetValueOrDefault(keyHash);
            if (items != null)
            {
                var firsreplacedem = items[0];
                if (firsreplacedem.Key == key)
                    result = firsreplacedem.Value;
                else if (items.Length > 1)
                {
                    for (var i = 1; i < items.Length; i++)
                    {
                        if (items[i].Key == key)
                        {
                            result = items[i].Value;
                            break;
                        }
                    }
                }
            }

            replacedert.That(result, Is.EqualTo("test"));
        }

19 Source : PartitionedHashMapTests.cs
with MIT License
from dadhi

[Test]
        public void Can_use_int_key_tree_to_represent_general_HashTree_with_possible_hash_conflicts()
        {
            var tree = ParreplacedionedMap.CreateEmpty<KeyValuePair<Type, string>[]>();

            var key = typeof(ParreplacedionedHashMapTests);
            var keyHash = key.GetHashCode();
            var value = "test";

            KeyValuePair<Type, string>[] Update(int _, KeyValuePair<Type, string>[] oldValue, KeyValuePair<Type, string>[] newValue)
            {
                var newItem = newValue[0];
                var oldItemCount = oldValue.Length;
                for (var i = 0; i < oldItemCount; i++)
                {
                    if (oldValue[i].Key == newItem.Key)
                    {
                        var updatedItems = new KeyValuePair<Type, string>[oldItemCount];
                        Array.Copy(oldValue, updatedItems, updatedItems.Length);
                        updatedItems[i] = newItem;
                        return updatedItems;
                    }
                }

                var addedItems = new KeyValuePair<Type, string>[oldItemCount + 1];
                Array.Copy(oldValue, addedItems, addedItems.Length);
                addedItems[oldItemCount] = newItem;
                return addedItems;
            }

            tree.AddOrUpdate(keyHash, new[] { new KeyValuePair<Type, string>(key, value) }, Update);
            tree.AddOrUpdate(keyHash, new[] { new KeyValuePair<Type, string>(key, value) }, Update);

            string result = null;

            var items = tree[keyHash & ParreplacedionedMap.PARreplacedION_HASH_MASK].GetValueOrDefault(keyHash);
            if (items != null)
            {
                var firsreplacedem = items[0];
                if (firsreplacedem.Key == key)
                    result = firsreplacedem.Value;
                else if (items.Length > 1)
                {
                    for (var i = 1; i < items.Length; i++)
                    {
                        if (items[i].Key == key)
                        {
                            result = items[i].Value;
                            break;
                        }
                    }
                }
            }

            replacedert.AreEqual("test", result);
        }

19 Source : AnonymousMethodClassBuilderBase.cs
with MIT License
from daixinkai

public override int GetHashCode()
            {
                int hashCode = 0;
                if (TargetType != null)
                {
                    hashCode += TargetType.GetHashCode();
                }
                hashCode += Method.Name.GetHashCode();
                ParameterInfo[] parameters = Parameters ?? Method.GetParameters();
                foreach (var item in parameters)
                {
                    hashCode += item.ParameterType.GetHashCode();
                }
                if (Method.ReturnType != null)
                {
                    hashCode += Method.ReturnType.GetHashCode();
                }
                return hashCode;
            }

19 Source : AccessorMembersKey.cs
with Apache License 2.0
from danielcrenna

public override int GetHashCode()
		{
			unchecked
			{
				var hashCode = Type != null ? Type.GetHashCode() : 0;
				hashCode = (hashCode * 397) ^ (int) Scope;
				hashCode = (hashCode * 397) ^ (int) Types;
				return hashCode;
			}
		}

19 Source : AccessorMember.cs
with Apache License 2.0
from danielcrenna

public override int GetHashCode()
		{
			unchecked
			{
				var hashCode = (Name != null ? Name.GetHashCode() : 0);
				hashCode = (hashCode * 397) ^ (DeclaringType != null ? DeclaringType.GetHashCode() : 0);
				hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0);
				return hashCode;
			}
		}

19 Source : GenericMethodCallHelper.cs
with MIT License
from Danielku15

private static int TypeArrayKey(Type[] types)
        {
            var hashCode = types[0].GetHashCode();
            for (var i = 1; i < types.Length; i++)
            {
                hashCode = (hashCode * 397) ^ types[i].GetHashCode();
            }
            return hashCode;
        }

19 Source : OpenApiType.cs
with MIT License
from Danielku15

public override int GetHashCode()
        {
            return (ClrType != null ? ClrType.GetHashCode() : 0);
        }

19 Source : SourceInfo.cs
with MIT License
from DaniilSokolyuk

public override int GetHashCode()
		{
			int hash = type.GetHashCode();
			for( int i = 0; i < paramNames.Length; i++ )
				hash += (i + 31) * paramNames[ i ].GetHashCode() ^ paramTypes[ i ].GetHashCode();
			return hash;
		}

19 Source : CallInfo.cs
with MIT License
from DaniilSokolyuk

public override int GetHashCode()
		{
			int hash = TargetType.GetHashCode() + (int) MemberTypes * Name.GetHashCode() + BindingFlags.GetHashCode() + IsReadOperation.GetHashCode();
			for( int i = 0; i < ParamTypes.Length; i++ )
			{
				hash += ParamTypes[ i ].GetHashCode() * (i + 1);
			}
			for( int i = 0; i < GenericTypes.Length; i++ )
			{
				hash += GenericTypes[ i ].GetHashCode() * (i + 1);
			}
			return hash;
		}

19 Source : MapCallInfo.cs
with MIT License
from DaniilSokolyuk

public override int GetHashCode()
		{
			int hash = base.GetHashCode() + SourceType.GetHashCode() * SourceMemberTypes.GetHashCode() * TargetMemberTypes.GetHashCode();
			for( int i = 0; i < Names.Length; i++ )
			{
				hash += Names[ i ].GetHashCode() * (i+1);
			}
			return hash;
		}

19 Source : MethodModel.cs
with MIT License
from DaniilSokolyuk

public int GetHashCode(MethodModel obj)
        {
            unchecked
            {
                var hashCode = (obj.DeclaringType != null ? obj.DeclaringType.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (obj.MethodName != null ? obj.MethodName.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (obj.ParameterTypes != null ? ArrayEqualityComparer<Type>.Instance.GetHashCode(obj.ParameterTypes) : 0);
                hashCode = (hashCode * 397) ^ (obj.GenericArguments != null ? ArrayEqualityComparer<Type>.Instance.GetHashCode(obj.GenericArguments) : 0);
                return hashCode;
            }
        }

19 Source : ValueContainerTypeBuilder.cs
with Apache License 2.0
from Dasync

public int GetHashCode(ContainerDesc desc)
            {
                unchecked
                {
                    int hash = -2128831035;

                    if (desc.DelegatedType != null)
                        hash = (hash * 16777619) ^ desc.DelegatedType.GetHashCode();

                    if (desc.ExplicitName != null)
                        hash = (hash * 16777619) ^ desc.ExplicitName.GetHashCode();

                    var props = desc.Properties;
                    if (props != null)
                    {
                        for (var i = 0; i < props.Length; i++)
                        {
                            var p = props[i];
                            if (p.Name != null)
                                hash = (hash * 16777619) ^ p.Name.GetHashCode();
                            if (p.Type != null)
                                hash = (hash * 16777619) ^ p.Type.GetHashCode();
                            if (p.Delegate != null)
                                hash = (hash * 16777619) ^ p.Delegate.GetHashCode();
                        }
                    }

                    return hash;
                }
            }

19 Source : ProxyTypeBuilder.cs
with Apache License 2.0
from Dasync

public int GetHashCode(Type[] typeArray)
            {
#warning Need to normalize/denormalize first (interfaces can implement interfaces)
                Array.Sort(typeArray, (a, b) => string.CompareOrdinal(a.replacedemblyQualifiedName, b.replacedemblyQualifiedName));
                int code = 0;
                unchecked
                {
                    foreach (var type in typeArray)
                        code = (code * 1137) ^ type.GetHashCode();
                }
                return code;
            }

19 Source : TypePair.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        return ((first != null ? first.GetHashCode() : 0) * 397) ^ (second != null ? second.GetHashCode() : 0);
      }
    }

19 Source : ExpressionHashCodeCalculator.cs
with MIT License
from DataObjects-NET

protected override int VisitTypeIs(TypeBinaryExpression tb)
    {
      return Visit(tb.Expression) ^ tb.TypeOperand.GetHashCode();
    }

19 Source : Permission.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = (Type != null ? Type.GetHashCode() : 0);
        result = (result*397) ^ CanRead.GetHashCode();
        result = (result*397) ^ CanWrite.GetHashCode();
        result = (result*397) ^ (Query != null ? Query.GetHashCode() : 0);
        return result;
      }
    }

19 Source : ExpressionHashCodeCalculator.cs
with MIT License
from DataObjects-NET

protected override int Visit(Expression e)
    {
      if (e==null)
        return NullHashCode;
      var hash = (uint) (base.Visit(e) ^ (int) e.NodeType ^ e.Type.GetHashCode());
      // transform bytes 0123 -> 1302
      hash = (hash & 0xFF00) >> 8 | (hash & 0xFF000000) >> 16 | (hash & 0xFF) << 16 | (hash & 0xFF0000) << 8;
      return (int) hash;
    }

19 Source : TypeRegistration.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = (type!=null ? type.GetHashCode() : 0);
        result = (result * 397) ^ (replacedembly!=null ? replacedembly.GetHashCode() : 0);
        result = (result * 397) ^ (@namespace!=null ? @namespace.GetHashCode() : 0);
        return result;
      }
    }

19 Source : FieldInfo.cs
with MIT License
from DataObjects-NET

private int CalculateHashCode()
    {
      unchecked {
        return
          (declaringType.GetHashCode() * 397) ^
          (valueType.GetHashCode() * 631) ^
          Name.GetHashCode();
      }
    }

19 Source : RenameFieldHint.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = base.GetHashCode();
        result = (result * 397) ^ (TargetType!=null ? TargetType.GetHashCode() : 0);
        result = (result * 397) ^ (OldFieldName!=null ? OldFieldName.GetHashCode() : 0);
        result = (result * 397) ^ (NewFieldName!=null ? NewFieldName.GetHashCode() : 0);
        return result;
      }
    }

19 Source : RenameTypeHint.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = base.GetHashCode();
        result = (result * 397) ^ (NewType!=null ? NewType.GetHashCode() : 0);
        result = (result * 397) ^ (OldType!=null ? OldType.GetHashCode() : 0);
        return result;
      }
    }

19 Source : ChangeFieldTypeHint.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = base.GetHashCode();
        result = (result * 397) ^ (Type!=null ? Type.GetHashCode() : 0);
        result = (result * 397) ^ (FieldName!=null ? FieldName.GetHashCode() : 0);
        return result;
      }
    }

19 Source : CopyFieldHint.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = base.GetHashCode();
        result = (result * 397) ^ (SourceType!=null ? SourceType.GetHashCode() : 0);
        result = (result * 397) ^ (SourceField!=null ? SourceField.GetHashCode() : 0);
        result = (result * 397) ^ (TargetType!=null ? TargetType.GetHashCode() : 0);
        result = (result * 397) ^ (TargetField!=null ? TargetField.GetHashCode() : 0);
        return result;
      }
    }

19 Source : MoveFieldHint.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked
      {
        int result = base.GetHashCode();
        result = (result * 397) ^ (SourceType != null ? SourceType.GetHashCode() : 0);
        result = (result * 397) ^ (SourceField != null ? SourceField.GetHashCode() : 0);
        result = (result * 397) ^ (TargetType != null ? TargetType.GetHashCode() : 0);
        result = (result * 397) ^ (TargetField != null ? TargetField.GetHashCode() : 0);
        return result;
      }
    }

19 Source : RecycledTypeHint.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = base.GetHashCode();
        result = (result * 397) ^ (Type!=null ? Type.GetHashCode() : 0);
        return result;
      }
    }

19 Source : StorageTypeInfo.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = (Type!=null ? Type.GetHashCode() : 0);
        result = (result * 397) ^ (IsNullable ? 1 : 0);
        if (Length.HasValue)
          result = (result * 397) ^ Length.Value;
        if (Scale.HasValue)
          result = (result * 397) ^ Scale.Value;
        if (Precision.HasValue)
          result = (result * 397) ^ Precision.Value;
        return result;
      }
    }

19 Source : TypeHelper.cs
with MIT License
from DataObjects-NET

public int GetHashCode((Type, Type[]) obj)
      {
        var hash = obj.Item1.GetHashCode();
        for (int i = obj.Item2.Length; i-- > 0;) {
          hash = HashCode.Combine(hash, obj.Item2[i]);
        }
        return hash;
      }

19 Source : TupleDescriptor.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      int result = FieldCount;
      for (int i = 0; i < FieldCount; i++)
        result = unchecked (FieldTypes[i].GetHashCode() + 29 * result);
      return result;
    }

19 Source : ExpressionTestBase.cs
with MIT License
from DataObjects-NET

public static int StaticGenericMethod<T>(int value)
      {
        return value + typeof (T).GetHashCode();
      }

19 Source : TypeInfo.cs
with MIT License
from DataObjects-NET

public override int GetHashCode()
    {
      unchecked {
        int result = (Type!=null ? Type.GetHashCode() : 0);
        result = (result * 397) ^ (IsNullable ? 1 : 0);
        result = (result * 397) ^ Length;
        result = (result * 397) ^ Scale;
        result = (result * 397) ^ Precision;
        if (Culture!=null)
          result = (result * 397) ^ Culture.GetHashCode();
        return result;
      }
    }

19 Source : ComponentExecutionOrder.cs
with GNU General Public License v3.0
from deathkiller

public override int GetHashCode()
			{
				return unchecked(this.FirstType.GetHashCode() * 13 + this.LastType.GetHashCode());
			}

See More Examples