/// <summary> /// Add a device. /// </summary> public BlackBerryDevice Add(string deviceIp, string password) { BlackBerryDevice result; lock (devicesLock) { var existing = devices.FirstOrDefault(x => string.Equals(x.UniqueId, deviceIp, StringComparison.OrdinalIgnoreCase)); if (existing != null) { // Alter existing existing.Password = password; result = existing; } else { // Add new var newItem = new BlackBerryDevice(deviceIp, password); devices.Add(newItem); result = newItem; } SaveToRegistry(); } Changed.Fire(this); return(result); }
/// <summary> /// Selection has changed. /// </summary> private void cbModes_SelectedIndexChanged(object sender, EventArgs e) { if (updating == 0) { Changed.Fire(this); } }
/// <summary> /// Force a reload. /// </summary> public void Reload() { var changed = LoadFromRegistry(); if (changed) { Changed.Fire(this); } }
/// <summary> /// Update dependencies and fire Changed event. /// </summary> private void OnChanged() { if (updateCounter > 0) { changedPending = true; return; } Changed.Fire(this); }
/// <summary> /// Remove the given device from this list. /// </summary> public void Remove(BlackBerryDevice device) { lock (devicesLock) { if (!devices.Remove(device)) { return; } SaveToRegistry(); } Changed.Fire(this); }
private void raiseChanged() { CheckValues(); Changed.Fire(this); }
/// <summary> /// Setting has changed /// </summary> private void cbDirection_SelectedIndexChanged(object sender, EventArgs e) { Changed.Fire(this); }
protected void NotifyChanged([CallerMemberName] string propertyName = null) { Changed.Fire(propertyName); //PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }