Beispiel #1
0
        public GoogleContactSyncData CreateFrom(ContactSyncData syncDataSource)
        {
            var contact = new Contact();

            contact.Name = new Name()
            {
                FullName = syncDataSource.FullName
            };

            if (!string.IsNullOrEmpty(syncDataSource.Email))
            {
                contact.Emails.Add(new EMail()
                {
                    Primary = true,
                    Rel     = ContactsRelationships.IsWork,
                    Address = syncDataSource.Email
                });
            }

            if (!string.IsNullOrEmpty(syncDataSource.Phone))
            {
                contact.Phonenumbers.Add(new PhoneNumber()
                {
                    Primary = true,
                    Rel     = ContactsRelationships.IsWork,
                    Value   = syncDataSource.Phone,
                });
            }

            return(new GoogleContactSyncData(contact));
        }
Beispiel #2
0
 public void UpdateSyncData(GoogleContactSyncData googleSyncData, ContactSyncData syncDataSource)
 {
     googleSyncData.Contact.Name.FullName = syncDataSource.FullName;
 }