private void SaveBluetoothConnectionInfo() { try { using (MemoryStream mem = new MemoryStream()) { s_XmlSerializer.Serialize(mem, PairdLocks.ToArray()); mem.Position = 0; using (StreamReader r = new StreamReader(mem, Encoding.UTF8, true, 128, true)) _helper.Write(nameof(PairdLocks), r.ReadToEnd()); } } catch (Exception ex) { Log.Error("Save BluetoothConnectionInfo failed: {0}", ex); } }
private SettingsService() { _helper = new Template10.Services.SettingsService.SettingsHelper(); PairdLocks.AddRange(LoadBluetoothConnectionInfo()); PairdLocks.CollectionChanged += PairdLocks_CollectionChanged; }