public bool IsSameConnectionDetails(ConnectionEntry other)
        {
            if (other == null)
            {
                return(false);
            }

            if (string.Compare(this.UserKey, other.UserKey, true) != 0)
            {
                return(false);
            }

            return(true);
        }
Пример #2
0
        private void AddOrUpdate(ConnectionEntry connectionEntry)
        {
            ConnectionEntry found = _credentialsList.Find(item => item.IsSameConnectionDetails(connectionEntry));

            if (found != null)
            {
                if (!string.IsNullOrEmpty(connectionEntry.Name))
                {
                    // and update the name if there is one
                    found.Name = connectionEntry.Name;
                }
            }
            else
            {
                _credentialsList.Add(connectionEntry);      // remember connection details so Delete All can clear the cache of them
            }
        }