示例#1
0
        /// <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);
     }
 }
示例#3
0
        /// <summary>
        /// Force a reload.
        /// </summary>
        public void Reload()
        {
            var changed = LoadFromRegistry();

            if (changed)
            {
                Changed.Fire(this);
            }
        }
示例#4
0
 /// <summary>
 /// Update dependencies and fire Changed event.
 /// </summary>
 private void OnChanged()
 {
     if (updateCounter > 0)
     {
         changedPending = true;
         return;
     }
     Changed.Fire(this);
 }
示例#5
0
 /// <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);
 }
示例#8
0
 protected void NotifyChanged([CallerMemberName] string propertyName = null)
 {
     Changed.Fire(propertyName);
     //PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
 }