Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = RelativePath?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Summary?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Category?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Version?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Architecture.GetHashCode();
         hashCode = (hashCode * 397) ^ NeedsTerminal.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            var cmp = StringComparer.OrdinalIgnoreCase;

            return(cmp.GetHashCode(PrefixPath ?? "") ^
                   Id.GetHashCode() ^
                   cmp.GetHashCode(Description) ^
                   cmp.GetHashCode(InterpreterPath ?? "") ^
                   cmp.GetHashCode(WindowsInterpreterPath ?? "") ^
                   cmp.GetHashCode(PathEnvironmentVariable ?? "") ^
                   Architecture.GetHashCode() ^
                   Version.GetHashCode() ^
                   UIMode.GetHashCode());
        }
Exemplo n.º 3
0
 public int GetHashCodeWithMembers()
 {
     unchecked
     {
         var hashCode = 397;
         hashCode = (hashCode * 397) ^ (DdrSockets?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (MaxRam?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (SataConnections?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Architecture?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Manufacturer?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Product?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Exemplo n.º 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (RelativePath != null ? RelativePath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Summary != null ? Summary.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Category != null ? Category.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Version != null ? Version.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Architecture.GetHashCode();
         hashCode = (hashCode * 397) ^ NeedsTerminal.GetHashCode();
         return(hashCode);
     }
 }
Exemplo n.º 5
0
        //override GetHashCode and Equals so PackageReference can be properly compared/distincted.
        /// <summary>
        /// Returns the hash code for this PackageIdentifier.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hash = 0;

            if (Name != null)
            {
                hash ^= Name.GetHashCode();
            }
            if (Version != null)
            {
                hash ^= Version.GetHashCode();
            }
            if (OS != null)
            {
                hash ^= OS.GetHashCode();
            }
            return(hash ^ Architecture.GetHashCode());
        }
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = ProcessorCount;
         hashCode = (hashCode * 397) ^ TotalPhysicalMemory.GetHashCode();
         hashCode = (hashCode * 397) ^ (CommandLine?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ProcessName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ProcessId?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Architecture?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (OSName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (OSVersion?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (IpAddress?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (MachineName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (InstallId?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (RuntimeVersion?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Data?.GetCollectionHashCode() ?? 0);
         return(hashCode);
     }
 }
Exemplo n.º 7
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = ProcessorCount;
         hashCode = (hashCode * 397) ^ TotalPhysicalMemory.GetHashCode();
         hashCode = (hashCode * 397) ^ (CommandLine == null ? 0 : CommandLine.GetHashCode());
         hashCode = (hashCode * 397) ^ (ProcessName == null ? 0 : ProcessName.GetHashCode());
         hashCode = (hashCode * 397) ^ (ProcessId == null ? 0 : ProcessId.GetHashCode());
         hashCode = (hashCode * 397) ^ (Architecture == null ? 0 : Architecture.GetHashCode());
         hashCode = (hashCode * 397) ^ (OSName == null ? 0 : OSName.GetHashCode());
         hashCode = (hashCode * 397) ^ (OSVersion == null ? 0 :OSVersion.GetHashCode());
         hashCode = (hashCode * 397) ^ (IpAddress == null ? 0 : IpAddress.GetHashCode());
         hashCode = (hashCode * 397) ^ (MachineName == null ? 0 : MachineName.GetHashCode());
         hashCode = (hashCode * 397) ^ (InstallId == null ? 0 : InstallId.GetHashCode());
         hashCode = (hashCode * 397) ^ (RuntimeVersion == null ? 0 : RuntimeVersion.GetHashCode());
         hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
         return(hashCode);
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Serves as a hash function for a particular type.
 /// </summary>
 /// <returns>A hash code for the current <see cref="T:System.Object"/>.</returns>
 public override int GetHashCode()
 {
     return(Architecture.GetHashCode()
            ^ Bootable.GetHashCode()
            ^ CustomizedInfo.GetHashCode()
            ^ DefaultLanguageIndex
            ^ (String.IsNullOrEmpty(EditionId) ? 0 : EditionId.GetHashCode())
            ^ (String.IsNullOrEmpty(Hal) ? 0 : Hal.GetHashCode())
            ^ (String.IsNullOrEmpty(ImageDescription) ? 0 : ImageDescription.GetHashCode())
            ^ ImageIndex.GetHashCode()
            ^ ImageType.GetHashCode()
            ^ (String.IsNullOrEmpty(InstallationType) ? 0 : InstallationType.GetHashCode())
            ^ Languages.GetHashCode()
            ^ (String.IsNullOrEmpty(ProductName) ? 0 : ProductName.GetHashCode())
            ^ (String.IsNullOrEmpty(ProductSuite) ? 0 : ProductSuite.GetHashCode())
            ^ (String.IsNullOrEmpty(ProductType) ? 0 : ProductType.GetHashCode())
            ^ ProductVersion.GetHashCode()
            ^ SpLevel.GetHashCode()
            ^ (String.IsNullOrEmpty(SystemRoot) ? 0 : SystemRoot.GetHashCode()));
 }
Exemplo n.º 9
0
 public override int GetHashCode()
 => Hash.Combine(
     OSPlatform.GetHashCode(),
     Architecture == null ? 0 : Architecture.GetHashCode(),
     RuntimeIdentifier == null ? 0 : RuntimeIdentifier.GetHashCode());
Exemplo n.º 10
0
        public override int GetHashCode()
        {
            int result = 17;

            unchecked
            {
                if (Tool != null)
                {
                    result = (result * 31) + Tool.GetHashCode();
                }

                if (Invocation != null)
                {
                    result = (result * 31) + Invocation.GetHashCode();
                }

                if (Files != null)
                {
                    // Use xor for dictionaries to be order-independent.
                    int xor_0 = 0;
                    foreach (var value_0 in Files)
                    {
                        xor_0 ^= value_0.Key.GetHashCode();
                        if (value_0.Value != null)
                        {
                            xor_0 ^= value_0.Value.GetHashCode();
                        }
                    }

                    result = (result * 31) + xor_0;
                }

                if (Results != null)
                {
                    foreach (var value_1 in Results)
                    {
                        result = result * 31;
                        if (value_1 != null)
                        {
                            result = (result * 31) + value_1.GetHashCode();
                        }
                    }
                }

                if (Rules != null)
                {
                    // Use xor for dictionaries to be order-independent.
                    int xor_1 = 0;
                    foreach (var value_2 in Rules)
                    {
                        xor_1 ^= value_2.Key.GetHashCode();
                        if (value_2.Value != null)
                        {
                            xor_1 ^= value_2.Value.GetHashCode();
                        }
                    }

                    result = (result * 31) + xor_1;
                }

                result = (result * 31) + StartTime.GetHashCode();
                result = (result * 31) + EndTime.GetHashCode();
                if (CorrelationId != null)
                {
                    result = (result * 31) + CorrelationId.GetHashCode();
                }

                if (Architecture != null)
                {
                    result = (result * 31) + Architecture.GetHashCode();
                }

                if (Properties != null)
                {
                    // Use xor for dictionaries to be order-independent.
                    int xor_2 = 0;
                    foreach (var value_3 in Properties)
                    {
                        xor_2 ^= value_3.Key.GetHashCode();
                        if (value_3.Value != null)
                        {
                            xor_2 ^= value_3.Value.GetHashCode();
                        }
                    }

                    result = (result * 31) + xor_2;
                }

                if (Tags != null)
                {
                    foreach (var value_4 in Tags)
                    {
                        result = result * 31;
                        if (value_4 != null)
                        {
                            result = (result * 31) + value_4.GetHashCode();
                        }
                    }
                }
            }

            return(result);
        }
Exemplo n.º 11
0
 public override int GetHashCode()
 {
     return(Project.GetHashCode() ^ Architecture.GetHashCode() ^ Commit.GetHashCode());
 }