public bool UnregisterScanner(ICDESniffer pScanner) { if (pScanner == null || pScanner.GetBaseThing() == null) { return(false); } if (MyDiscoScanners.Any(s => s.Key != pScanner.GetBaseThing().cdeMID)) { return(false); } pScanner.UnregisterDeviceLost(sinkByeBye); pScanner.StopScan(); MyDiscoScanners.RemoveNoCare(pScanner.GetBaseThing().cdeMID); return(true); }
public bool RegisterScanner(ICDESniffer pScanner) { if (pScanner == null || pScanner.GetBaseThing() == null) { return(false); } if (MyDiscoScanners.Any(s => s.Key == pScanner.GetBaseThing().cdeMID)) { return(false); } pScanner.RegisterDeviceLost(sinkByeBye); pScanner.StartScan(this); MyDiscoScanners.TryAdd(pScanner.GetBaseThing().cdeMID, pScanner); return(true); }