예제 #1
0
        public override int GetHashCode()
        {
            var hashCode = 586867022;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + Direction.GetHashCode();
            hashCode = hashCode * -1521134295 + IsSealed.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PropertyName);

            return(hashCode);
        }
예제 #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Type != null?Type.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ IsAbstract.GetHashCode();
                hashCode = (hashCode * 397) ^ IsSealed.GetHashCode();
                hashCode = (hashCode * 397) ^ IsValueType.GetHashCode();
                hashCode = (hashCode * 397) ^ IsEnum.GetHashCode();
                return(hashCode);
            }
        }
예제 #3
0
        private Tuple <Accessibility, IsSealed, IsAbstract> EmitModifiers(Type type)
        {
            Accessibility accessLevel = Accessibility.Private;

            // check if not default
            if (type.IsPublic)
            {
                accessLevel = Accessibility.Public;
            }
            else if (type.IsNestedPublic)
            {
                accessLevel = Accessibility.Public;
            }
            else if (type.IsNestedFamily)
            {
                accessLevel = Accessibility.Protected;
            }
            else if (type.IsNestedFamANDAssem)
            {
                accessLevel = Accessibility.ProtectedInternal;
            }

            IsSealed sealedEnum = IsSealed.NotSealed;

            if (type.IsSealed)
            {
                sealedEnum = IsSealed.Sealed;
            }

            IsAbstract abstractEnum = IsAbstract.NotAbstract;

            if (type.IsAbstract)
            {
                abstractEnum = IsAbstract.Abstract;
            }

            return(new Tuple <Accessibility, IsSealed, IsAbstract>(accessLevel, sealedEnum, abstractEnum));
        }
예제 #4
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     return(IsInitialized.GetHashCode() ^ IsSealed.GetHashCode() ^ IsStandby.GetHashCode());
 }