public bool AddMobInfo(MobInfo di) { lock (_deviceHash.SyncRoot) { if (_deviceHash.ContainsKey(di.MobKey)) { return(false); } else { _deviceHash.Add(di.MobKey, di); return(true); } } }
public bool SetMobInfo(MobInfo di) { lock (_deviceHash.SyncRoot) { if (_deviceHash.ContainsKey(di.MobKey)) { _deviceHash[di.MobKey] = di; return(true); } else { return(false); } } }