void lv_Extension_ItemChecked(object sender, ItemCheckedEventArgs e) { lock (sync) { if (e.Item == null) { return; } var info = e.Item.Tag as ExtensionInfo; if (info == null) { throw new ArgumentNullException("info"); } if (e.Item.Checked) { presenter.StartRecording(info); } else { presenter.StopRecording(info); } if (e.Item.Checked) { if (info.ExtensionType == ExtensionType.Extension) { SettingsHelper.RecordableExtensions.Add(info.PhoneNumber); } else { SettingsHelper.RecordableOutsideLines.Add(info.PhoneNumber); } } else { if (info.ExtensionType == ExtensionType.Extension) { SettingsHelper.RecordableExtensions.Remove(info.PhoneNumber); } else { SettingsHelper.RecordableOutsideLines.Remove(info.PhoneNumber); } } } }