public void CallsignUpdate(CallsignDesignator call) { if (call == null) { return; } callsigns.Update(call); }
public CallsignDesignator FindByCall(string call) { CallsignDesignator info = null; if (String.IsNullOrEmpty(call)) { return(info); } Calls.TryGetValue(call, out info); return(info); }
public void Update(CallsignDesignator call) { // return on null if (call == null) { return; } // return on empty hex value if (String.IsNullOrEmpty(call.Call)) { return; } lock (this) { CallsignDesignator entry; if (!Calls.TryGetValue(call.Call, out entry)) { // key not found --> add new entry Calls.Add(call.Call, new CallsignDesignator(call.Call, call.Lat, call.Lon, call.Source, call.LastUpdated)); changed = true; } else { // key found --> check for update if (call.LastUpdated > entry.LastUpdated) { lock (entry) { // new timestamp --> udpate all not empty fields if (!String.IsNullOrEmpty(call.Call)) { entry.Call = call.Call; } entry.Lat = call.Lat; entry.Lon = call.Lon; entry.Source = call.Source; entry.LastUpdated = call.LastUpdated; changed = true; } } } } }