public bool Equals(DestinyItemSetBlockEntryDefinition input) { if (input == null) { return(false); } return (( TrackingValue == input.TrackingValue || (TrackingValue.Equals(input.TrackingValue)) ) && ( ItemHash == input.ItemHash || (ItemHash.Equals(input.ItemHash)) )); }
public void Add(string key, TrackingValue value) { lock (sync) { dict.Add (key, value); } }
public bool TryGetValue(string key, out TrackingValue value) { bool bRes = false; lock (sync) { bRes = dict.TryGetValue (key, out value); } return bRes; }
public virtual void track(string clientId, string docId, int isAlive) { if (null == clientId) clientId = ""; if (null == docId) docId = ""; TrackingValue value; string key = clientId + docId; if (key == "") key = "empty"; DateTime now = DateTime.Now; if (0 == isAlive) { if (inactiveUsers.TryGetValue(key, out value)) { value.lastTrackingTime = now; value.inactiveTicks++; } else { if (activeUsers.TryGetValue(key, out value)) { activeUsers.Remove(key); } else { value = new TrackingValue(); } value.inactiveTicks = 1; value.lastTrackingTime = now; inactiveUsers.Add(key, value); } } else { if (activeUsers.TryGetValue(key, out value)) { value.lastTrackingTime = now; value.inactiveTicks = 0; } else { if (inactiveUsers.TryGetValue(key, out value)) { inactiveUsers.Remove(key); } else { value = new TrackingValue(); } value.inactiveTicks = 0; value.lastTrackingTime = now; activeUsers.Add(key, value); } } if (now.AddDays(1.0) > oLastCleanupTime) { Cleanup(); oLastCleanupTime = now; } }