예제 #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (AppName.Length != 0)
            {
                hash ^= AppName.GetHashCode();
            }
            if (BuildVersion.Length != 0)
            {
                hash ^= BuildVersion.GetHashCode();
            }
            if (MachineId.Length != 0)
            {
                hash ^= MachineId.GetHashCode();
            }
            if (Bundle.Length != 0)
            {
                hash ^= Bundle.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
예제 #2
0
        /// <summary>Returns the hash code for this instance.</summary>
        /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = EqualityComparer <T> .Default.GetHashCode(State);

                hashCode = (hashCode * 397) ^ MachineId.GetHashCode();
                return(hashCode);
            }
        }
        // Unable to cast from object to MachineId.
        public override void CallResultObject(object value)
        {
            try
            {
                if (value == null)
                {
                    return;
                }
                MachineId r = (MachineId)value;
                if (this.IsCreateMachineMethod)
                {
                    this.IsCreateMachineMethod = false;

                    ThreadTrace obj = this.ThreadTrace[this.ThreadTrace.Count - 1];
                    obj.Accesses.Add(new ActionInstr(r.GetHashCode(), true));
                }
            }
            catch (Exception)
            {
                try
                {
                    Task tid = (Task)value;
                    this.DebugTrace.Add($"<ThreadMonitorLog> Task {tid.Id} created.");
                    if (TaskMethods.Count > 0)
                    {
                        Method m = TaskMethods[TaskMethods.Count - 1].Item1;
                        TaskMethods[TaskMethods.Count - 1] = new Tuple <Method, int>(m, tid.Id);
                        ThreadTrace obj = this.ThreadTrace[this.ThreadTrace.Count - 1];
                        obj.Accesses.Add(new ActionInstr(true, tid.Id));
                    }
                }
                catch (Exception)
                {
                    // TODO: this is a hack.
                }
            }
        }
예제 #4
0
 public override int GetHashCode()
 => MachineId.GetHashCode();
예제 #5
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>int</returns>
 public override int GetHashCode()
 {
     return(MachineId.GetHashCode());
 }
예제 #6
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>int</returns>
 public override int GetHashCode()
 {
     return(mid.GetHashCode());
 }