Ejemplo n.º 1
0
        internal void RemoveContact(ContactInfoLocal contact)
        {
            if (ReadOnly)
            {
                return;
            }

            try
            {
                _instance.RemoveContact(contact.Key);
            }
            catch (Exception ex)
            {
                Logger.LogWarn(ex, "Can't remove contact from address book '{0}'.", Name);
            }
        }
Ejemplo n.º 2
0
        internal void InsertOrUpdateContactInfo(ContactInfoLocal contactInfo)
        {
            if (ReadOnly)
            {
                return;
            }

            try
            {
                // Check if we receive newer object that have locally
                //var remote = _instance.GetContact(contactInfo.Key);
                //if (remote != null && contactInfo.IsUpdateNeeded(remote)) throw new NewerVersionException(contactInfo, remote);

                contactInfo.Key = _instance.InsertOrUpdateContact(contactInfo);
            }
            catch (Exception ex)
            {
                Logger.LogWarn(ex, "Can't insert ot update contact on address book '{0}'.", Name);
            }
        }