示例#1
0
    public override int GetHashCode()
    {
        unchecked
        {
            var hashCode = EnumTypeFullyQualified.GetHashCode();
            hashCode = (hashCode * 397) ^ IsValidatable.GetHashCode();
            hashCode = (hashCode * 397) ^ HasCreateInvalidImplementation.GetHashCode();
            hashCode = (hashCode * 397) ^ IsReferenceType.GetHashCode();
            hashCode = (hashCode * 397) ^ IsAbstract.GetHashCode();
            hashCode = (hashCode * 397) ^ AttributeInfo.GetHashCode();
            hashCode = (hashCode * 397) ^ KeyProperty.GetHashCode();
            hashCode = (hashCode * 397) ^ (BaseEnum?.GetHashCode() ?? 0);
            hashCode = (hashCode * 397) ^ Settings.GetHashCode();
            hashCode = (hashCode * 397) ^ ItemNames.ComputeHashCode();
            hashCode = (hashCode * 397) ^ AssignableInstanceFieldsAndProperties.ComputeHashCode();
            hashCode = (hashCode * 397) ^ FullyQualifiedDerivedTypes.ComputeHashCode();

            return(hashCode);
        }
    }
示例#2
0
    public bool Equals(EnumSourceGeneratorState?other)
    {
        if (ReferenceEquals(null, other))
        {
            return(false);
        }
        if (ReferenceEquals(this, other))
        {
            return(true);
        }

        return(EnumTypeFullyQualified == other.EnumTypeFullyQualified &&
               IsValidatable == other.IsValidatable &&
               HasCreateInvalidImplementation == other.HasCreateInvalidImplementation &&
               IsReferenceType == other.IsReferenceType &&
               IsAbstract == other.IsAbstract &&
               AttributeInfo.Equals(other.AttributeInfo) &&
               KeyProperty.Equals(other.KeyProperty) &&
               Equals(BaseEnum, other.BaseEnum) &&
               Settings.Equals(other.Settings) &&
               ItemNames.EqualsTo(other.ItemNames) &&
               AssignableInstanceFieldsAndProperties.EqualsTo(other.AssignableInstanceFieldsAndProperties) &&
               FullyQualifiedDerivedTypes.EqualsTo(other.FullyQualifiedDerivedTypes));
    }