Esempio n. 1
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);
        }
Esempio n. 2
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 (LogicalLocations != null)
                {
                    // Use xor for dictionaries to be order-independent.
                    int xor_1 = 0;
                    foreach (var value_1 in LogicalLocations)
                    {
                        xor_1 ^= value_1.Key.GetHashCode();
                        if (value_1.Value != null)
                        {
                            xor_1 ^= value_1.Value.GetHashCode();
                        }
                    }

                    result = (result * 31) + xor_1;
                }

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

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

                    result = (result * 31) + xor_2;
                }
            }

            return result;
        }